/* ============================================================
   MODULE SPECIFIC STYLESHEET: AUTHENTICATION
   Login, 2FA Gate Challenge, Security Checkpoints
   ============================================================ */

:root {
    --bg-base: #070a13;
    --card-bg: #0f172a;
    --accent-cyan: #38bdf8;
    --accent-blue: #3b82f6;
    --border-glow: rgba(56, 189, 248, 0.25);
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
}

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

body.auth-body {
    background-color: var(--bg-base, #070a13);
    background-image: 
        radial-gradient(at 0% 0%, rgba(56, 189, 248, 0.12) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(99, 102, 241, 0.12) 0px, transparent 50%),
        linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
    background-size: 100% 100%, 100% 100%, 36px 36px, 36px 36px;
    color: var(--text-primary, #f8fafc);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    font-family: 'Inter', system-ui, sans-serif;
    margin: 0;
}

.login-card {
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-glow, rgba(56, 189, 248, 0.25));
    border-radius: 20px;
    width: 100%;
    max-width: 460px;
    padding: 40px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7), 0 0 40px rgba(56, 189, 248, 0.1);
    position: relative;
    overflow: hidden;
    box-sizing: border-box;
}

.login-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #38bdf8, #3b82f6, #818cf8);
}

.brand-header {
    text-align: center;
    margin-bottom: 28px;
}

.brand-logo {
    width: 58px;
    height: 58px;
    background: linear-gradient(135deg, #0284c7, #3b82f6);
    border-radius: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    font-weight: 800;
    color: #fff;
    box-shadow: 0 8px 24px rgba(2, 132, 199, 0.45);
    margin-bottom: 16px;
    letter-spacing: 0.5px;
}

.brand-title {
    font-size: 22px;
    font-weight: 700;
    color: #fff;
    letter-spacing: -0.02em;
    margin-bottom: 6px;
}

.brand-sub {
    font-size: 13px;
    color: var(--text-secondary, #94a3b8);
    line-height: 1.4;
}

/* ALERTS */
.alert-success {
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.35);
    border-radius: 10px;
    padding: 12px 16px;
    color: #34d399;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
}

.alert-error {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.35);
    border-radius: 10px;
    padding: 12px 16px;
    color: #f87171;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
}

/* FORM STYLING */
.form-group {
    margin-bottom: 20px;
    text-align: left;
    width: 100%;
}

.form-label {
    display: block;
    font-size: 11px;
    font-weight: 700;
    color: var(--text-secondary, #94a3b8);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 8px;
    text-align: left;
}

.input-wrap {
    position: relative;
    width: 100%;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #64748b;
    font-size: 15px;
    pointer-events: none;
    z-index: 4;
}

.form-input,
.login-input {
    width: 100% !important;
    height: 48px !important;
    background: #1e293b !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    border-radius: 10px !important;
    padding: 0 44px 0 44px !important;
    color: #ffffff !important;
    font-size: 14px !important;
    font-family: inherit !important;
    outline: none !important;
    box-sizing: border-box !important;
    transition: all 0.2s ease !important;
    display: block !important;
}

.form-input:focus,
.login-input:focus {
    border-color: var(--accent-cyan, #38bdf8) !important;
    background: #0f172a !important;
    box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.2) !important;
}

.form-input::placeholder,
.login-input::placeholder {
    color: #64748b !important;
}

/* Webkit Autofill Override to prevent ugly white/yellow backgrounds */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
input:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 1000px #1e293b inset !important;
    -webkit-text-fill-color: #ffffff !important;
    caret-color: #ffffff !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    border-radius: 10px !important;
    transition: background-color 5000s ease-in-out 0s !important;
}

.pwd-toggle {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #64748b;
    cursor: pointer;
    padding: 6px;
    z-index: 4;
    transition: color 0.2s ease;
}

.pwd-toggle:hover {
    color: var(--accent-cyan, #38bdf8);
}

.checkbox-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    font-size: 13px;
    color: var(--text-secondary, #94a3b8);
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.btn-signin {
    width: 100%;
    background: linear-gradient(135deg, #0284c7, #2563eb);
    border: none;
    border-radius: 10px;
    padding: 14px;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: 0 10px 20px -5px rgba(2, 132, 199, 0.5);
    transition: all 0.2s ease;
}
.btn-signin:hover {
    transform: translateY(-1px);
    box-shadow: 0 14px 25px -5px rgba(2, 132, 199, 0.6);
}

.portal-switch-box {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    text-align: center;
    font-size: 13px;
    color: var(--text-secondary);
}

.portal-switch-link {
    color: var(--accent-cyan);
    text-decoration: none;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 6px;
}
.portal-switch-link:hover {
    text-decoration: underline;
}

.demo-creds-box {
    margin-top: 18px;
    background: rgba(30, 41, 59, 0.6);
    border: 1px dashed rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 12px;
    color: #94a3b8;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.demo-creds-box code {
    color: #38bdf8;
    font-family: 'JetBrains Mono', monospace;
}

/* 2FA GATE CHALLENGE */
.challenge-card {
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-glow);
    border-radius: 20px;
    width: 100%;
    max-width: 440px;
    padding: 40px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7), 0 0 40px rgba(56, 189, 248, 0.1);
    position: relative;
    overflow: hidden;
    text-align: center;
}
.challenge-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #10b981, #38bdf8);
}
.shield-icon {
    width: 64px;
    height: 64px;
    background: rgba(16, 185, 129, 0.12);
    border: 1px solid rgba(16, 185, 129, 0.3);
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    color: #10b981;
    margin-bottom: 20px;
    box-shadow: 0 0 25px rgba(16, 185, 129, 0.2);
}
.user-pill {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 6px 14px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #e2e8f0;
    margin-bottom: 24px;
}
.code-input {
    width: 100%;
    background: #1e293b;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    padding: 14px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 28px;
    letter-spacing: 12px;
    text-align: center;
    color: #38bdf8;
    outline: none;
    transition: all 0.2s;
    margin-bottom: 20px;
}
.code-input:focus {
    border-color: #38bdf8;
    box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.2);
}
.recovery-input {
    width: 100%;
    background: #1e293b;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    padding: 12px 14px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 14px;
    text-align: center;
    color: #f59e0b;
    outline: none;
    margin-bottom: 20px;
}
.btn-verify {
    width: 100%;
    background: linear-gradient(135deg, #10b981, #0284c7);
    border: none;
    border-radius: 10px;
    padding: 14px;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: 0 10px 20px -5px rgba(16, 185, 129, 0.4);
    transition: all 0.2s;
}
.btn-verify:hover {
    transform: translateY(-1px);
}
.toggle-link {
    display: inline-block;
    margin-top: 18px;
    font-size: 12px;
    color: var(--accent-cyan);
    text-decoration: none;
    cursor: pointer;
}
.toggle-link:hover {
    text-decoration: underline;
}
