/* =========================================================
   BANKZ — Authentication pages (login, password reset, etc.)
   Global stylesheet
   ========================================================= */

:root {
    --bg: #f4f6fb;
    --surface: #ffffff;
    --ink: #0b1730;
    --ink-2: #2a3957;
    --ink-3: #6b7a99;
    --ink-faint: #aab4c8;
    --line: #eceff5;
    --line-2: #f3f5fa;
    --primary: #320e6b;
    --primary-2: #4a1a99;
    --primary-soft: #ece4f7;
    --accent: #AC3A83;
    --accent-soft: #fbeaf3;
    --danger: #dc3545;
    --danger-soft: #fde8ea;
    --success: #00b67a;
    --success-soft: #e6f8f1;
    --shadow-card: 0 1px 2px rgba(11, 23, 48, 0.04), 0 30px 80px -24px rgba(11, 23, 48, 0.22);
    --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    min-height: 100vh;
    background: var(--bg);
    color: var(--ink);
    font-family: 'Plus Jakarta Sans', sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    display: grid;
    place-items: center;
    padding: 32px 20px;
    position: relative;
    overflow-x: hidden;
}

/* ambient background blobs */
body::before,
body::after {
    content: '';
    position: fixed;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.5;
    z-index: 0;
    pointer-events: none;
}
body::before {
    width: 480px; height: 480px;
    background: radial-gradient(circle, rgba(172, 58, 131, 0.35), transparent 70%);
    top: -120px; left: -80px;
    animation: drift1 16s ease-in-out infinite;
}
body::after {
    width: 520px; height: 520px;
    background: radial-gradient(circle, rgba(50, 14, 107, 0.35), transparent 70%);
    bottom: -140px; right: -100px;
    animation: drift2 18s ease-in-out infinite;
}
@keyframes drift1 {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(40px, 30px); }
}
@keyframes drift2 {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(-30px, -40px); }
}

.grid-bg {
    position: fixed;
    inset: 0;
    background-image:
        linear-gradient(rgba(11, 23, 48, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(11, 23, 48, 0.04) 1px, transparent 1px);
    background-size: 50px 50px;
    mask-image: radial-gradient(ellipse at center, black 0%, transparent 70%);
    -webkit-mask-image: radial-gradient(ellipse at center, black 0%, transparent 70%);
    z-index: 0;
    pointer-events: none;
}

.auth-wrap {
    width: 100%;
    max-width: 460px;
    position: relative;
    z-index: 2;
    opacity: 0;
    transform: translateY(20px);
    animation: rise 0.8s var(--ease-out) 0.1s forwards;
}
@keyframes rise { to { opacity: 1; transform: translateY(0); } }

.brand-pill {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 22px;
    opacity: 0;
    transform: translateY(-10px);
    animation: rise 0.7s var(--ease-out) 0.2s forwards;
}
.brand-logo {
    width: clamp(150px, 38vw, 220px);
    height: auto;
    display: grid; place-items: center;
}
.brand-logo img {
    width: 100%;
    height: auto;
    object-fit: contain;
}
.brand-name {
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--ink);
}

.auth-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 24px;
    box-shadow: var(--shadow-card);
    padding: 38px 36px 32px;
    position: relative;
    overflow: hidden;
}

.auth-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--accent), var(--primary), var(--accent));
    background-size: 200% 100%;
    animation: shimmer 4s linear infinite;
}
@keyframes shimmer {
    from { background-position: 0% 0; }
    to { background-position: 200% 0; }
}

.form-head {
    text-align: center;
    margin-bottom: 26px;
}
.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 5px 12px 5px 8px;
    background: var(--primary-soft);
    border-radius: 100px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.1em;
    color: var(--primary);
    margin-bottom: 16px;
}
.eyebrow .live-dot {
    width: 7px; height: 7px;
    border-radius: 50%;
    background: var(--primary);
    box-shadow: 0 0 0 0 rgba(50, 14, 107, 0.5);
    animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(50, 14, 107, 0.5); }
    50% { box-shadow: 0 0 0 8px rgba(50, 14, 107, 0); }
}

h1 {
    font-size: 30px;
    font-weight: 800;
    letter-spacing: -0.025em;
    color: var(--ink);
    line-height: 1.1;
    margin-bottom: 8px;
}
h1 .wave {
    display: inline-block;
    animation: wave 2.5s ease-in-out infinite;
    transform-origin: 70% 70%;
}
@keyframes wave {
    0%, 60%, 100% { transform: rotate(0); }
    10%, 30% { transform: rotate(14deg); }
    20% { transform: rotate(-8deg); }
}
.form-sub {
    color: var(--ink-3);
    font-size: 14px;
}
.form-sub a {
    color: var(--primary);
    font-weight: 700;
    text-decoration: none;
}
.form-sub a:hover { text-decoration: underline; }

.alert {
    border-radius: 12px;
    padding: 11px 14px;
    font-size: 13px;
    margin-bottom: 14px;
    border: 1px solid transparent;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    animation: alertIn 0.5s var(--ease-out);
}
@keyframes alertIn {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}
.alert svg { flex-shrink: 0; margin-top: 1px; }
.alert-danger {
    color: #842029;
    background: var(--danger-soft);
    border-color: rgba(220, 53, 69, 0.2);
}
.alert-success {
    color: #0f5132;
    background: var(--success-soft);
    border-color: rgba(0, 182, 122, 0.25);
}

