/* ========================================================================
   FABULA ARCANA - AUTHENTICATION PAGES CSS
   Arcane Portal Design - Login, Registration, Password Recovery
   ======================================================================== */

/* ===== CSS VARIABLES ===== */
:root {
    /* Color Palette - Rosa/Viola/Blu/Nero */
    --accent-pink: #e91e8c;
    --accent-pink-light: #ff4db2;
    --accent-pink-dark: #b8157a;
    --accent-violet: #a855f7;
    --accent-violet-light: #c084fc;
    --accent-violet-dark: #7c3aed;
    --accent-blue: #3b82f6;
    --accent-blue-light: #60a5fa;
    --accent-blue-dark: #2563eb;
    --accent-cyan: #06b6d4;
    
    /* Backgrounds */
    --bg-void: #050508;
    --bg-deep: #0a0a12;
    --bg-dark: #0d0d1a;
    --bg-card: rgba(15, 15, 25, 0.85);
    --bg-card-solid: #10101a;
    --bg-input: rgba(10, 10, 18, 0.9);
    
    /* Text */
    --text-primary: #f0f0f5;
    --text-secondary: #a0a0b8;
    --text-muted: #6b6b80;
    --text-accent: #d8b4fe;
    
    /* Borders */
    --border-subtle: rgba(168, 85, 247, 0.15);
    --border-glow: rgba(168, 85, 247, 0.4);
    --border-active: rgba(233, 30, 140, 0.6);
    
    /* Gradients */
    --gradient-magic: linear-gradient(135deg, var(--accent-pink), var(--accent-violet), var(--accent-blue));
    --gradient-portal: radial-gradient(ellipse at center, rgba(168, 85, 247, 0.15) 0%, transparent 70%);
    --gradient-card: linear-gradient(180deg, rgba(168, 85, 247, 0.08) 0%, rgba(15, 15, 25, 0.95) 100%);
    
    /* Shadows */
    --shadow-glow: 0 0 30px rgba(168, 85, 247, 0.3);
    --shadow-glow-pink: 0 0 40px rgba(233, 30, 140, 0.25);
    --shadow-deep: 0 20px 60px rgba(0, 0, 0, 0.5);
    
    /* States */
    --success: #22c55e;
    --success-glow: rgba(34, 197, 94, 0.3);
    --danger: #ef4444;
    --danger-glow: rgba(239, 68, 68, 0.3);
    --warning: #f59e0b;
    
    /* Timing */
    --transition-fast: 0.2s ease;
    --transition-smooth: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-bounce: 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* ===== RESET & BASE ===== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

html, body {
    height: 100%;
}

body.auth-page {
    font-family: 'Spectral', Georgia, serif;
    background: var(--bg-void);
    color: var(--text-primary);
    line-height: 1.7;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ===== MAGICAL BACKGROUND LAYERS ===== */
.magic-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
    overflow: hidden;
    background: var(--bg-void);
}

/* Animated Star Field */
.star-field {
    position: absolute;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(2px 2px at 20px 30px, rgba(255, 255, 255, 0.8), transparent),
        radial-gradient(2px 2px at 40px 70px, rgba(168, 85, 247, 0.6), transparent),
        radial-gradient(1px 1px at 90px 40px, rgba(255, 255, 255, 0.6), transparent),
        radial-gradient(2px 2px at 130px 80px, rgba(233, 30, 140, 0.5), transparent),
        radial-gradient(1px 1px at 160px 120px, rgba(255, 255, 255, 0.5), transparent);
    background-size: 200px 200px;
    animation: starTwinkle 8s ease-in-out infinite;
}

@keyframes starTwinkle {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

/* Nebula Layer */
.nebula-layer {
    position: absolute;
    width: 150%;
    height: 150%;
    top: -25%;
    left: -25%;
    background: 
        radial-gradient(ellipse 80% 50% at 20% 80%, rgba(233, 30, 140, 0.12) 0%, transparent 50%),
        radial-gradient(ellipse 60% 40% at 80% 20%, rgba(59, 130, 246, 0.1) 0%, transparent 50%),
        radial-gradient(ellipse 70% 60% at 50% 50%, rgba(168, 85, 247, 0.08) 0%, transparent 60%);
    animation: nebulaFloat 30s ease-in-out infinite;
}

@keyframes nebulaFloat {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    50% { transform: translate(-3%, 3%) rotate(2deg); }
}

/* Mystical Fog */
.mystical-fog {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 50%;
    background: linear-gradient(to top, rgba(10, 10, 18, 0.95) 0%, transparent 100%);
    pointer-events: none;
}

/* Particle Container */
.particle-container {
    position: absolute;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.magic-particle {
    position: absolute;
    width: 3px;
    height: 3px;
    background: var(--accent-violet);
    border-radius: 50%;
    box-shadow: 0 0 6px var(--accent-violet), 0 0 12px var(--accent-pink);
    animation: particleFloat 15s infinite ease-in-out;
    opacity: 0;
}

.magic-particle:nth-child(odd) {
    background: var(--accent-pink);
    animation-duration: 18s;
}

.magic-particle:nth-child(3n) {
    background: var(--accent-blue);
    animation-duration: 20s;
}

@keyframes particleFloat {
    0% {
        opacity: 0;
        transform: translateY(100vh) scale(0);
    }
    10% {
        opacity: 0.8;
    }
    90% {
        opacity: 0.8;
    }
    100% {
        opacity: 0;
        transform: translateY(-100px) scale(1);
    }
}

/* ===== VIDEO BACKGROUND ===== */
.video-bg-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

.video-bg-container video {
    position: absolute;
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: brightness(0.3) saturate(1.2);
}

.video-bg-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(ellipse at center, transparent 0%, rgba(5, 5, 8, 0.7) 100%),
        linear-gradient(180deg, rgba(5, 5, 8, 0.3) 0%, rgba(5, 5, 8, 0.5) 50%, rgba(5, 5, 8, 0.8) 100%);
}

/* ===== ARCANE PORTAL CIRCLES ===== */
.portal-circles {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 800px;
    height: 800px;
    pointer-events: none;
    z-index: 0;
}

.portal-ring {
    position: absolute;
    border-radius: 50%;
    border: 1px solid transparent;
}

.portal-ring.outer {
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    border-color: rgba(168, 85, 247, 0.1);
    animation: portalRotate 60s linear infinite;
}

.portal-ring.outer::before {
    content: '';
    position: absolute;
    top: -2px;
    left: 50%;
    width: 4px;
    height: 4px;
    background: var(--accent-violet);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--accent-violet);
}

.portal-ring.middle {
    width: 70%;
    height: 70%;
    top: 15%;
    left: 15%;
    border-color: rgba(233, 30, 140, 0.12);
    animation: portalRotate 45s linear infinite reverse;
}

.portal-ring.middle::before {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 50%;
    width: 3px;
    height: 3px;
    background: var(--accent-pink);
    border-radius: 50%;
    box-shadow: 0 0 8px var(--accent-pink);
}

.portal-ring.inner {
    width: 45%;
    height: 45%;
    top: 27.5%;
    left: 27.5%;
    border-color: rgba(59, 130, 246, 0.15);
    animation: portalRotate 30s linear infinite;
}

@keyframes portalRotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Portal Center Glow */
.portal-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 300px;
    height: 300px;
    background: radial-gradient(ellipse at center, 
        rgba(168, 85, 247, 0.15) 0%, 
        rgba(233, 30, 140, 0.08) 40%, 
        transparent 70%);
    animation: portalPulse 4s ease-in-out infinite;
}

