/* === CYBERPUNK HUD AUTH THEME (LOGIN / REGISTER) === */
@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@500;600;700;800;900&family=Rajdhani:wght@500;600;700&family=Roboto:wght@400;500;700&display=swap');

:root {
    --neon-green: #00ff66;
    --neon-green-bright: #39ff14;
    --neon-green-dim: #10b981;
    --neon-green-dark: #064e28;
    --neon-green-glow: rgba(0, 255, 102, 0.45);
    --bg-dark: #040806;
    --card-bg: rgba(6, 16, 11, 0.88);
    --input-bg: rgba(10, 28, 18, 0.75);
    --border-color-hud: rgba(0, 255, 102, 0.3);
    --text-muted: #83a590;
}

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

body.auth-page {
    min-height: 100vh;
    width: 100%;
    background-color: var(--bg-dark);
    background-image: url('/assets/v2/background.png');
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    font-family: 'Roboto', sans-serif;
    color: #fff;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    overflow-x: hidden;
    overflow-y: auto;
    padding: 30px 15px;
}

/* Background overlay */
.bg-vignette {
    position: fixed;
    inset: 0;
    background: radial-gradient(circle at center, rgba(0, 0, 0, 0.2) 0%, rgba(2, 8, 4, 0.8) 100%);
    pointer-events: none;
    z-index: 1;
}

#matrix-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    pointer-events: none;
    opacity: 0.35;
}

/* HUD Corner accents */
.hud-corner {
    position: fixed;
    width: 35px;
    height: 35px;
    border-color: var(--neon-green);
    border-style: solid;
    z-index: 3;
    opacity: 0.7;
    pointer-events: none;
}
.hud-corner.corner-tl { top: 20px; left: 20px; border-width: 3px 0 0 3px; }
.hud-corner.corner-tr { top: 20px; right: 20px; border-width: 3px 3px 0 0; }
.hud-corner.corner-bl { bottom: 20px; left: 20px; border-width: 0 0 3px 3px; }
.hud-corner.corner-br { bottom: 20px; right: 20px; border-width: 0 3px 3px 0; }

/* Main Wrapper */
.auth-wrapper {
    position: relative;
    z-index: 10;
    width: 100%;
    max-width: 480px;
    margin: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* HUD Section Header */
.hud-header {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    padding: 0 8px;
}

.hud-title-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: 'Orbitron', monospace, sans-serif;
    font-size: 0.9em;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: #ffffff;
}

.hud-num {
    color: var(--neon-green);
    font-weight: 900;
    text-shadow: 0 0 8px var(--neon-green-glow);
}

.hud-deco-lines {
    display: flex;
    align-items: center;
    gap: 4px;
}

.hud-deco-lines span {
    display: inline-block;
    height: 2px;
    background: var(--neon-green);
    opacity: 0.6;
}
.hud-deco-lines span:nth-child(1) { width: 14px; }
.hud-deco-lines span:nth-child(2) { width: 8px; }
.hud-deco-lines span:nth-child(3) { width: 4px; }

/* Auth HUD Box */
.auth-hud-box {
    position: relative;
    width: 100%;
    background: var(--card-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1.5px solid var(--border-color-hud);
    border-radius: 18px;
    padding: 35px 32px 30px;
    box-shadow: 0 0 35px rgba(0, 255, 102, 0.18), inset 0 0 20px rgba(0, 255, 102, 0.05);
    overflow: hidden;
    transition: all 0.35s ease;
}

/* Frame overlay using separate cropped frame_login.png and frame_register.png */
.auth-hud-box::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: url('/assets/v2/frame_login.png');
    background-size: 100% 100%;
    background-repeat: no-repeat;
    opacity: 0.9;
    pointer-events: none;
    z-index: 1;
    transition: background-image 0.3s ease;
}

.auth-hud-box.register-frame::before {
    background-image: url('/assets/v2/frame_register.png');
}

.auth-inner-content {
    position: relative;
    z-index: 2;
}

/* Tech Header Inside Card */
.auth-card-top {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    margin-bottom: 25px;
}

.auth-badge-icon {
    width: 58px;
    height: 58px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 14px;
    filter: drop-shadow(0 0 10px var(--neon-green));
}