.field { margin-bottom: 14px; }

.field-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 11.5px;
    font-weight: 700;
    color: var(--ink-2);
    letter-spacing: 0.08em;
    margin-bottom: 8px;
    text-transform: uppercase;
}
.field-label .link {
    text-transform: none;
    letter-spacing: 0;
    font-size: 12.5px;
    color: var(--primary);
    font-weight: 700;
    text-decoration: none;
}
.field-label .link:hover { text-decoration: underline; }

.input-wrap { position: relative; }

.input-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--ink-faint);
    pointer-events: none;
    transition: color 0.3s var(--ease);
}

.control {
    width: 100%;
    height: 52px;
    border: 1.5px solid var(--line);
    border-radius: 14px;
    padding: 0 16px 0 46px;
    font: inherit;
    font-size: 14.5px;
    color: var(--ink);
    background: var(--surface);
    outline: none;
    transition: all 0.25s var(--ease);
}
.control::placeholder { color: var(--ink-faint); }
.control:hover { border-color: #d8deec; }
.control:focus {
    border-color: var(--primary);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(50, 14, 107, 0.12);
}
.input-wrap:focus-within .input-icon { color: var(--primary); }

.control.is-invalid {
    border-color: var(--danger);
    box-shadow: 0 0 0 4px rgba(220, 53, 69, 0.1);
}

.has-toggle .control { padding-right: 52px; }

.toggle-password {
    position: absolute;
    top: 50%;
    right: 8px;
    transform: translateY(-50%);
    border: 0;
    background: transparent;
    color: var(--ink-3);
    cursor: pointer;
    padding: 9px;
    border-radius: 8px;
    display: grid; place-items: center;
    transition: all 0.25s var(--ease);
}
.toggle-password:hover { background: var(--line-2); color: var(--primary); }
.toggle-password .eye-closed { display: none; }
.toggle-password.shown .eye-open { display: none; }
.toggle-password.shown .eye-closed { display: block; }

.invalid-feedback {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 7px;
    color: var(--danger);
    font-size: 12.5px;
    font-weight: 500;
}

.row-actions {
    margin: 18px 0 22px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.remember {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--ink-2);
    font-size: 13.5px;
    font-weight: 500;
    cursor: pointer;
    user-select: none;
    position: relative;
}
.remember input {
    position: absolute;
    opacity: 0;
    width: 0; height: 0;
}
.remember .checkbox {
    width: 20px; height: 20px;
    border: 1.5px solid var(--line);
    border-radius: 6px;
    display: grid; place-items: center;
    background: var(--surface);
    transition: all 0.25s var(--ease);
    flex-shrink: 0;
}
.remember .checkbox svg {
    opacity: 0;
    transform: scale(0.5);
    transition: all 0.3s var(--ease-out);
    color: #fff;
}
.remember input:checked + .checkbox {
    background: var(--primary);
    border-color: var(--primary);
}
.remember input:checked + .checkbox svg {
    opacity: 1;
    transform: scale(1);
}
.remember:hover .checkbox { border-color: var(--primary); }

.btn {
    width: 100%;
    height: 52px;
    border: 0;
    border-radius: 14px;
    background: var(--primary);
    color: #fff;
    font-family: inherit;
    font-size: 14.5px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s var(--ease);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 10px 24px -8px rgba(50, 14, 107, 0.45);
}
.btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, var(--primary-2), var(--accent));
    opacity: 0;
    transition: opacity 0.3s var(--ease);
}
.btn span, .btn svg { position: relative; z-index: 2; }
.btn:hover::before { opacity: 1; }
.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 30px -8px rgba(50, 14, 107, 0.6);
}
.btn:active { transform: translateY(0); }
.btn svg { transition: transform 0.3s var(--ease); }
.btn:hover svg { transform: translateX(4px); }

.btn .btn-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.45);
    border-top-color: #fff;
    border-radius: 50%;
    display: none;
    flex-shrink: 0;
    animation: btnSpin 0.65s linear infinite;
}

.btn.is-loading {
    pointer-events: none;
}

.btn.is-loading .btn-spinner {
    display: inline-block;
}

.btn.is-loading svg {
    display: none;
}

@keyframes btnSpin {
    to { transform: rotate(360deg); }
}

.secure-note {
    margin-top: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 12.5px;
    color: var(--ink-3);
    padding: 12px;
    background: var(--line-2);
    border-radius: 12px;
}
.secure-note svg { color: var(--success); flex-shrink: 0; }

.copyright {
    margin-top: 22px;
    text-align: center;
    color: var(--ink-faint);
    font-size: 11.5px;
    font-family: 'JetBrains Mono', monospace;
    letter-spacing: 0.04em;
}

@media (max-width: 480px) {
    .auth-card { padding: 28px 22px 24px; border-radius: 20px; }
    h1 { font-size: 26px; }
}