@keyframes portalPulse {
    0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: 0.6; }
    50% { transform: translate(-50%, -50%) scale(1.2); opacity: 1; }
}

/* ===== MAIN WRAPPER ===== */
.auth-wrapper {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 80px 20px 40px;
    z-index: 1;
}

/* ===== NAVIGATION BUTTONS ===== */
.nav-back {
    position: fixed;
    top: 24px;
    left: 24px;
    z-index: 100;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 24px;
    background: rgba(15, 15, 25, 0.8);
    border: 1px solid var(--border-subtle);
    border-radius: 30px;
    color: var(--text-secondary);
    text-decoration: none;
    font-family: 'Cinzel', serif;
    font-size: 0.85rem;
    font-weight: 500;
    letter-spacing: 0.5px;
    backdrop-filter: blur(10px);
    transition: all var(--transition-smooth);
}

.nav-back svg {
    width: 18px;
    height: 18px;
    transition: transform var(--transition-smooth);
}

.nav-back:hover {
    background: rgba(168, 85, 247, 0.15);
    border-color: var(--accent-violet);
    color: var(--text-primary);
    transform: translateX(-3px);
}

.nav-back:hover svg {
    transform: translateX(-3px);
}

.nav-contact {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 100;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: rgba(15, 15, 25, 0.8);
    border: 1px solid var(--border-subtle);
    border-radius: 30px;
    color: var(--text-secondary);
    text-decoration: none;
    font-family: 'Cinzel', serif;
    font-size: 0.85rem;
    font-weight: 500;
    letter-spacing: 0.5px;
    backdrop-filter: blur(10px);
    transition: all var(--transition-smooth);
}

