/* =====================================================================
   LOGIN PAGE — full styling for the authenticated sign-in screen
   ---------------------------------------------------------------------
   Scope: everything on the login screen, prefixed/scoped with
   `.login-page`. Zero third-party links; colors and sizing come
   straight from the design tokens defined in main.css (--surface,
   --primary-*, --text, --accent, --radius*, --shadow*, --ease).

   No horizontal scrolling:
     • the card is width:100% capped by max-width:440px
     • the input fields are width:100% with box-sizing from the reset
     • a tighter mobile breakpoint (≤ 480px) shrinks padding
       and the logo without ever overflowing the viewport

   Mobile update:
     • Premium mobile-app look — 20px card radii, 52px input height,
       16px inputs (prevents iOS auto-zoom), safe-area padding,
       larger submit hit-area, softer staggered entrance animation.
   ===================================================================== */


/* --- Login shell -------------------------------------------------- */
.login-page {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  background: var(--surface);
}

.login-shell {
  width: 100%;
  max-width: 440px;
}

.login-card {
  background: #ffffff;
  border: 1px solid var(--primary-10);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 40px 36px 26px;
  animation: loginIn .5s cubic-bezier(.2,.7,.3,1) both;
}

@keyframes loginIn {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}


/* --- Brand ------------------------------------------------------- */
.login-brand {
  display: inline-flex;
  align-items: center;
  margin-bottom: 26px;
  transition: opacity .25s var(--ease);
}
.login-brand:hover { opacity: .8; }
.login-logo {
  display: block;
  height: 46px;
  width: auto;
  max-width: 220px;
}


/* --- Head -------------------------------------------------------- */
.login-head { margin-bottom: 24px; }
.login-head .eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-soft);
  margin-bottom: 10px;
}
.login-head .eyebrow::before {
  content: "";
  display: inline-block;
  width: 24px;
  height: 1px;
  background: var(--accent);
}
.login-head h1 {
  font-size: 1.75rem;
  line-height: 1.15;
  letter-spacing: -0.025em;
  color: var(--text);
  margin-bottom: 6px;
}
.login-head p {
  font-size: 0.92rem;
  color: var(--text-soft);
  line-height: 1.55;
  max-width: 340px;
}


/* --- Flash ------------------------------------------------------- */
.login-flash { margin-bottom: 18px; }


/* --- Form -------------------------------------------------------- */
.login-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.login-form .form-field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-width: 0;
}
.login-form .form-field > label {
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-soft);
}
.login-form .form-field > label .req {
  color: #000000;
  margin-left: 2px;
}
.login-form .form-field input {
  width: 100%;
  height: 46px;
  padding: 0 14px;
  border-radius: 10px;
  background: #ffffff;
  border: 1px solid var(--primary-15);
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  outline: none;
  transition: border-color .18s var(--ease),
              box-shadow   .18s var(--ease),
              background   .18s var(--ease);
}
.login-form .form-field input::placeholder { color: var(--accent); }
.login-form .form-field input:hover { border-color: var(--primary-25); }
.login-form .form-field input:focus {
  border-color: #000000;
  box-shadow: 0 0 0 3px var(--primary-12);
}


/* --- Password show/hide ------------------------------------------ */
.password-wrap { position: relative; }
.password-wrap input { padding-right: 46px !important; }

.pw-toggle {
  position: absolute;
  top: 50%;
  right: 7px;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  border: 0;
  background: transparent;
  color: var(--accent);
  cursor: pointer;
  transition: background .15s var(--ease), color .15s var(--ease);
}
.pw-toggle:hover {
  background: var(--primary-05);
  color: var(--text);
}
.pw-toggle svg { width: 18px; height: 18px; }

.pw-toggle .pw-icon-off { display: none; }
.password-wrap.is-visible .pw-icon-eye { display: none; }
.password-wrap.is-visible .pw-icon-off { display: block; }