.auth-badge-icon svg {
    width: 100%;
    height: 100%;
}

.auth-main-title {
    font-family: 'Orbitron', 'Rajdhani', sans-serif;
    font-size: 1.5em;
    font-weight: 800;
    letter-spacing: 2px;
    color: #ffffff;
    text-transform: uppercase;
    text-shadow: 0 0 15px rgba(0, 255, 102, 0.6);
    margin-bottom: 6px;
}

.auth-subtitle {
    font-size: 0.88em;
    color: var(--text-muted);
    font-weight: 400;
    letter-spacing: 0.5px;
}

/* Form Styles */
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.form-group-hud {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon-left {
    position: absolute;
    left: 14px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    transition: color 0.3s;
    z-index: 5;
}

.input-icon-left svg {
    width: 19px;
    height: 19px;
}

.hud-input {
    width: 100%;
    padding: 13px 44px 13px 44px;
    background-color: var(--input-bg);
    border: 1px solid rgba(0, 255, 102, 0.22);
    border-radius: 12px;
    color: #ffffff;
    font-size: 0.95em;
    font-family: 'Roboto', sans-serif;
    outline: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.hud-input::placeholder {
    color: #6b8f78;
    font-size: 0.9em;
}

.hud-input:focus {
    border-color: var(--neon-green);
    background-color: rgba(12, 38, 24, 0.85);
    box-shadow: 0 0 16px rgba(0, 255, 102, 0.35);
}

.form-group-hud:focus-within .input-icon-left {
    color: var(--neon-green);
    filter: drop-shadow(0 0 5px var(--neon-green));
}

/* Toggle Password Button */
.toggle-pwd-btn {
    position: absolute;
    right: 14px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: color 0.2s;
    z-index: 5;
}

.toggle-pwd-btn:hover {
    color: var(--neon-green);
}

.toggle-pwd-btn svg {
    width: 19px;
    height: 19px;
}

/* Options Row (Remember / Forgot) */
.form-options-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.82em;
    color: var(--text-muted);
    padding: 0 2px;
    margin-top: -2px;
    margin-bottom: 5px;
}

.custom-checkbox-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
}

.custom-checkbox-label input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    border: 1px solid rgba(0, 255, 102, 0.4);
    border-radius: 4px;
    background: rgba(0, 20, 10, 0.6);
    cursor: pointer;
    position: relative;
    transition: all 0.2s;
}

.custom-checkbox-label input[type="checkbox"]:checked {
    background-color: var(--neon-green);
    border-color: var(--neon-green);
    box-shadow: 0 0 8px var(--neon-green-glow);
}

.custom-checkbox-label input[type="checkbox"]:checked::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 5px;
    width: 4px;
    height: 8px;
    border: solid #000;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.forgot-pwd-link {
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.2s;
}

.forgot-pwd-link:hover {
    color: var(--neon-green);
    text-decoration: underline;
}

/* Primary Cyber Submit Button */
.btn-cyber-primary {
    position: relative;
    width: 100%;
    height: 52px;
    border: none;
    border-radius: 12px;
    background: url('/assets/v2/button_auth.png') no-repeat center center;
    background-size: 100% 100%;
    color: #031509;
    font-family: 'Orbitron', 'Rajdhani', sans-serif;
    font-size: 1em;
    font-weight: 900;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 20px rgba(0, 255, 102, 0.4);
    transition: all 0.25s ease;
    margin-top: 5px;
}

.btn-cyber-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 30px rgba(0, 255, 102, 0.75);
    filter: brightness(1.08);
}

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

.btn-text-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 0 20px;
    position: relative;
}

.btn-arrow-icon {
    position: absolute;
    right: 18px;
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(3, 21, 9, 0.25);
    color: #031509;
}

.btn-arrow-icon svg {
    width: 16px;
    height: 16px;
}

/* Divider HOẶC */
.hud-divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 12px 0;
    color: var(--text-muted);
    font-size: 0.78em;
    letter-spacing: 2px;
    font-weight: 600;
}

.hud-divider::before,
.hud-divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid rgba(0, 255, 102, 0.2);
}