.nav-contact svg {
    width: 16px;
    height: 16px;
}

.nav-contact:hover {
    background: rgba(233, 30, 140, 0.15);
    border-color: var(--accent-pink);
    color: var(--text-primary);
}

/* ===== AUTH CARD ===== */
.auth-card {
    position: relative;
    width: 100%;
    max-width: 460px;
    background: var(--gradient-card);
    border: 1px solid var(--border-subtle);
    border-radius: 24px;
    padding: 48px 40px;
    backdrop-filter: blur(20px);
    box-shadow: var(--shadow-deep), var(--shadow-glow);
    animation: cardAppear 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    opacity: 0;
    transform: translateY(30px);
}

@keyframes cardAppear {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Card Frame Decorations */
.auth-card::before {
    content: '';
    position: absolute;
    top: -1px;
    left: 20%;
    right: 20%;
    height: 2px;
    background: var(--gradient-magic);
    border-radius: 2px;
    opacity: 0.7;
}

.auth-card::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 30%;
    right: 30%;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--accent-violet), transparent);
}

/* Card Corner Runes */
.card-rune {
    position: absolute;
    width: 30px;
    height: 30px;
    opacity: 0.4;
}

.card-rune.top-left {
    top: 15px;
    left: 15px;
    border-top: 2px solid var(--accent-violet);
    border-left: 2px solid var(--accent-violet);
    border-radius: 5px 0 0 0;
}

.card-rune.top-right {
    top: 15px;
    right: 15px;
    border-top: 2px solid var(--accent-pink);
    border-right: 2px solid var(--accent-pink);
    border-radius: 0 5px 0 0;
}

.card-rune.bottom-left {
    bottom: 15px;
    left: 15px;
    border-bottom: 2px solid var(--accent-blue);
    border-left: 2px solid var(--accent-blue);
    border-radius: 0 0 0 5px;
}

.card-rune.bottom-right {
    bottom: 15px;
    right: 15px;
    border-bottom: 2px solid var(--accent-violet);
    border-right: 2px solid var(--accent-violet);
    border-radius: 0 0 5px 0;
}

/* ===== AUTH HEADER ===== */
.auth-header {
    text-align: center;
    margin-bottom: 36px;
}

.auth-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 20px;
}

.logo-emblem {
    position: relative;
    width: 50px;
    height: 50px;
}

.emblem-ring {
    position: absolute;
    border-radius: 50%;
    border: 1px solid;
}

.emblem-ring.outer {
    width: 100%;
    height: 100%;
    border-color: var(--accent-violet);
    animation: emblemRotate 10s linear infinite;
}

.emblem-ring.inner {
    width: 60%;
    height: 60%;
    top: 20%;
    left: 20%;
    border-color: var(--accent-pink);
    animation: emblemRotate 8s linear infinite reverse;
}

.emblem-core {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 12px;
    height: 12px;
    transform: translate(-50%, -50%);
    background: var(--accent-violet);
    border-radius: 50%;
    box-shadow: 0 0 15px var(--accent-violet), 0 0 30px var(--accent-pink);
    animation: emblemPulse 2s ease-in-out infinite;
}

@keyframes emblemRotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes emblemPulse {
    0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: 0.8; }
    50% { transform: translate(-50%, -50%) scale(1.2); opacity: 1; }
}

