/* =========================================================
   Login page — copied from the main Billing app (frontend/assets/css/styles.css) — custom layer over Bootstrap
   Left: the product in the theme blues. Right: the sign-in card.
   ========================================================= */
:root {
  --brand: #00a1e0;          /* same as app.css */
  --brand-700: #0b3d91;      /* same as app.css --brand-dark */
  --brand-rgb: 0,161,224;
  --accent: #3b8fd6;         /* the sign-in button and links */
  --accent-dark: #2c78bd;
  --accent-rgb: 59,143,214;
  --navy: #1e3a8a;           /* card title */
  --ink: #0f172a;
  --muted: #64748b;
  --line: #dbe3ec;
  --radius: 10px;
  --display: 'Plus Jakarta Sans', 'Inter', system-ui, sans-serif;
}

body {
  font-family: 'Inter', system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
  background: #f3f6fa;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
.req { color: #dc2626; }
.btn-primary {
  --bs-btn-bg: var(--accent); --bs-btn-border-color: var(--accent);
  --bs-btn-hover-bg: var(--accent-dark); --bs-btn-hover-border-color: var(--accent-dark);
  --bs-btn-active-bg: var(--accent-dark); --bs-btn-active-border-color: var(--accent-dark);
  --bs-btn-disabled-bg: var(--accent); --bs-btn-disabled-border-color: var(--accent);
}

/* =========================================================
   LEFT PANEL
   ========================================================= */
.brand {
  position: relative; overflow: hidden;
  background:
    radial-gradient(120% 60% at 0% 0%, rgba(255,255,255,.14), transparent 60%),
    linear-gradient(170deg, #5aaee4 0%, #3b88cb 28%, #2b5fae 62%, #233f8e 100%);
}
.brand__inner {
  position: sticky; top: 0; min-height: 100vh;
  display: flex; flex-direction: column;
  padding: 46px clamp(32px, 4.4vw, 64px) 46px;
}

.brand__logo {
  align-self: flex-start; display: inline-flex; align-items: center; gap: 14px;
  padding: 9px 22px 9px 9px; border-radius: 18px;
  background: rgba(255,255,255,.13); border: 1px solid rgba(255,255,255,.26);
  box-shadow: 0 10px 26px -16px rgba(10,30,80,.6);
}
.brand__logo-mark {
  display: grid; place-items: center; width: 46px; height: 46px; border-radius: 12px; font-size: 1.35rem; color: #fff;
  background: linear-gradient(140deg, #63b9ec 0%, #3a8fd8 100%); border: 1px solid rgba(255,255,255,.4);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.35);
}
.brand__logo-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand__logo-text strong { font-family: var(--display); font-size: 1.45rem; font-weight: 800; letter-spacing: .3px; }
.brand__logo-text small { font-size: .74rem; font-weight: 500; letter-spacing: .4px; color: rgba(255,255,255,.85); }

.brand__intro { margin: auto 0; padding: 40px 0; }
.brand h1 {
  margin: 0 0 16px; font-family: var(--display); font-weight: 800; color: #fff;
  font-size: clamp(1.9rem, 2.6vw, 2.45rem); line-height: 1.16; letter-spacing: -.02em;
}
.brand__intro > p { margin: 0 0 34px; max-width: 28rem; font-size: 1.02rem; line-height: 1.6; color: rgba(255,255,255,.86); }

.brand__features { display: flex; flex-direction: column; gap: 22px; margin: 0; }
.brand__features li { display: flex; align-items: flex-start; gap: 16px; }
.brand__feature-ico {
  flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 11px; font-size: 1.05rem; color: #fff;
  background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.24);
}
.brand__features b { display: block; font-size: 1rem; font-weight: 600; color: #fff; line-height: 1.3; }
.brand__features small { display: block; margin-top: 3px; font-size: .86rem; color: rgba(255,255,255,.78); }

.brand__notice {
  display: flex; align-items: center; gap: 12px; width: fit-content; max-width: 100%;
  padding: 12px 18px; border-radius: 12px; line-height: 1.5; color: rgba(255,255,255,.9);
  font-size: clamp(.72rem, calc(1vw - 2px), .88rem);      /* grows with the panel, so the line fits */
  background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.26);
}
.brand__notice i { flex: none; font-size: 1.1rem; color: #fff; }
/* one line wherever the panel is wide enough (1280px screens and up); narrower, it wraps */
@media (min-width: 1280px) { .brand__notice span { white-space: nowrap; } }

/* =========================================================
   FORM PANEL
   ========================================================= */
.form-wrap {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-height: 100vh; padding: 32px clamp(16px, 4vw, 48px);
  background: linear-gradient(135deg, #f4f6fa 0%, #f0f4f9 55%, #e7f1fb 100%);
}
.form-wrap__inner { width: 100%; max-width: 440px; }

.login-card {
  background: #fff; border: 1px solid rgba(15,23,42,.05); border-radius: 22px; padding: 38px 36px 36px;
  box-shadow: 0 24px 50px -28px rgba(30,64,120,.28), 0 2px 6px rgba(15,23,42,.03);
  animation: cardIn .35s ease-out both;
}
@keyframes cardIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.login-card__head { display: flex; align-items: flex-start; gap: 16px; margin-bottom: 28px; }
.login-card__icon { flex: none; display: grid; place-items: center; width: 46px; height: 46px; border-radius: 12px; font-size: 1.2rem; background: #e8f3fc; color: var(--navy); }
.login-card__title { margin: 0 0 4px; font-family: var(--display); font-size: 1.7rem; font-weight: 800; letter-spacing: -.01em; color: var(--navy); line-height: 1.15; }
.login-card__sub { margin: 0; font-size: .86rem; line-height: 1.55; color: var(--muted); }

/* fields */
.form-label { margin-bottom: .4rem; font-size: .84rem; font-weight: 600; color: #1f2d3d; }
.input-group-text { min-width: 44px; justify-content: center; padding: 0 .7rem; background: #fff; border-color: var(--line); color: #94a3b8; font-size: .95rem; }
.input-group > .form-control { height: 44px; font-size: .9rem; border-color: var(--line); }
.input-group > .input-group-text:first-child { border-right: 0; border-radius: var(--radius) 0 0 var(--radius); }
.input-group > .form-control { border-left: 0; border-radius: 0 var(--radius) var(--radius) 0 !important; }
.input-group > .form-control:has(+ .password-toggle) { border-right: 0; border-radius: 0 !important; }
.input-group > .password-toggle { border-left: 0; border-radius: 0 var(--radius) var(--radius) 0 !important; cursor: pointer; }
.input-group > .password-toggle:hover { color: var(--accent); }
.form-control::placeholder { color: #a3afbd; }
.input-group .form-control:focus { box-shadow: none; }
.input-group:focus-within { border-radius: var(--radius); box-shadow: 0 0 0 .22rem rgba(var(--accent-rgb), .16); }
.input-group:focus-within > .input-group-text, .input-group:focus-within > .form-control { border-color: var(--accent); }
.input-group:focus-within > .input-group-text:first-child { color: var(--accent); }

.was-validated .input-group:has(:invalid) > .input-group-text,
.was-validated .input-group:has(:invalid) > .form-control { border-color: #dc2626; }
.was-validated .input-group:has(:invalid):focus-within { box-shadow: 0 0 0 .22rem rgba(220,38,38,.16); }
.was-validated .form-control:valid { border-color: var(--line); background-image: none; padding-right: .75rem; }
.invalid-feedback { font-size: .76rem; }
/* a failed login says why in the alert above; the field's own "enter your …" note would contradict it */
.login-alert:not(.d-none) ~ * .invalid-feedback { display: none !important; }
.caps-warning { margin-top: .4rem; font-size: .76rem; font-weight: 600; color: #b45309; }
.alert { border-radius: var(--radius); }
.login-reset { margin-bottom: 14px; }

.form-check-input { border-color: #b8c4d1; }
.form-check-input:checked { background-color: var(--accent); border-color: var(--accent); }
.form-check-input:focus { border-color: var(--accent); box-shadow: 0 0 0 .2rem rgba(var(--accent-rgb), .18); }
.form-check-label { font-size: .88rem; color: #1f2d3d; cursor: pointer; }
.auth-link { font-size: .86rem; font-weight: 600; color: var(--accent); text-decoration: none; }
.auth-link:hover { color: var(--accent-dark); text-decoration: underline; }

/* submit */
.btn-submit {
  height: 46px; border-radius: var(--radius); border: 0;
  font-size: .9rem; font-weight: 700; letter-spacing: 1.2px; text-transform: uppercase;
  box-shadow: 0 10px 22px -12px rgba(var(--accent-rgb), .8);
  transition: background-color .15s, box-shadow .15s, transform .1s;
}
.btn-submit:hover { box-shadow: 0 12px 24px -12px rgba(var(--accent-rgb), .95); }
.btn-submit:active { transform: translateY(1px); }
.btn-submit:focus-visible { box-shadow: 0 0 0 .25rem rgba(var(--accent-rgb), .3); }
.btn-submit__busy { display: none; }
.is-busy .btn-submit__label { display: none; }
.is-busy .btn-submit__busy { display: inline-flex; align-items: center; }

/* under the card: copyright and help */
.auth-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px; margin-top: 22px; padding: 0 4px; font-size: .78rem; color: #8a97a8; }   /* copyright on the left, in line with the card; help on the right */
.auth-foot__brand { font-weight: 600; color: var(--accent); }   /* as in the app footer */
.auth-foot__sep { display: none; }
.auth-help { position: relative; }
.auth-help__btn { padding: 0; border: 0; background: none; font-size: .78rem; font-weight: 600; color: #5b7aa0; }
.auth-help__btn:hover, .auth-help__btn[aria-expanded="true"] { color: var(--accent); text-decoration: underline; }
.help-pop {
  position: absolute; bottom: calc(100% + 10px); right: 0; z-index: 10; width: 300px; text-align: left;
  padding: 14px 16px; border-radius: 14px; background: #fff; border: 1px solid var(--line);
  box-shadow: 0 20px 40px -20px rgba(3,45,96,.35); font-size: .8rem; color: #334155;
}
.help-pop > b { display: block; margin-bottom: 6px; color: var(--ink); }
.help-pop ul { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 6px; line-height: 1.45; }
.auth-hint { display: flex; gap: 6px; align-items: flex-start; margin: 16px 4px 0; font-size: .76rem; line-height: 1.45; color: var(--muted); }
.auth-hint i { margin-top: 1px; color: var(--accent); }

/* =========================================================
   RESPONSIVE
   ========================================================= */
/* short laptop screens: a tighter left panel */
@media (min-width: 992px) and (max-height: 760px) {
  .brand__inner { padding-top: 30px; padding-bottom: 30px; }
  .brand__intro { padding: 24px 0; }
  .brand__intro > p { margin-bottom: 22px; }
  .brand__features { gap: 14px; }
}
/* tablet & below: the panel becomes a slim header with the logo */
@media (max-width: 991.98px) {
  .login-row { align-content: flex-start; }
  .brand__inner { position: static; min-height: 0; padding: 16px 20px; }
  .brand__intro, .brand__notice { display: none; }
  .brand__logo { padding: 6px 16px 6px 6px; border-radius: 14px; }
  .brand__logo-mark { width: 38px; height: 38px; font-size: 1.1rem; }
  .brand__logo-text strong { font-size: 1.2rem; }
  .form-wrap { min-height: 0; justify-content: flex-start; padding-top: 24px; }
}
@media (max-width: 575.98px) {
  .brand__logo-text small { font-size: .66rem; }
  .login-card { padding: 26px 20px 24px; border-radius: 18px; }
  .login-card__head { margin-bottom: 22px; }
  .login-card__title { font-size: 1.4rem; }
  .help-pop { width: min(300px, calc(100vw - 32px)); }
}
@media (prefers-reduced-motion: reduce) { .login-card { animation: none; } .btn-submit { transition: none; } }

/* demo note (frontend-only build) */
.demo-note { display: flex; gap: 8px; align-items: flex-start; margin-bottom: 16px; padding: 9px 12px; border-radius: var(--radius);
  background: #fffbeb; border: 1px dashed #fcd34d; color: #92400e; font-size: .78rem; line-height: 1.45; }
.demo-note b { color: #78350f; }

/* =========================================================
   FORGOT PASSWORD — steps, one-time code, done (copied from the main Billing app's styles.css)
   ========================================================= */
.fp-steps { list-style: none; display: flex; align-items: center; gap: 6px; margin: 0 4px 16px; padding: 0; }
.fp-steps li { display: flex; align-items: center; gap: 7px; font-size: .76rem; font-weight: 600; color: #94a3b8; white-space: nowrap; }
.fp-steps li + li::before { content: ""; width: 22px; height: 2px; margin-right: 2px; border-radius: 2px; background: #dbe3ec; }
.fp-steps li span { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; font-size: .7rem; background: #e2e8f0; color: #64748b; }
.fp-steps li.is-active { color: var(--navy); }
.fp-steps li.is-active span { background: var(--accent); color: #fff; }
.fp-steps li.is-done { color: #15803d; }
.fp-steps li.is-done span { background: #dcfce7; color: #15803d; font-size: 0; }
.fp-steps li.is-done span::after { content: "\F26E"; font-family: "bootstrap-icons"; font-size: .8rem; }
.fp-steps li.is-done + li::before { background: #86efac; }

.fp-pane[hidden] { display: none !important; }
.fp-back { display: flex; align-items: center; justify-content: center; gap: 6px; width: 100%; margin-top: 16px; padding: 0; border: 0; background: none;
  font-size: .84rem; font-weight: 600; color: var(--muted); text-decoration: none; }
.fp-back:hover { color: var(--accent); }

.fp-demo { display: flex; gap: 8px; align-items: flex-start; margin-bottom: 16px; padding: 9px 12px; border-radius: var(--radius);
  background: #fffbeb; border: 1px dashed #fcd34d; color: #92400e; font-size: .78rem; line-height: 1.45; }
.fp-demo b { letter-spacing: .18em; font-size: .86rem; color: #78350f; }
.fp-otp { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.fp-otp input {
  width: 100%; height: 50px; text-align: center; font-family: var(--display); font-size: 1.35rem; font-weight: 700; color: var(--ink);
  border: 1px solid var(--line); border-radius: 12px; background: #fff; outline: 0; transition: border-color .15s, box-shadow .15s, background .15s;
}
.fp-otp input:focus { border-color: var(--accent); box-shadow: 0 0 0 .22rem rgba(var(--accent-rgb), .16); }
.fp-otp input.is-bad { border-color: #dc2626; background: #fef2f2; animation: fpShake .3s; }
.fp-otp input.is-ok { border-color: #16a34a; background: #f0fdf4; }
@keyframes fpShake { 25% { transform: translateX(-3px); } 75% { transform: translateX(3px); } }
.fp-otp-error { min-height: 20px; margin: 8px 2px 4px; font-size: .78rem; font-weight: 600; color: #dc2626; }
.fp-otp-error.is-info { color: #15803d; }
.fp-timer { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 18px; font-size: .8rem; color: var(--muted); }
.fp-timer b { color: var(--ink); font-variant-numeric: tabular-nums; }
.fp-timer b.is-low { color: #dc2626; }
.fp-resend { padding: 0; border: 0; background: none; font-size: .8rem; font-weight: 700; color: var(--accent); }
.fp-resend:disabled { color: #94a3b8; cursor: default; }
.fp-resend:not(:disabled):hover { text-decoration: underline; }

.fp-done { text-align: center; padding: 8px 0 2px; }
.fp-done__icon { display: grid; place-items: center; width: 60px; height: 60px; margin: 0 auto 14px; border-radius: 50%; font-size: 1.9rem; color: #fff;
  background: #22c55e; box-shadow: 0 0 0 8px #dcfce7; }
.fp-done .login-card__sub { margin: 6px 0 20px; }
@media (max-width: 420px) { .fp-otp { gap: 6px; } .fp-otp input { height: 44px; font-size: 1.15rem; } .fp-steps li { font-size: .68rem; } .fp-steps li + li::before { width: 12px; } }

/* new-password helper: strength bar, policy checklist, match hint (main app's password.css) */
.pw-meter { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
.pw-meter__bars { flex: 1; display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
.pw-meter__bars i { height: 5px; border-radius: 4px; background: #e2e8f0; transition: background .2s; }
.pw-meter__label { min-width: 48px; text-align: right; font-size: .72rem; font-weight: 700; }
.pw-meter[data-score="1"] .pw-meter__bars i:nth-child(-n+1) { background: #ef4444; } .pw-meter[data-score="1"] .pw-meter__label { color: #dc2626; }
.pw-meter[data-score="2"] .pw-meter__bars i:nth-child(-n+2) { background: #f59e0b; } .pw-meter[data-score="2"] .pw-meter__label { color: #b45309; }
.pw-meter[data-score="3"] .pw-meter__bars i:nth-child(-n+3) { background: #22c55e; } .pw-meter[data-score="3"] .pw-meter__label { color: #15803d; }
.pw-meter[data-score="4"] .pw-meter__bars i { background: linear-gradient(90deg, #10b981, #0ea5e9); } .pw-meter[data-score="4"] .pw-meter__label { color: #047857; }
.pw-rules { list-style: none; margin: 10px 0 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 5px 14px; }
.pw-rules li { display: flex; align-items: center; gap: 6px; font-size: .74rem; color: #64748b; line-height: 1.3; }
.pw-rules li i { font-size: .78rem; color: #cbd5e1; flex: none; }
.pw-rules li.ok { color: #15803d; } .pw-rules li.ok i { color: #16a34a; }
.pw-match { min-height: 18px; margin-top: 5px; font-size: .74rem; font-weight: 600; }
.pw-match.is-ok { color: #15803d; } .pw-match.is-bad { color: #b45309; }
.pw-caps { margin-top: 5px; font-size: .74rem; font-weight: 600; color: #b45309; }
@media (max-width: 420px) { .pw-rules { grid-template-columns: 1fr; } }
.login-reset { border-radius: var(--radius); }

/* Bill in Air logo on a white tile */
.brand__logo-mark { background: #fff; padding: 4px; }
.brand__logo-mark .bia-logo { width: 100%; height: 100%; object-fit: contain; display: block; }
