/* ==========================================================================
   Star Loan auth pages (login, 2FA, password change) — centered card on a
   deep navy-to-royal-blue gradient, standalone from the app shell's own
   (green) brand tokens in app.css since this page intentionally commits to
   its own single look rather than following the console's theme.
   ========================================================================== */

*, *::before, *::after{ box-sizing:border-box; }
html, body{ margin:0; padding:0; min-height:100%; background:#0A1638; }

.auth-shell{
  --auth-navy-deep:#0A1638;
  --auth-navy:#0F1F4B;
  --auth-royal:#1E3E8C;
  --auth-royal-bright:#3D63C9;
  --auth-accent:#3B6FE0;
  --auth-accent-hover:#2E58C4;
  --auth-accent-soft:#EAF0FE;
  --auth-card-bg:#FFFFFF;
  --auth-ink:#101828;
  --auth-ink-soft:#5B6472;
  --auth-ink-mute:#98A2B3;
  --auth-line:#E4E7EC;
  --auth-danger:#B42318;
  --auth-danger-bg:#FEF3F2;

  min-height:100vh; min-height:100dvh; width:100%;
  display:flex; align-items:center; align-items:safe center; justify-content:center;
  padding:32px 20px;
  position:relative; overflow-x:hidden; overflow-y:auto;
  background:
    radial-gradient(60% 55% at 14% 8%, rgba(61,99,201,0.35), transparent 60%),
    radial-gradient(55% 60% at 100% 100%, rgba(30,62,140,0.55), transparent 65%),
    linear-gradient(135deg, var(--auth-navy-deep) 0%, var(--auth-navy) 45%, var(--auth-royal) 100%);
  font-family:'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

/* Subtle geometric wave pattern, layered low-opacity SVG strokes drifting
   across the lower half of the viewport. Pinned with position:fixed (not
   absolute) so they sit against the actual viewport rather than the
   scrollable .auth-shell box -- a negatively-offset absolute layer here
   would otherwise inflate .auth-shell's own scrollable area by a few
   phantom pixels once overflow-y can scroll on short viewports. */
.auth-shell::before,
.auth-shell::after{
  content:""; position:fixed; left:0; right:0; pointer-events:none;
  background-repeat:no-repeat; background-size:cover;
}
.auth-shell::before{
  bottom:-6%; height:52%; opacity:0.16;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 400' preserveAspectRatio='none'%3E%3Cpath d='M0 220 C 240 120, 480 320, 720 220 S 1200 120, 1440 220 L1440 400 L0 400 Z' fill='%23FFFFFF'/%3E%3C/svg%3E");
  background-position:bottom;
}
.auth-shell::after{
  bottom:-10%; height:46%; opacity:0.10;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 400' preserveAspectRatio='none'%3E%3Cpath d='M0 260 C 260 340, 520 160, 800 240 S 1220 340, 1440 260 L1440 400 L0 400 Z' fill='%23FFFFFF'/%3E%3C/svg%3E");
  background-position:bottom;
}

/* Faint geometric line/dot grid across the whole background for texture. */
.auth-grid{
  position:fixed; inset:0; pointer-events:none;
  background-image:
    linear-gradient(rgba(255,255,255,0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.05) 1px, transparent 1px);
  background-size:56px 56px;
  -webkit-mask-image:radial-gradient(120% 100% at 50% 0%, #000 40%, transparent 78%);
          mask-image:radial-gradient(120% 100% at 50% 0%, #000 40%, transparent 78%);
}

/* -------------------------------------------------------------------- */
/* Card                                                                  */
/* -------------------------------------------------------------------- */
.auth-card{
  position:relative; z-index:1;
  width:100%; max-width:412px;
  background:var(--auth-card-bg);
  border-radius:20px;
  padding:40px 36px 32px;
  box-shadow:0 32px 64px -20px rgba(6,14,36,0.55), 0 2px 4px rgba(6,14,36,0.08);
}

.auth-brand{ display:flex; align-items:center; gap:11px; margin-bottom:28px; }
.auth-brand-mark{
  width:40px; height:40px; border-radius:11px; flex:none;
  background:linear-gradient(135deg, var(--auth-royal-bright), var(--auth-accent));
  color:#fff; display:flex; align-items:center; justify-content:center;
  font-size:1.25rem; box-shadow:0 6px 16px -4px rgba(59,111,224,0.55);
}
.auth-brand-name{ font-weight:700; font-size:1.05rem; color:var(--auth-ink); display:block; letter-spacing:-0.01em; }
.auth-brand-sub{ font-size:0.72rem; color:var(--auth-ink-mute); letter-spacing:0.08em; text-transform:uppercase; }

.auth-card h1{ font-size:1.5rem; font-weight:700; margin:0 0 6px; color:var(--auth-ink); text-wrap:balance; }
.auth-card .lead{ color:var(--auth-ink-soft); font-size:0.92rem; margin:0 0 26px; line-height:1.5; }

.auth-alert{
  display:flex; align-items:flex-start; gap:9px;
  padding:11px 13px; margin-bottom:18px; border-radius:10px;
  background:var(--auth-danger-bg); color:var(--auth-danger);
  font-size:0.85rem; line-height:1.4;
}
.auth-alert .ico{ flex:none; font-weight:700; }

/* -------------------------------------------------------------------- */
/* Fields                                                                */
/* -------------------------------------------------------------------- */
.auth-field{ margin-bottom:17px; }
.auth-field label{
  display:block; font-size:0.82rem; font-weight:600; color:var(--auth-ink);
  margin-bottom:6px;
}
.auth-input-group{
  position:relative; display:flex; align-items:center;
  border:1.5px solid var(--auth-line); border-radius:11px;
  background:#fff; transition:border-color .15s ease, box-shadow .15s ease;
}
.auth-input-group:focus-within{
  border-color:var(--auth-accent);
  box-shadow:0 0 0 4px var(--auth-accent-soft);
}
.auth-input-group[data-invalid="true"]{ border-color:var(--auth-danger); }
.auth-input-icon{
  flex:none; width:42px; height:44px;
  display:flex; align-items:center; justify-content:center;
  color:var(--auth-ink-mute); pointer-events:none;
}
.auth-input-group:focus-within .auth-input-icon{ color:var(--auth-accent); }
.auth-input-group input{
  flex:1; min-width:0; height:44px; padding:0 14px 0 6px;
  border:none; background:transparent; outline:none;
  font-size:0.95rem; color:var(--auth-ink); font-family:inherit;
}
.auth-input-group input::placeholder{ color:var(--auth-ink-mute); }

.auth-code-input{
  text-align:center; letter-spacing:0.5em; text-indent:0.5em;
  font-size:1.15rem; font-weight:600; font-variant-numeric:tabular-nums;
}

.auth-toggle-visibility{
  flex:none; width:42px; height:44px;
  display:flex; align-items:center; justify-content:center;
  background:none; border:none; color:var(--auth-ink-mute); cursor:pointer;
  border-radius:0 10px 10px 0;
}
.auth-toggle-visibility:hover{ color:var(--auth-ink-soft); }
.auth-toggle-visibility:focus-visible{ outline:2px solid var(--auth-accent); outline-offset:-2px; }
.auth-toggle-visibility svg{ width:19px; height:19px; }
.auth-toggle-visibility .icon-eye-off{ display:none; }
.auth-toggle-visibility[aria-pressed="true"] .icon-eye{ display:none; }
.auth-toggle-visibility[aria-pressed="true"] .icon-eye-off{ display:block; }

/* -------------------------------------------------------------------- */
/* Remember me / forgot password row                                    */
/* -------------------------------------------------------------------- */
.auth-row{
  display:flex; align-items:center; justify-content:space-between;
  margin:2px 0 22px; font-size:0.85rem; flex-wrap:wrap; gap:8px;
}
.auth-remember{ display:flex; align-items:center; gap:8px; color:var(--auth-ink-soft); cursor:pointer; user-select:none; }
.auth-remember input[type="checkbox"]{
  width:16px; height:16px; margin:0; accent-color:var(--auth-accent); cursor:pointer;
}
.auth-forgot{ color:var(--auth-accent); font-weight:600; text-decoration:none; }
.auth-forgot:hover{ text-decoration:underline; }
.auth-forgot-static{ color:var(--auth-ink-mute); }

/* -------------------------------------------------------------------- */
/* Submit + footer                                                      */
/* -------------------------------------------------------------------- */
.auth-submit{
  width:100%; height:46px; border:none; border-radius:11px;
  background:var(--auth-accent); color:#fff;
  font-size:0.96rem; font-weight:600; letter-spacing:0.01em;
  cursor:pointer; transition:background-color .15s ease, transform .1s ease;
  box-shadow:0 12px 24px -8px rgba(59,111,224,0.6);
}
.auth-submit:hover{ background:var(--auth-accent-hover); }
.auth-submit:active{ transform:translateY(1px); }
.auth-submit:focus-visible{ outline:2px solid #fff; outline-offset:2px; }

.auth-foot{
  margin-top:26px; padding-top:18px; border-top:1px solid var(--auth-line);
  font-size:0.72rem; color:var(--auth-ink-mute); text-align:center;
}

@media (max-width:420px){
  .auth-card{ padding:32px 22px 26px; border-radius:16px; }
}