/* --- Submit ------------------------------------------------------ */
.login-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  height: 48px;
  margin-top: 4px;
  border: 0;
  border-radius: 10px;
  background: #000000;
  color: #ffffff;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: background .18s var(--ease),
              transform  .15s var(--ease),
              box-shadow .25s var(--ease);
  box-shadow: 0 4px 14px rgba(0, 0, 0, .35);
}
.login-submit:hover {
  background: #676464;
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, .45);
}
.login-submit:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(0, 0, 0, .35);
}
.login-submit svg {
  width: 16px;
  height: 16px;
  transition: transform .25s var(--ease);
}
.login-submit:hover svg { transform: translateX(3px); }


/* --- Foot -------------------------------------------------------- */
.login-foot {
  margin-top: 26px;
  padding-top: 18px;
  border-top: 1px solid var(--primary-10);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 12.5px;
  color: var(--text-soft);
  flex-wrap: wrap;
}
.login-foot a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-soft);
  transition: color .18s var(--ease);
}
.login-foot a:hover { color: #000000; }
.login-foot svg { width: 14px; height: 14px; }

.login-meta {
  margin-top: 16px;
  text-align: center;
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-weight: 500;
  color: var(--accent);
}


/* --- Login — small-screen tuning (no horizontal scroll) ---------- */
@media (max-width: 480px) {
  .login-page { padding: 24px 16px; }
  .login-card { padding: 32px 22px 22px; border-radius: var(--radius); }
  .login-head h1 { font-size: 1.55rem; }
  .login-logo { height: 40px; }
  .login-foot { justify-content: center; }
  .login-foot .foot-sep { display: none; }
}


/* =====================================================================
   MOBILE-APP REFINEMENTS  (screen only; print untouched)
   ---------------------------------------------------------------------
   Adds premium mobile-app appearance while keeping the current
   desktop look intact. Uses only existing selectors.
   ===================================================================== */
@media screen and (max-width: 640px) {
  .login-page {
    padding-top: max(28px, env(safe-area-inset-top));
    padding-bottom: max(28px, env(safe-area-inset-bottom));
    padding-left: max(16px, env(safe-area-inset-left));
    padding-right: max(16px, env(safe-area-inset-right));
    align-items: flex-start;
    padding-top: max(56px, calc(env(safe-area-inset-top) + 40px));
  }

  .login-shell { max-width: 100%; }

  .login-card {
    border-radius: 22px;
    padding: 30px 22px 22px;
    box-shadow: 0 18px 48px -20px rgba(0, 0, 0, .28),
                0 2px 6px rgba(0, 0, 0, .05);
    animation: loginInMobile .55s cubic-bezier(.2,.7,.3,1) both;
  }
  @keyframes loginInMobile {
    from { opacity: 0; transform: translateY(24px) scale(.99); }
    to   { opacity: 1; transform: none; }
  }

  .login-brand { margin-bottom: 22px; }
  .login-logo  { height: 42px; }

  .login-head { margin-bottom: 22px; }
  .login-head h1 { font-size: 1.65rem; letter-spacing: -.02em; }
  .login-head p  { font-size: .95rem; max-width: none; }

  .login-form { gap: 16px; }
  .login-form .form-field { gap: 8px; }
  .login-form .form-field > label { font-size: 11px; }

  /* 52px height + 16px font → comfortable touch target and NO iOS auto-zoom */
  .login-form .form-field input {
    height: 52px;
    padding: 0 16px;
    font-size: 16px;
    border-radius: 12px;
  }
  .password-wrap input { padding-right: 54px !important; }
  .pw-toggle {
    width: 44px;
    height: 44px;
    right: 4px;
    border-radius: 10px;
  }

  .login-submit {
    height: 54px;
    border-radius: 14px;
    font-size: 15.5px;
    margin-top: 6px;
    box-shadow: 0 8px 20px -6px rgba(0, 0, 0, .4);
  }

  .login-foot {
    margin-top: 22px;
    padding-top: 16px;
    justify-content: center;
    gap: 10px;
    font-size: 12.5px;
  }
  .login-foot .foot-sep { display: none; }
  .login-foot a { padding: 6px 4px; }

  .login-meta {
    margin-top: 14px;
    font-size: 10.5px;
    letter-spacing: .14em;
  }
}

@media screen and (max-width: 360px) {
  .login-card { padding: 26px 18px 18px; border-radius: 20px; }
  .login-head h1 { font-size: 1.5rem; }
  .login-form .form-field input { height: 50px; }
  .login-submit { height: 52px; }
}