/* =====================================================================
   BTconnect sign-in screens (Areas/UserManagement/Views/Account)
   --bt-red is the logo's own background colour, so the logo blends in.
   ===================================================================== */
:root {
    --bt-red: #c51d22;
    --bt-red-dark: #9e151a;
    --bt-red-deep: #5c0b0e;
    --bt-red-soft: #fdf0f0;
    --ink: #17191f;
    --ink-2: #4b5263;
    --ink-3: #7c8396;
    --line: #e2e5ed;
    --surface: #ffffff;
    --page: #f4f5f9;
    --ok: #127a46;
    --ok-soft: #eaf7f0;
    --info: #1f5fbf;
    --info-soft: #eef4ff;
    --radius: 12px;
    --serif: 'Zilla Slab', Georgia, 'Times New Roman', serif;
}

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

html, body { height: 100%; }

body {
    margin: 0;
    font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, Roboto, Arial, sans-serif;
    font-size: 15px;
    line-height: 1.5;
    color: var(--ink);
    background: var(--page);
    -webkit-font-smoothing: antialiased;
}

a { color: var(--bt-red); text-decoration: none; font-weight: 600; }
a:hover { text-decoration: underline; }

/* ---------- Shell ---------- */
.auth-shell { min-height: 100vh; }

/* card centred on a light dotted page with a soft brand glow */
.auth-main {
    position: relative;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 22px;
    padding: 40px 24px 28px;
    background:
        radial-gradient(700px 480px at 100% 0%, rgba(197, 29, 34, .08), transparent 70%),
        radial-gradient(600px 420px at 0% 100%, rgba(197, 29, 34, .05), transparent 70%),
        radial-gradient(#dfe2ea 1px, transparent 1px) 0 0 / 24px 24px,
        var(--page);
}

.auth-card {
    position: relative;
    width: 100%;
    max-width: 440px;
    padding: 34px 40px 36px;
    background: var(--surface);
    border: 1px solid rgba(226, 229, 237, .9);
    border-radius: 22px;
    box-shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 24px 48px -12px rgba(16, 24, 40, .14);
}
/* thin brand line on top of the card */
.auth-card::before {
    content: "";
    position: absolute;
    left: 40px; right: 40px; top: -1px;
    height: 3px;
    border-radius: 0 0 3px 3px;
    background: linear-gradient(90deg, var(--bt-red), #ef4a4f);
}

/* Breakthrough logo (bt_new_logo.png) centred at the top of the card */
.card-brand { display: flex; justify-content: center; margin: 4px 0 26px; padding-bottom: 22px; border-bottom: 1px solid #eef0f5; }
.card-logo { display: block; width: 240px; max-width: 80%; height: auto; }

.auth-title { margin: 0 0 6px; font-family: var(--serif); font-size: 30px; line-height: 1.15; font-weight: 600; letter-spacing: -.3px; }
.auth-sub { margin: 0 0 24px; color: var(--ink-2); font-size: 14.5px; }
.auth-sub strong { color: var(--ink); font-weight: 600; overflow-wrap: anywhere; }

/* step indicator: 1 Sign in -> 2 Verify */
.auth-steps {
    display: flex; align-items: center; gap: 10px;
    margin: 0 0 24px; padding: 10px 12px;
    background: #f7f8fb; border: 1px solid #eef0f5; border-radius: 12px;
    font-size: 13px; color: var(--ink-3);
}
.auth-steps .step { display: inline-flex; align-items: center; gap: 8px; font-weight: 500; white-space: nowrap; }
.auth-steps .num {
    width: 24px; height: 24px; border-radius: 50%;
    display: grid; place-items: center;
    font-size: 11.5px; font-weight: 700;
    background: #e8eaf0; color: var(--ink-3);
}
.auth-steps .step.active { color: var(--ink); font-weight: 600; }
.auth-steps .step.active .num { background: var(--bt-red); color: #fff; box-shadow: 0 0 0 4px rgba(197, 29, 34, .14); }
.auth-steps .step.done .num { background: var(--ok); color: #fff; }
.auth-steps .bar { flex: 1; height: 2px; background: #dfe2ea; border-radius: 2px; }
.auth-steps .bar.done { background: var(--ok); }

/* ---------- Alerts ---------- */
.alert {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    padding: 12px 14px;
    margin: 0 0 18px;
    border-radius: 10px;
    font-size: 14px;
    line-height: 1.45;
    border: 1px solid transparent;
}
.alert i { margin-top: 2px; }
.alert-error { background: var(--bt-red-soft); color: var(--bt-red-dark); border-color: #f8d3d4; }
.alert-success { background: var(--ok-soft); color: var(--ok); border-color: #c8ecd8; }
.alert-info { background: var(--info-soft); color: var(--info); border-color: #d6e4ff; }
.alert[hidden] { display: none; }

/* ---------- Fields ---------- */
.field { margin: 0 0 18px; }
.field label { display: block; margin: 0 0 7px; font-size: 13.5px; font-weight: 600; color: var(--ink); }

.input-wrap { position: relative; }
.input-wrap > .lead {
    position: absolute; left: 15px; top: 50%; transform: translateY(-50%);
    color: #9aa1b2; font-size: 15px; pointer-events: none;
    transition: color .15s;
}
.input-wrap:focus-within > .lead { color: var(--bt-red); }
.input {
    width: 100%;
    height: 50px;
    padding: 0 14px 0 44px;
    font: inherit;
    font-size: 15px;
    color: var(--ink);
    background: #fbfbfd;
    border: 1.5px solid var(--line);
    border-radius: var(--radius);
    outline: none;
    transition: border-color .15s, box-shadow .15s, background .15s;
}
.input::placeholder { color: #a6acbb; }
.input:hover { border-color: #cdd2dd; }
.input:focus { background: #fff; border-color: var(--bt-red); box-shadow: 0 0 0 4px rgba(197, 29, 34, .12); }
.input.has-toggle { padding-right: 48px; }

.toggle-pass {
    position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
    width: 38px; height: 38px;
    display: grid; place-items: center;
    border: 0; border-radius: 9px;
    background: transparent; color: var(--ink-3);
    cursor: pointer;
}
.toggle-pass:hover { background: #f0f1f5; color: var(--ink); }
.toggle-pass:focus-visible { outline: 2px solid var(--bt-red); outline-offset: 1px; }

.field-error { display: block; margin-top: 6px; font-size: 13px; color: var(--bt-red-dark); }
.field-error:empty { display: none; }

.caps-hint { display: none; margin-top: 6px; font-size: 12.5px; color: #9a6700; }
.caps-hint.show { display: block; }

/* ---------- Buttons ---------- */
.btn-primary {
    position: relative;
    width: 100%;
    height: 52px;
    display: inline-flex; align-items: center; justify-content: center; gap: 10px;
    margin-top: 8px;
    font: inherit; font-size: 15.5px; font-weight: 600;
    color: #fff;
    background: linear-gradient(180deg, #d42a2f 0%, var(--bt-red) 100%);
    border: 0;
    border-radius: var(--radius);
    cursor: pointer;
    box-shadow: 0 1px 0 rgba(255, 255, 255, .25) inset, 0 10px 20px -6px rgba(197, 29, 34, .55);
    transition: background .15s, transform .1s, box-shadow .15s;
}
.btn-primary:hover { background: linear-gradient(180deg, var(--bt-red) 0%, var(--bt-red-dark) 100%); }
.btn-primary:hover .btn-icon { transform: translateX(3px); }
.btn-primary .btn-icon { transition: transform .15s; }
.btn-primary:active { transform: translateY(1px); }
.btn-primary:focus-visible { outline: 3px solid rgba(197, 29, 34, .35); outline-offset: 2px; }
.btn-primary[disabled] { opacity: .75; cursor: default; box-shadow: none; }

.spinner {
    display: none;
    width: 18px; height: 18px;
    border: 2.5px solid rgba(255, 255, 255, .45);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin .7s linear infinite;
}
.is-loading .spinner { display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

.link-btn {
    padding: 0; border: 0; background: none;
    font: inherit; font-weight: 600; color: var(--bt-red);
    cursor: pointer;
}
.link-btn:hover:not([disabled]) { text-decoration: underline; }
.link-btn[disabled] { color: var(--ink-3); cursor: default; font-weight: 500; }

.secure-note {
    display: flex; align-items: center; gap: 8px; justify-content: center;
    margin: 22px 0 0; padding-top: 18px;
    border-top: 1px dashed var(--line);
    font-size: 13px; color: var(--ink-3);
}
.secure-note i { color: var(--ok); }

/* ---------- OTP ---------- */
.otp-icon {
    width: 56px; height: 56px;
    display: grid; place-items: center;
    margin: 0 0 16px;
    border-radius: 16px;
    background: var(--bt-red-soft); color: var(--bt-red);
    font-size: 24px;
}

.otp-boxes { display: flex; gap: 12px; justify-content: space-between; margin: 0 0 14px; }
.otp-box {
    width: 100%;
    max-width: 68px;
    height: 64px;
    padding: 0;
    text-align: center;
    font: inherit; font-size: 28px; font-weight: 700;
    color: var(--ink);
    background: #fbfbfd;
    border: 1.5px solid var(--line);
    border-radius: 14px;
    outline: none;
    caret-color: var(--bt-red);
    transition: border-color .15s, box-shadow .15s, background .15s;
}
.otp-box:focus { background: #fff; border-color: var(--bt-red); box-shadow: 0 0 0 4px rgba(197, 29, 34, .12); }
.otp-box.filled { border-color: #c3c8d4; background: #fff; }
.otp-boxes.invalid .otp-box { border-color: var(--bt-red); background: var(--bt-red-soft); }
.otp-boxes.shake { animation: shake .35s; }
@keyframes shake {
    20%, 60% { transform: translateX(-6px); }
    40%, 80% { transform: translateX(6px); }
}

.otp-meta { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin: 0 0 20px; font-size: 13.5px; color: var(--ink-2); }
.otp-meta .expiry i { color: var(--ink-3); margin-right: 4px; }
.otp-meta .expiry.expired { color: var(--bt-red-dark); font-weight: 600; }

.back-link { display: inline-flex; align-items: center; gap: 8px; margin-top: 16px; font-size: 14px; color: var(--ink-2); font-weight: 500; }
.back-link:hover { color: var(--ink); }
.text-center { text-align: center; }

/* ---------- Footer ---------- */
.auth-footer {
    display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 6px 10px;
    font-size: 12.5px; color: var(--ink-3); text-align: center;
}
.auth-footer a { font-weight: 600; }
.auth-footer .dot { color: #c2c7d2; }

/* ---------- Responsive ---------- */
@media (max-height: 760px) {
    .auth-main { padding-top: 24px; padding-bottom: 20px; gap: 16px; }
    .auth-card { padding-top: 28px; padding-bottom: 28px; }
    .card-brand { margin-bottom: 18px; padding-bottom: 16px; }
    .card-logo { width: 210px; }
    .auth-steps { margin-bottom: 18px; }
    .auth-sub { margin-bottom: 18px; }
    .field { margin-bottom: 14px; }
    .secure-note { margin-top: 16px; padding-top: 14px; }
}

@media (max-width: 480px) {
    body { font-size: 14.5px; }
    .auth-main { padding: 20px 16px 24px; }
    .auth-card { padding: 28px 20px 26px; border-radius: 18px; }
    .auth-card::before { left: 20px; right: 20px; }
    .auth-title { font-size: 26px; }
    .auth-steps { padding: 8px 10px; gap: 8px; font-size: 12.5px; }
    .otp-boxes { gap: 8px; }
    .otp-box { height: 58px; font-size: 24px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; }
}
