/* =========================================================
   COINFLOW — LOGIN PAGE
   File: /assets/css/login.css
   ========================================================= */

/* =========================
   1. DESIGN TOKENS
========================= */

:root {
  --login-bg: #071525;
  --login-white: #ffffff;

  --login-navy: #071525;
  --login-navy-light: #10243b;

  --login-blue: #2f80ed;
  --login-blue-dark: #236fd5;
  --login-blue-soft: #edf5ff;

  --login-text: #101b2d;
  --login-muted: #7b8798;

  --login-border: #e4eaf2;
  --login-border-hover: #c9d7e9;

  --login-red: #e45656;
  --login-green: #20a779;

  --login-shadow:
    0 24px 70px rgba(0, 0, 0, 0.24);

  --login-radius: 18px;
  --login-input-radius: 10px;

  --login-transition: 0.22s ease;
}


/* =========================
   2. RESET
========================= */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;

  color: var(--login-text);
  background: var(--login-bg);

  font-family:
    Inter,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Roboto,
    Helvetica,
    Arial,
    sans-serif;

  font-size: 14px;
  line-height: 1.6;

  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
}

a {
  color: inherit;
  text-decoration: none;
}

::selection {
  color: #ffffff;
  background: var(--login-blue);
}


/* =========================
   3. DARK NAVY BACKGROUND
========================= */

.login-page {
  position: relative;
  isolation: isolate;

  display: flex;
  align-items: flex-start;
  justify-content: center;

  min-height: 100vh;
  padding: 64px 24px 70px;

  overflow: hidden;

  background:
    radial-gradient(
      ellipse at 15% 15%,
      rgba(47, 128, 237, 0.18),
      transparent 38%
    ),
    radial-gradient(
      ellipse at 85% 85%,
      rgba(35, 111, 213, 0.13),
      transparent 38%
    ),
    linear-gradient(
      135deg,
      #071525 0%,
      #0a1b30 50%,
      #071525 100%
    );
}

.login-page::before,
.login-page::after {
  position: absolute;
  z-index: -1;

  content: "";
  pointer-events: none;

  border: 1px solid rgba(100, 165, 255, 0.09);
  border-radius: 50%;
}

.login-page::before {
  top: -230px;
  left: -170px;

  width: 360px;
  height: 360px;

  box-shadow:
    0 0 100px rgba(47, 128, 237, 0.07);
}

.login-page::after {
  right: -220px;
  bottom: -220px;

  width: 460px;
  height: 460px;

  box-shadow:
    0 0 120px rgba(47, 128, 237, 0.08);
}


/* =========================
   4. MAIN CONTAINER
========================= */

.login-container {
  position: relative;
  z-index: 1;

  display: flex;
  flex-direction: column;
  align-items: center;

  width: 100%;
  max-width: 470px;

  margin: 0 auto;
}


/* =========================
   5. COINFLOW LOGO
========================= */

.auth-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;

  margin-bottom: 29px;

  color: #ffffff;

  font-size: 25px;
  font-weight: 800;
  letter-spacing: -1.1px;

  transition:
    opacity var(--login-transition),
    transform var(--login-transition);
}

.auth-logo:hover {
  opacity: 0.88;
  transform: translateY(-1px);
}

.auth-logo > span:last-child {
  display: inline-flex;
  align-items: center;
}

.auth-logo > span:last-child > span {
  color: var(--login-blue);
}

.logo-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  width: 39px;
  height: 39px;

  color: #ffffff;

  background:
    linear-gradient(
      145deg,
      #438ff4,
      #236fd5
    );

  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 12px;

  box-shadow:
    0 7px 20px rgba(47, 128, 237, 0.3);

  font-size: 22px;
  font-weight: 800;
  letter-spacing: -1px;
}


/* =========================
   6. LOGIN CARD
========================= */

.login-card {
  width: 100%;
  padding: 39px 36px 31px;

  background: var(--login-white);

  border: 1px solid rgba(255, 255, 255, 0.85);
  border-radius: var(--login-radius);

  box-shadow: var(--login-shadow);

  animation: loginCardEnter 0.55s ease both;
}