.logo-text {
    font-family: 'Cinzel', serif;
    font-size: 1.6rem;
    font-weight: 700;
    letter-spacing: 2px;
}

.logo-text .text-main {
    color: var(--text-primary);
}

.logo-text .text-accent {
    background: var(--gradient-magic);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.auth-title {
    font-family: 'Cinzel', serif;
    font-size: 1.8rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
    letter-spacing: 1px;
}

.auth-subtitle {
    font-family: 'Spectral', serif;
    font-size: 1rem;
    color: var(--text-secondary);
    font-style: italic;
}

/* ===== ALERT MESSAGES ===== */
.alert-message {
    position: relative;
    padding: 16px 20px;
    border-radius: 12px;
    margin-bottom: 24px;
    font-size: 0.9rem;
    animation: alertSlide 0.4s ease forwards;
}

@keyframes alertSlide {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.alert-message.warning {
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.3);
    color: #fbbf24;
}

.alert-message.success {
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.3);
    color: var(--success);
}

.alert-message.error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: var(--danger);
}

.alert-message strong {
    display: block;
    margin-bottom: 4px;
    font-family: 'Cinzel', serif;
    font-size: 0.95rem;
}

.alert-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 24px;
    height: 24px;
    background: transparent;
    border: none;
    color: inherit;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity var(--transition-fast);
    font-size: 1.2rem;
    line-height: 1;
}

.alert-close:hover {
    opacity: 1;
}

/* ===== FORM STYLES ===== */
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* Validation Summary */
.validation-summary-valid {
    display: none;
}

.validation-summary-errors {
    padding: 16px;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 12px;
    color: var(--danger);
    font-size: 0.9rem;
}

.validation-summary-errors ul {
    margin: 0;
    padding-left: 20px;
}

/* Form Group */
.form-group {
    position: relative;
}

.form-label {
    display: block;
    font-family: 'Cinzel', serif;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 10px;
    letter-spacing: 0.5px;
    transition: color var(--transition-fast);
}

.form-group.focused .form-label {
    color: var(--accent-violet);
}

/* Form Input */
.form-input {
    width: 100%;
    padding: 16px 20px;
    background: var(--bg-input);
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    color: var(--text-primary);
    font-family: 'Spectral', serif;
    font-size: 1rem;
    transition: all var(--transition-smooth);
    outline: none;
}

.form-input::placeholder {
    color: var(--text-muted);
    font-style: italic;
}

.form-input:focus {
    border-color: var(--accent-violet);
    box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.15), var(--shadow-glow);
    background: rgba(15, 15, 25, 0.95);
}

.form-input.valid {
    border-color: var(--success);
    box-shadow: 0 0 0 3px var(--success-glow);
}

.form-input.invalid {
    border-color: var(--danger);
    box-shadow: 0 0 0 3px var(--danger-glow);
}

/* Input Icon */
.input-wrapper {
    position: relative;
}

.input-wrapper .form-input {
    padding-left: 48px;
}

.input-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    color: var(--text-muted);
    transition: color var(--transition-fast);
    pointer-events: none;
}

.form-group.focused .input-icon {
    color: var(--accent-violet);
}

/* Error Message */
.text-danger,
.field-validation-error {
    display: block;
    margin-top: 8px;
    font-size: 0.85rem;
    color: var(--danger);
}

/* Form Feedback */
.form-feedback {
    margin-top: 8px;
    font-size: 0.85rem;
    min-height: 20px;
    transition: all var(--transition-fast);
}

.form-feedback.valid {
    color: var(--success);
}

.form-feedback.invalid {
    color: var(--danger);
}

.form-feedback.checking {
    color: var(--accent-violet);
}