.hud-divider span {
    padding: 0 12px;
}

/* Secondary Button (Create Account) */
.btn-cyber-secondary {
    width: 100%;
    padding: 13px;
    background: rgba(10, 28, 18, 0.5);
    border: 1px solid rgba(0, 255, 102, 0.35);
    border-radius: 12px;
    color: #ffffff;
    font-family: 'Rajdhani', sans-serif;
    font-size: 0.95em;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s;
}

.btn-cyber-secondary:hover {
    background: rgba(0, 255, 102, 0.12);
    border-color: var(--neon-green);
    color: var(--neon-green);
    box-shadow: 0 0 15px rgba(0, 255, 102, 0.25);
    transform: translateY(-1px);
}

.btn-cyber-secondary svg {
    width: 18px;
    height: 18px;
}

/* Terms Row for Register */
.terms-agreement-row {
    font-size: 0.78em;
    color: var(--text-muted);
    line-height: 1.4;
    padding: 2px 2px;
    margin-top: 2px;
}

.terms-agreement-row a {
    color: var(--neon-green);
    text-decoration: none;
    font-weight: 600;
}

.terms-agreement-row a:hover {
    text-decoration: underline;
    text-shadow: 0 0 5px var(--neon-green-glow);
}

/* Switch back to Login text link */
.auth-switch-footer {
    text-align: center;
    margin-top: 15px;
    font-size: 0.85em;
    color: var(--text-muted);
}

.auth-switch-footer a {
    color: var(--neon-green);
    text-decoration: none;
    font-weight: 700;
    margin-left: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.auth-switch-footer a:hover {
    text-decoration: underline;
    text-shadow: 0 0 8px var(--neon-green-glow);
}

/* Feedback Message Toast */
#message-box {
    margin-top: 15px;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 0.88em;
    text-align: center;
    display: none;
    animation: fadeIn 0.3s ease;
}

#message-box.error {
    display: block;
    background: rgba(255, 50, 50, 0.15);
    border: 1px solid rgba(255, 50, 50, 0.5);
    color: #ff6b6b;
    box-shadow: 0 0 12px rgba(255, 0, 0, 0.2);
}

#message-box.success {
    display: block;
    background: rgba(0, 255, 102, 0.15);
    border: 1px solid rgba(0, 255, 102, 0.6);
    color: var(--neon-green);
    box-shadow: 0 0 15px rgba(0, 255, 102, 0.3);
}

/* Footer Status Bar HUD */
.hud-footer-status {
    width: 100%;
    margin-top: 18px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.hud-status-card {
    background: rgba(4, 14, 9, 0.75);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(0, 255, 102, 0.2);
    border-radius: 10px;
    padding: 10px 14px;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.status-label {
    font-family: 'Orbitron', monospace, sans-serif;
    font-size: 0.65em;
    letter-spacing: 1px;
    color: var(--text-muted);
    text-transform: uppercase;
}

.status-value {
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: 'Orbitron', monospace, sans-serif;
    font-size: 0.75em;
    font-weight: 700;
    letter-spacing: 1px;
    color: var(--neon-green);
}

.pulse-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background-color: var(--neon-green);
    box-shadow: 0 0 8px var(--neon-green);
    animation: pulse-green 1.8s infinite;
}

@keyframes pulse-green {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.4; transform: scale(0.75); }
}

.status-value svg {
    width: 14px;
    height: 14px;
    color: var(--neon-green);
}

/* Animations */
.fadeInSlide {
    animation: fadeInSlide 0.4s ease-out forwards;
}

@keyframes fadeInSlide {
    from {
        opacity: 0;
        transform: translateY(10px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Responsive optimization */
@media (max-width: 520px) {
    body.auth-page {
        padding: 20px 12px;
    }
    .auth-hud-box {
        padding: 28px 20px 24px;
        border-radius: 14px;
    }
    .auth-main-title {
        font-size: 1.3em;
    }
    .hud-header {
        margin-bottom: 8px;
    }
    .hud-corner {
        display: none;
    }
    .hud-footer-status {
        gap: 8px;
    }
    .hud-status-card {
        padding: 8px 10px;
    }
}