/* ========================================
   AfterBill - Auth Styles (Centered Card)
   Colors: Deep Navy #17233C | Electric Blue #3B82F6 | White | Light Gray
   ======================================== */

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

:root {
    --deep-navy: #17233C;
    --electric-blue: #3B82F6;
    --electric-blue-hover: #2563EB;
    --white: #FFFFFF;
    --light-gray: #F3F4F6;
    --text-dark: #1F2937;
    --text-muted: #6B7280;
    --border: #E5E7EB;
    --error: #EF4444;
    --success: #10B981;
    --radius: 16px;
    --shadow: 0 25px 50px -12px rgba(23, 35, 60, 0.18);
}

html, body {
    height: 100%;
    font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: var(--light-gray);
    color: var(--text-dark);
    line-height: 1.5;
}

.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background:
        radial-gradient(ellipse at 20% 50%, rgba(59, 130, 246, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 20%, rgba(23, 35, 60, 0.06) 0%, transparent 45%),
        var(--light-gray);
}

/* ── Smaller, tighter card ── */
.auth-card {
    display: flex;
    width: 100%;
    max-width: 820px;
    min-height: 560px;
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.auth-brand {
    flex: 0 0 40%;
    background: linear-gradient(160deg, var(--deep-navy) 0%, #0F172A 100%);
    color: var(--white);
    padding: 28px 28px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
}

.auth-brand::before {
    content: '';
    position: absolute;
    top: -80px;
    right: -60px;
    width: 280px;
    height: 280px;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.28) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

.auth-brand::after {
    content: '';
    position: absolute;
    bottom: -40px;
    left: -40px;
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.12) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

.brand-top {
    position: relative;
    z-index: 1;
}

.brand-tagline {
    display: inline-block;
    font-size: 0.68rem;
    letter-spacing: 1.4px;
    text-transform: uppercase;
    color: #93B4F7;
    background: rgba(59, 130, 246, 0.14);
    border: 1px solid rgba(59, 130, 246, 0.28);
    border-radius: 999px;
    padding: 4px 11px;
    margin-bottom: 14px;
    position: relative;
    z-index: 1;
    font-weight: 500;
}

.brand-headline {
    font-size: 1.6rem;
    font-weight: 700;
    line-height: 1.3;
    position: relative;
    z-index: 1;
    margin-bottom: 10px;
}

.brand-headline span {
    color: var(--electric-blue);
}

.brand-sub {
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.7);
    position: relative;
    z-index: 1;
    margin-bottom: 0;
}

/* ---- SVG icon illustration — centered ---- */
.brand-art {
    position: relative;
    z-index: 1;
    margin: 16px 0 16px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.brand-art--register {
    margin-top: 85px;
}

.brand-art svg {
    width: 100%;
    max-width: 200px;
    height: auto;
    display: block;
    margin: 0 auto;
    overflow: visible;
    filter: drop-shadow(0 14px 24px rgba(8, 15, 32, 0.45));
}

.brand-art .art-receipt,
.brand-art .art-badge,
.brand-art .art-dot {
    animation: abFloat 6s ease-in-out infinite;
    transform-box: fill-box;
    transform-origin: center;
}

.brand-art .art-badge { animation-delay: -1.6s; }
.brand-art .art-dot-a { animation-delay: -0.8s; }
.brand-art .art-dot-b { animation-delay: -2.4s; }
.brand-art .art-dot-c { animation-delay: -3.2s; }

@keyframes abFloat {
    0%, 100% { translate: 0 0; }
    50%      { translate: 0 -7px; }
}

@media (prefers-reduced-motion: reduce) {
    .brand-art .art-receipt,
    .brand-art .art-badge,
    .brand-art .art-dot {
        animation: none;
    }
}

.brand-features {
    display: flex;
    flex-direction: column;
    gap: 10px;
    position: relative;
    z-index: 1;
    margin-top: auto;
    padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    list-style: none;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.825rem;
    color: rgba(255, 255, 255, 0.85);
}

.feature-icon {
    width: 30px;
    height: 30px;
    background: rgba(59, 130, 246, 0.18);
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.feature-icon svg {
    width: 15px;
    height: 15px;
    stroke: var(--electric-blue);
}

/* ── Form panel ── */
.auth-form-panel {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 28px 36px;
}

.auth-form-inner {
    width: 100%;
    max-width: 360px;
}

/* ── Logo — centered ── */
.form-logo {
    margin-bottom: 20px;
    display: flex;
    justify-content: center;
}

.form-logo img {
    height: 72px;
    width: auto;
    max-width: 320px;
    display: block;
    object-fit: contain;
}

.form-header {
    margin-bottom: 20px;
}

.form-header h1 {
    font-size: 1.45rem;
    font-weight: 700;
    color: var(--deep-navy);
    margin-bottom: 4px;
}

.form-header p {
    color: var(--text-muted);
    font-size: 0.875rem;
}

.form-group {
    margin-bottom: 14px;
}

.form-group label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--deep-navy);
    margin-bottom: 6px;
}

.input-wrapper {
    position: relative;
}

.input-wrapper .input-icon {
    position: absolute;
    left: 13px;
    top: 50%;
    transform: translateY(-50%);
    width: 17px;
    height: 17px;
    color: var(--text-muted);
    pointer-events: none;
}

.input-wrapper input {
    width: 100%;
    padding: 10px 14px 10px 40px;
    border: 1.5px solid var(--border);
    border-radius: 10px;
    font-size: 0.875rem;
    color: var(--text-dark);
    background: var(--white);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.input-wrapper input:focus {
    outline: none;
    border-color: var(--electric-blue);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
}

.input-wrapper input::placeholder {
    color: #9CA3AF;
}

.input-wrapper .toggle-password {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    padding: 4px;
    display: flex;
    align-items: center;
}

.input-wrapper .toggle-password:hover {
    color: var(--deep-navy);
}

.input-wrapper .toggle-password svg {
    width: 17px;
    height: 17px;
}

.form-check {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    margin-bottom: 18px;
}

.form-check input[type="checkbox"] {
    width: 15px;
    height: 15px;
    margin-top: 2px;
    accent-color: var(--electric-blue);
    cursor: pointer;
    flex-shrink: 0;
}

.form-check label {
    font-size: 0.8rem;
    color: var(--text-muted);
    cursor: pointer;
    line-height: 1.4;
}

.form-check label a {
    color: var(--electric-blue);
    text-decoration: none;
    font-weight: 500;
}

.form-check label a:hover {
    text-decoration: underline;
}

.btn-primary {
    width: 100%;
    padding: 11px 18px;
    background: var(--electric-blue);
    color: var(--white);
    border: none;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
    box-shadow: 0 4px 14px rgba(59, 130, 246, 0.3);
}

.btn-primary:hover {
    background: var(--electric-blue-hover);
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(59, 130, 246, 0.38);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-primary:disabled {
    opacity: 0.65;
    cursor: not-allowed;
    transform: none;
}

.btn-primary svg {
    width: 15px;
    height: 15px;
}

.forgot-link {
    text-align: right;
    margin: -6px 0 14px;
    font-size: 0.78rem;
}

.forgot-link a {
    color: var(--electric-blue);
    text-decoration: none;
    font-weight: 500;
}

.forgot-link a:hover {
    text-decoration: underline;
}

.form-footer {
    text-align: center;
    margin-top: 18px;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.form-footer a {
    color: var(--electric-blue);
    font-weight: 600;
    text-decoration: none;
}

.form-footer a:hover {
    text-decoration: underline;
}

.alert {
    padding: 10px 13px;
    border-radius: 10px;
    font-size: 0.82rem;
    margin-bottom: 14px;
}

.alert-error {
    background: #FEF2F2;
    color: #B91C1C;
    border: 1px solid #FECACA;
}

.alert-success {
    background: #ECFDF5;
    color: #047857;
    border: 1px solid #A7F3D0;
}

.alert ul {
    margin: 0;
    padding-left: 16px;
}

.input-wrapper.error input {
    border-color: var(--error);
}

.field-error {
    font-size: 0.72rem;
    color: var(--error);
    margin-top: 4px;
}

/* Live password rules (includes/password_policy.php + assets/js/password-rules.js) */
.pw-rules {
    list-style: none;
    margin: 8px 0 0;
    padding: 0;
    display: grid;
    gap: 3px;
}

.pw-rules li {
    font-size: 0.72rem;
    color: var(--text-muted);
    padding-left: 18px;
    position: relative;
}

.pw-rules li::before {
    content: '○';
    position: absolute;
    left: 2px;
}

.pw-rules li.met {
    color: #059669;
}

.pw-rules li.met::before {
    content: '✓';
    font-weight: 700;
}

@media (max-width: 800px) {
    .auth-card {
        flex-direction: column;
        max-width: 420px;
        min-height: auto;
    }
    .auth-brand {
        flex: none;
        padding: 24px 20px;
    }
    .brand-headline {
        font-size: 1.35rem;
    }
    .brand-features {
        display: none;
    }
    .brand-art {
        margin: 12px 0 4px;
    }
    .brand-art svg {
        max-width: 180px;
    }
    .auth-form-panel {
        padding: 24px 20px;
    }
}

@media (max-width: 420px) {
    .auth-page {
        padding: 12px;
    }
    .form-header h1 {
        font-size: 1.25rem;
    }
}