/* Password Strength */
.password-strength {
    margin-top: 10px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.strength-bar-container {
    flex: 1;
    height: 4px;
    background: var(--bg-deep);
    border-radius: 2px;
    overflow: hidden;
}

.strength-bar {
    height: 100%;
    width: 0%;
    border-radius: 2px;
    transition: all var(--transition-smooth);
}

.strength-text {
    font-size: 0.8rem;
    font-weight: 500;
    min-width: 80px;
    text-align: right;
}

/* Password Match */
.password-match {
    margin-top: 8px;
    font-size: 0.85rem;
    min-height: 20px;
}

.password-match.match {
    color: var(--success);
}

.password-match.no-match {
    color: var(--danger);
}

/* Info Note */
.info-note {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    background: rgba(59, 130, 246, 0.08);
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: 10px;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.info-icon {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(59, 130, 246, 0.2);
    border-radius: 50%;
    color: var(--accent-blue-light);
    font-size: 0.75rem;
    font-weight: 600;
}

/* Info Notes List */
.info-notes {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.info-notes .info-note {
    background: rgba(168, 85, 247, 0.06);
    border-color: rgba(168, 85, 247, 0.15);
}

.info-notes .info-note-icon {
    width: 6px;
    height: 6px;
    background: var(--accent-violet);
    border-radius: 50%;
    flex-shrink: 0;
    margin-top: 8px;
}

/* ===== SUBMIT BUTTON ===== */
.btn-submit {
    position: relative;
    width: 100%;
    padding: 18px 32px;
    background: var(--gradient-magic);
    border: none;
    border-radius: 12px;
    color: white;
    font-family: 'Cinzel', serif;
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 1px;
    cursor: pointer;
    overflow: hidden;
    transition: all var(--transition-smooth);
    box-shadow: 0 4px 20px rgba(168, 85, 247, 0.3);
}

.btn-submit::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.btn-submit:hover::before {
    left: 100%;
}

.btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(168, 85, 247, 0.4), var(--shadow-glow-pink);
}

.btn-submit:active {
    transform: translateY(0);
}

.btn-submit:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.btn-submit:disabled::before {
    display: none;
}

/* Button with icon */
.btn-submit .btn-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.btn-submit svg {
    width: 20px;
    height: 20px;
    transition: transform var(--transition-smooth);
}

.btn-submit:hover svg {
    transform: translateX(4px);
}

/* ===== DIVIDER ===== */
.auth-divider {
    position: relative;
    display: flex;
    align-items: center;
    margin: 28px 0;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--border-subtle), transparent);
}

.auth-divider span {
    padding: 0 20px;
    font-family: 'Cinzel', serif;
    font-size: 0.8rem;
    color: var(--text-muted);
    letter-spacing: 1px;
    text-transform: uppercase;
}

/* ===== AUTH LINKS ===== */
.auth-links {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.auth-link {
    position: relative;
    font-family: 'Cinzel', serif;
    font-size: 0.9rem;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all var(--transition-smooth);
    padding: 8px 16px;
}

.auth-link::after {
    content: '';
    position: absolute;
    bottom: 4px;
    left: 50%;
    width: 0;
    height: 1px;
    background: var(--gradient-magic);
    transition: all var(--transition-smooth);
    transform: translateX(-50%);
}

.auth-link:hover {
    color: var(--text-primary);
}

.auth-link:hover::after {
    width: 80%;
}

.auth-link.primary {
    color: var(--accent-violet);
    font-weight: 600;
}

.auth-link.primary:hover {
    color: var(--accent-pink);
}

/* ===== LOADING SPINNER ===== */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.loading-spinner-small {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(168, 85, 247, 0.3);
    border-top-color: var(--accent-violet);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    vertical-align: middle;
    margin-right: 6px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ========================================================================
   REGISTRATION PAGE SPECIFIC STYLES
   ======================================================================== */

/* Privacy Card - Wider layout */
.privacy-card {
    position: relative;
    width: 100%;
    max-width: 700px;
    background: var(--gradient-card);
    border: 1px solid var(--border-subtle);
    border-radius: 24px;
    backdrop-filter: blur(20px);
    box-shadow: var(--shadow-deep), var(--shadow-glow);
    animation: cardAppear 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    opacity: 0;
    transform: translateY(30px);
    overflow: hidden;
}

.privacy-card::before {
    content: '';
    position: absolute;
    top: -1px;
    left: 20%;
    right: 20%;
    height: 2px;
    background: var(--gradient-magic);
    border-radius: 2px;
    opacity: 0.7;
}

/* Privacy Header */
.privacy-header {
    text-align: center;
    padding: 40px 40px 24px;
    border-bottom: 1px solid var(--border-subtle);
}

.privacy-logo {
    font-family: 'Cinzel', serif;
    font-size: 1.4rem;
    font-weight: 700;
    background: var(--gradient-magic);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 12px;
}

.privacy-title {
    font-family: 'Cinzel', serif;
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: 1px;
}

/* Privacy Content - Scrollable */
.privacy-content {
    max-height: 50vh;
    overflow-y: auto;
    padding: 30px 40px;
    scrollbar-width: thin;
    scrollbar-color: var(--accent-violet) var(--bg-deep);
}

.privacy-content::-webkit-scrollbar {
    width: 6px;
}

.privacy-content::-webkit-scrollbar-track {
    background: var(--bg-deep);
    border-radius: 3px;
}

.privacy-content::-webkit-scrollbar-thumb {
    background: var(--accent-violet);
    border-radius: 3px;
}

/* Privacy Sections */
.privacy-section {
    margin-bottom: 28px;
}

.privacy-section h3 {
    display: flex;
    align-items: center;
    gap: 12px;
    font-family: 'Cinzel', serif;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--accent-violet-light);
    margin-bottom: 14px;
}

.section-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: rgba(168, 85, 247, 0.15);
    border-radius: 8px;
    font-size: 0.85rem;
}