@keyframes loginCardEnter {
  from {
    opacity: 0;
    transform: translateY(12px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}


/* =========================
   7. LOGIN HEADER
========================= */

.login-header {
  margin-bottom: 30px;
  text-align: center;
}

.login-header h1 {
  margin: 0 0 9px;

  color: var(--login-navy);

  font-size: clamp(27px, 4vw, 31px);
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: -1.1px;
}

.login-header p {
  margin: 0;

  color: var(--login-muted);

  font-size: 13px;
  font-weight: 400;
  line-height: 1.7;
}


/* =========================
   8. FORM LAYOUT
========================= */

.login-form {
  display: flex;
  flex-direction: column;
  gap: 22px;

  width: 100%;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 9px;

  width: 100%;
  min-width: 0;
}

.form-group label {
  color: #26364b;

  font-size: 13px;
  font-weight: 700;
  line-height: 1.4;
}


/* =========================
   9. LABEL ROW
========================= */

.label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.label-row label {
  min-width: 0;
}

.forgot-link {
  flex-shrink: 0;

  color: var(--login-blue);

  font-size: 11px;
  font-weight: 700;

  transition: color var(--login-transition);
}

.forgot-link:hover {
  color: var(--login-blue-dark);
  text-decoration: underline;
}


/* =========================
   10. INPUT FIELDS
========================= */

.form-group input {
  display: block;

  width: 100%;
  height: 50px;

  margin: 0;
  padding: 0 14px;

  color: var(--login-text);
  background: #ffffff;

  border: 1px solid var(--login-border);
  border-radius: var(--login-input-radius);

  outline: none;

  font-size: 13px;
  font-weight: 500;
  line-height: normal;

  transition:
    border-color var(--login-transition),
    box-shadow var(--login-transition),
    background-color var(--login-transition);
}

.form-group input::placeholder {
  color: #a0aabb;
  opacity: 1;
  font-weight: 400;
}

.form-group input:hover {
  border-color: var(--login-border-hover);
}

.form-group input:focus {
  border-color: var(--login-blue);

  background: #ffffff;

  box-shadow:
    0 0 0 3px rgba(47, 128, 237, 0.11);
}

.form-group input:focus-visible {
  outline: none;
}


/* =========================
   11. PASSWORD INPUT
========================= */

.password-input {
  position: relative;

  display: flex;
  align-items: center;

  width: 100%;
}

.password-input input {
  width: 100%;
  padding-right: 72px;
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 12px;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  min-width: 43px;
  min-height: 34px;

  padding: 5px 6px;

  color: var(--login-blue);
  background: transparent;

  border: none;
  border-radius: 6px;

  font-size: 12px;
  font-weight: 700;

  transform: translateY(-50%);

  transition:
    color var(--login-transition),
    background-color var(--login-transition);
}

.password-toggle:hover {
  color: var(--login-blue-dark);
  background: var(--login-blue-soft);
}

.password-toggle:focus-visible {
  outline: 2px solid var(--login-blue);
  outline-offset: 2px;
}


/* =========================
   12. VALIDATION ERRORS
========================= */

.field-error {
  display: block;

  min-height: 0;
  margin: -2px 0 0;

  color: var(--login-red);

  font-size: 11px;
  font-weight: 500;
  line-height: 1.5;

  overflow-wrap: anywhere;
}

.field-error:empty {
  display: none;
}

.form-group input.input-error {
  border-color: var(--login-red);

  background: #fffafa;

  box-shadow:
    0 0 0 3px rgba(228, 86, 86, 0.075);
}

.form-group input.input-error:focus {
  border-color: var(--login-red);

  box-shadow:
    0 0 0 3px rgba(228, 86, 86, 0.11);
}

.form-group input.input-success {
  border-color: var(--login-green);

  background: #fbfffd;
}


/* =========================
   13. REMEMBER ME
========================= */

.remember {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  gap: 9px;

  margin-top: -3px;

  color: #647286;

  font-size: 12px;
  font-weight: 500;
  line-height: 1.5;

  cursor: pointer;
}

.remember input[type="checkbox"] {
  flex: 0 0 16px;

  width: 16px;
  height: 16px;

  margin: 0;

  accent-color: var(--login-blue);

  cursor: pointer;
}

.remember input[type="checkbox"]:focus-visible {
  outline: 2px solid var(--login-blue);
  outline-offset: 3px;
}


/* =========================
   14. LOGIN BUTTON
========================= */

.login-button {
  position: relative;

  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;

  width: 100%;
  min-height: 51px;

  margin-top: 1px;
  padding: 13px 20px;

  color: #ffffff;

  background:
    linear-gradient(
      135deg,
      #3788f4 0%,
      #2f80ed 50%,
      #236fd5 100%
    );

  border: 1px solid transparent;
  border-radius: 10px;

  box-shadow:
    0 7px 16px rgba(47, 128, 237, 0.19);

  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.1px;

  overflow: hidden;

  transition:
    background var(--login-transition),
    box-shadow var(--login-transition),
    transform var(--login-transition),
    opacity var(--login-transition);
}

.login-button::before {
  position: absolute;
  top: 0;
  left: -120%;

  width: 70%;
  height: 100%;

  content: "";

  background:
    linear-gradient(
      110deg,
      transparent,
      rgba(255, 255, 255, 0.17),
      transparent
    );

  transform: skewX(-20deg);

  transition: left 0.65s ease;

  pointer-events: none;
}

.login-button:hover:not(:disabled) {
  background:
    linear-gradient(
      135deg,
      #2f80ed,
      #236fd5
    );

  box-shadow:
    0 10px 23px rgba(47, 128, 237, 0.27);

  transform: translateY(-1px);
}

.login-button:hover:not(:disabled)::before {
  left: 150%;
}

.login-button:active:not(:disabled) {
  transform: translateY(0);

  box-shadow:
    0 4px 10px rgba(47, 128, 237, 0.18);
}

.login-button:focus-visible {
  outline: 3px solid rgba(47, 128, 237, 0.28);
  outline-offset: 3px;
}

.login-button:disabled {
  opacity: 0.75;
  box-shadow: none;
}


/* =========================
   15. BUTTON LOADER
========================= */

.button-loader {
  display: none;

  width: 17px;
  height: 17px;

  flex: 0 0 17px;

  border: 2px solid rgba(255, 255, 255, 0.38);
  border-top-color: #ffffff;
  border-radius: 50%;
}

.login-button.loading .button-loader {
  display: inline-block;

  animation: loginSpinner 0.7s linear infinite;
}

.login-button.loading .button-text {
  opacity: 0.95;
}

.login-button.loading::before {
  display: none;
}

@keyframes loginSpinner {
  to {
    transform: rotate(360deg);
  }
}


/* =========================
   16. REGISTER LINK
========================= */

.register-link {
  margin-top: 27px;

  color: var(--login-muted);

  font-size: 12px;
  font-weight: 400;
  line-height: 1.8;

  text-align: center;
}

.register-link a {
  margin-left: 3px;

  color: var(--login-blue);

  font-weight: 700;

  transition: color var(--login-transition);
}

.register-link a:hover {
  color: var(--login-blue-dark);
  text-decoration: underline;
}


/* =========================
   17. ACCESSIBILITY
========================= */

a:focus-visible {
  outline: 2px solid var(--login-blue);
  outline-offset: 4px;
  border-radius: 4px;
}


/* =========================
   18. TABLET
========================= */

@media (max-width: 600px) {
  .login-page {
    padding: 43px 18px 45px;
  }

  .login-container {
    max-width: 450px;
  }

  .auth-logo {
    margin-bottom: 24px;
    font-size: 24px;
  }

  .logo-mark {
    width: 37px;
    height: 37px;

    font-size: 21px;
  }

  .login-card {
    padding: 33px 27px 28px;

    border-radius: 16px;
  }

  .login-header {
    margin-bottom: 27px;
  }

  .login-header h1 {
    font-size: 28px;
  }

  .login-form {
    gap: 21px;
  }

  .form-group input {
    height: 49px;
  }

  .login-button {
    min-height: 49px;
  }
}


/* =========================
   19. MOBILE
========================= */

@media (max-width: 420px) {
  .login-page {
    padding: 30px 13px 32px;
  }

  .login-container {
    max-width: 100%;
  }

  .auth-logo {
    gap: 8px;

    margin-bottom: 21px;

    font-size: 23px;
  }

  .logo-mark {
    width: 35px;
    height: 35px;

    border-radius: 10px;

    font-size: 20px;
  }

  .login-card {
    padding: 28px 20px 24px;

    border-radius: 14px;

    box-shadow:
      0 12px 36px rgba(0, 0, 0, 0.2);
  }

  .login-header {
    margin-bottom: 25px;
  }

  .login-header h1 {
    font-size: 26px;
    letter-spacing: -0.8px;
  }

  .login-header p {
    font-size: 12px;
  }

  .login-form {
    gap: 20px;
  }

  .form-group {
    gap: 8px;
  }

  .form-group label {
    font-size: 12px;
  }

  .form-group input {
    height: 47px;
    padding-right: 12px;
    padding-left: 12px;

    font-size: 12px;
  }

  .password-input input {
    padding-right: 65px;
  }

  .password-toggle {
    right: 8px;
    font-size: 11px;
  }

  .label-row {
    gap: 8px;
  }

  .forgot-link {
    font-size: 10px;
  }

  .remember {
    font-size: 11px;
  }

  .login-button {
    min-height: 48px;
    padding: 12px 15px;

    font-size: 12px;
  }

  .register-link {
    margin-top: 23px;
    font-size: 11px;
  }
}


/* =========================
   20. VERY SMALL SCREENS
========================= */

@media (max-width: 350px) {
  .login-page {
    padding-right: 10px;
    padding-left: 10px;
  }

  .login-card {
    padding: 24px 15px 21px;
  }

  .login-header h1 {
    font-size: 24px;
  }

  .login-header p {
    font-size: 11px;
  }

  .form-group input {
    font-size: 11px;
  }

  .forgot-link {
    font-size: 9px;
  }
}


/* =========================
   21. REDUCED MOTION
========================= */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;

    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;

    transition-duration: 0.01ms !important;
  }
}