.privacy-section p {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.8;
}

.privacy-section a {
    color: var(--accent-pink);
    text-decoration: none;
    transition: color var(--transition-fast);
}

.privacy-section a:hover {
    color: var(--accent-pink-light);
    text-decoration: underline;
}

.privacy-intro {
    background: rgba(168, 85, 247, 0.06);
    padding: 20px;
    border-radius: 12px;
    border-left: 3px solid var(--accent-violet);
}

/* Age Warning */
.age-warning {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 20px;
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.25);
    border-radius: 10px;
}

.warning-badge {
    padding: 6px 14px;
    background: var(--danger);
    border-radius: 6px;
    font-family: 'Cinzel', serif;
    font-size: 0.9rem;
    font-weight: 700;
    color: white;
}

/* GDPR Note */
.gdpr-note {
    font-size: 0.85rem !important;
    color: var(--text-muted) !important;
    font-style: italic;
}

/* Free Notice */
.free-notice {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    background: rgba(34, 197, 94, 0.08);
    border: 1px solid rgba(34, 197, 94, 0.25);
    border-radius: 10px;
    color: var(--success) !important;
}

.free-icon {
    font-size: 1.2rem;
}

/* Privacy Declaration */
.privacy-declaration {
    margin-top: 24px;
    padding: 20px;
    background: rgba(233, 30, 140, 0.08);
    border: 1px solid rgba(233, 30, 140, 0.25);
    border-radius: 12px;
    text-align: center;
}

.privacy-declaration p {
    font-size: 0.95rem;
    color: var(--text-primary) !important;
}

/* Privacy Acceptance */
.privacy-acceptance {
    padding: 24px 40px;
    border-top: 1px solid var(--border-subtle);
    background: rgba(10, 10, 18, 0.5);
}

.acceptance-checkbox {
    display: flex;
    align-items: center;
    gap: 14px;
    cursor: pointer;
}

.acceptance-checkbox input {
    display: none;
}

.checkbox-custom {
    position: relative;
    width: 24px;
    height: 24px;
    background: var(--bg-input);
    border: 2px solid var(--border-subtle);
    border-radius: 6px;
    transition: all var(--transition-smooth);
    flex-shrink: 0;
}

.acceptance-checkbox input:checked + .checkbox-custom {
    background: var(--gradient-magic);
    border-color: var(--accent-violet);
}

.checkbox-custom::after {
    content: '';
    position: absolute;
    top: 4px;
    left: 8px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg) scale(0);
    transition: transform var(--transition-fast);
}

.acceptance-checkbox input:checked + .checkbox-custom::after {
    transform: rotate(45deg) scale(1);
}

.checkbox-label {
    font-size: 0.95rem;
    color: var(--text-secondary);
}

.checkbox-label strong {
    color: var(--text-primary);
}

/* Privacy Actions */
.privacy-actions {
    display: flex;
    gap: 16px;
    padding: 24px 40px 32px;
}

.btn-privacy {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 16px 24px;
    border-radius: 12px;
    font-family: 'Cinzel', serif;
    font-size: 0.95rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all var(--transition-smooth);
    border: none;
}

.btn-decline {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: var(--danger);
}

.btn-decline:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: var(--danger);
}

.btn-accept {
    background: var(--gradient-magic);
    color: white;
    box-shadow: 0 4px 20px rgba(168, 85, 247, 0.3);
}

.btn-accept:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(168, 85, 247, 0.4);
}

.btn-accept:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
}

.btn-icon {
    font-size: 0.9rem;
}

/* Phase Hidden */
.phase-hidden {
    display: none !important;
}

/* Registration Card */
.registration-card {
    position: relative;
    width: 100%;
    max-width: 520px;
    background: var(--gradient-card);
    border: 1px solid var(--border-subtle);
    border-radius: 24px;
    padding: 48px 40px;
    backdrop-filter: blur(20px);
    box-shadow: var(--shadow-deep), var(--shadow-glow);
    animation: cardAppear 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.registration-card::before {
    content: '';
    position: absolute;
    top: -1px;
    left: 20%;
    right: 20%;
    height: 2px;
    background: var(--gradient-magic);
    border-radius: 2px;
    opacity: 0.7;
}

.registration-header {
    text-align: center;
    margin-bottom: 32px;
}

.registration-logo {
    font-family: 'Cinzel', serif;
    font-size: 1.4rem;
    font-weight: 700;
    background: var(--gradient-magic);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 12px;
}

.registration-subtitle {
    font-family: 'Spectral', serif;
    font-size: 1rem;
    color: var(--text-secondary);
    font-style: italic;
}

.registration-form {
    display: flex;
    flex-direction: column;
    gap: 22px;
}

.btn-register {
    margin-top: 8px;
}

.registration-divider {
    position: relative;
    height: 1px;
    margin: 28px 0;
    background: linear-gradient(90deg, transparent, var(--border-subtle), transparent);
}

.registration-links {
    text-align: center;
}

.registration-link {
    font-family: 'Cinzel', serif;
    font-size: 0.9rem;
    color: var(--accent-violet);
    text-decoration: none;
    transition: color var(--transition-fast);
}

.registration-link:hover {
    color: var(--accent-pink);
}

/* ========================================================================
   RESPONSIVE STYLES
   ======================================================================== */

/* Tablet */
@media (max-width: 768px) {
    .auth-wrapper {
        padding: 100px 16px 30px;
    }
    
    .auth-card {
        padding: 36px 28px;
        border-radius: 20px;
    }
    
    .nav-back,
    .nav-contact {
        padding: 10px 16px;
        font-size: 0.8rem;
    }
    
    .nav-back span,
    .nav-contact span {
        display: none;
    }
    
    .portal-circles {
        width: 500px;
        height: 500px;
    }
    
    .auth-title {
        font-size: 1.5rem;
    }
    
    .auth-subtitle {
        font-size: 0.9rem;
    }
    
    .form-input {
        padding: 14px 16px;
    }
    
    .btn-submit {
        padding: 16px 24px;
    }
    
    /* Privacy Card */
    .privacy-card {
        max-width: 100%;
        border-radius: 20px;
    }
    
    .privacy-header {
        padding: 32px 24px 20px;
    }
    
    .privacy-content {
        padding: 24px;
        max-height: 45vh;
    }
    
    .privacy-acceptance {
        padding: 20px 24px;
    }
    
    .privacy-actions {
        padding: 20px 24px 28px;
        flex-direction: column;
    }
    
    .registration-card {
        padding: 36px 24px;
        max-width: 100%;
    }
}

/* Mobile */
@media (max-width: 480px) {
    .auth-wrapper {
        padding: 80px 12px 24px;
        align-items: flex-start;
    }
    
    .auth-card {
        padding: 32px 20px;
        border-radius: 16px;
    }
    
    .nav-back {
        top: 16px;
        left: 12px;
        padding: 10px 14px;
    }
    
    .nav-contact {
        top: 16px;
        right: 12px;
        padding: 10px 14px;
    }
    
    .portal-circles {
        width: 350px;
        height: 350px;
    }
    
    .portal-glow {
        width: 200px;
        height: 200px;
    }
    
    .logo-emblem {
        width: 40px;
        height: 40px;
    }
    
    .logo-text {
        font-size: 1.3rem;
    }
    
    .auth-title {
        font-size: 1.3rem;
    }
    
    .auth-subtitle {
        font-size: 0.85rem;
    }
    
    .form-label {
        font-size: 0.8rem;
    }
    
    .form-input {
        padding: 14px;
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    .btn-submit {
        padding: 16px 20px;
        font-size: 0.95rem;
    }
    
    .auth-link {
        font-size: 0.85rem;
    }
    
    .info-note {
        padding: 12px;
        font-size: 0.8rem;
    }
    
    /* Privacy Mobile */
    .privacy-header {
        padding: 28px 20px 18px;
    }
    
    .privacy-title {
        font-size: 1.25rem;
    }
    
    .privacy-content {
        padding: 20px;
        max-height: 40vh;
    }
    
    .privacy-section h3 {
        font-size: 1rem;
        flex-wrap: wrap;
    }
    
    .privacy-section p {
        font-size: 0.9rem;
    }
    
    .age-warning {
        flex-direction: column;
        text-align: center;
    }
    
    .privacy-acceptance {
        padding: 18px 20px;
    }
    
    .checkbox-label {
        font-size: 0.85rem;
    }
    
    .privacy-actions {
        padding: 18px 20px 24px;
    }
    
    .btn-privacy {
        padding: 14px 18px;
        font-size: 0.9rem;
    }
    
    .registration-card {
        padding: 32px 20px;
    }
    
    .registration-header {
        margin-bottom: 24px;
    }
    
    .info-notes .info-note {
        font-size: 0.8rem;
    }
}

/* Very Small Screens */
@media (max-width: 360px) {
    .auth-card {
        padding: 28px 16px;
    }
    
    .privacy-header,
    .privacy-content,
    .privacy-acceptance,
    .privacy-actions {
        padding-left: 16px;
        padding-right: 16px;
    }
    
    .portal-circles {
        display: none;
    }
}

/* Landscape Mobile */
@media (max-height: 600px) and (orientation: landscape) {
    .auth-wrapper {
        padding: 60px 20px 20px;
        align-items: flex-start;
    }
    
    .auth-card {
        padding: 24px;
    }
    
    .auth-header {
        margin-bottom: 20px;
    }
    
    .portal-circles {
        opacity: 0.5;
    }
    
    .privacy-content {
        max-height: 35vh;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .star-field,
    .nebula-layer,
    .portal-ring,
    .portal-glow,
    .emblem-ring,
    .emblem-core {
        animation: none !important;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .auth-card {
        border-width: 2px;
        border-color: var(--accent-violet);
    }

    .form-input {
        border-width: 2px;
    }

    .btn-submit {
        border: 2px solid white;
    }
}

/* ========================================================================
   SERVER ERROR BOX - For displaying validation errors from server
   ======================================================================== */
.server-error-box {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 20px;
    margin-bottom: 24px;
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.15), rgba(220, 38, 38, 0.1));
    border: 1px solid rgba(239, 68, 68, 0.4);
    border-radius: 12px;
    animation: errorShake 0.5s ease-out, errorGlow 2s ease-in-out infinite;
}

.server-error-icon {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--danger), #dc2626);
    border-radius: 50%;
    font-size: 1.2rem;
    color: white;
    box-shadow: 0 0 20px rgba(239, 68, 68, 0.4);
}

.server-error-content {
    flex: 1;
}

.server-error-content p {
    margin: 0;
    color: #fca5a5;
    font-size: 0.95rem;
    line-height: 1.6;
}

.server-error-content p + p {
    margin-top: 8px;
}

@keyframes errorShake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-4px); }
    20%, 40%, 60%, 80% { transform: translateX(4px); }
}

@keyframes errorGlow {
    0%, 100% { box-shadow: 0 0 10px rgba(239, 68, 68, 0.2); }
    50% { box-shadow: 0 0 20px rgba(239, 68, 68, 0.4); }
}
