/* ==========================================================================
   Authentication Pages CSS
   
   Page-specific styles for authentication forms:
   - login.php
   - register.php
   - forgot-password.php
   - reset-password.php
   - verify-email.php
   
   Global styles and navbar are in external.css
   This file only contains auth form-specific styling
   ========================================================================== */

/* ==========================================================================
   Body and Background
   ========================================================================== */

body.auth-page {
    font-family: var(--font-sans);
    background: var(--bg-light) !important;
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
}

/* Navbar styles are in external.css */

/* ==========================================================================
   Main Container
   ========================================================================== */

.auth-page > .container {
    padding-top: 120px; /* Account for fixed navbar with generous spacing */
    padding-bottom: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
    min-height: calc(100vh - 200px); /* Full viewport minus top/bottom padding */
}

.auth-container {
    background: var(--bg-light);
    border-radius: var(--radius-xl);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    width: 100%;
    max-width: 450px;
    border: 1px solid rgba(0, 0, 0, 0.08);
}

.auth-container.wide {
    max-width: 500px;
}

/* ==========================================================================
   Header Section
   ========================================================================== */

.auth-header {
    /* Dark abyss to violet edges - creates depth */
    background: linear-gradient(180deg, #3d4585 0%, #1B1F54 20%, #0B0F27 35%, #0B0F27 65%, #1B1F54 80%, #3d4585 100%);
    background-image: 
        radial-gradient(ellipse 1200px 400px at 50% -5%, rgba(107, 91, 255, 0.6), transparent 50%),
        radial-gradient(ellipse 1000px 300px at 80% 100%, rgba(139, 127, 255, 0.4), transparent 50%),
        linear-gradient(180deg, #3d4585 0%, #1B1F54 20%, #0B0F27 35%, #0B0F27 65%, #1B1F54 80%, #3d4585 100%);
    background-size: 100% 100%, 100% 100%, 100% 100%;
    color: white;
    padding: 2rem 2rem 1.75rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.auth-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: rgba(255, 255, 255, 0.2);
}

.auth-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0;
    letter-spacing: -0.01em;
    position: relative;
    z-index: 1;
}

.auth-header p {
    margin-bottom: 0;
    margin-top: 0.5rem;
    opacity: 0.9;
    font-size: 0.875rem;
    font-weight: 400;
    position: relative;
    z-index: 1;
}

/* Starfield Effect for Headers */
.header-stars,
.header-stars2,
.header-stars3 {
    position: absolute;
    inset: 0;
    background-repeat: repeat;
    pointer-events: none;
    z-index: 0;
}

.header-stars {
    --star: rgba(207, 227, 255, 0.8);
    background-image: 
        radial-gradient(1.5px 1.5px at 20px 30px, var(--star) 70%, transparent 72%),
        radial-gradient(1.5px 1.5px at 80px 120px, var(--star) 70%, transparent 72%),
        radial-gradient(1.5px 1.5px at 200px 60px, var(--star) 70%, transparent 72%);
    background-size: 240px 240px, 340px 340px, 520px 520px;
    opacity: 0.8;
    animation: drift-stars 60s linear infinite;
}

.header-stars2 {
    --star: rgba(207, 227, 255, 0.8);
    background-image: 
        radial-gradient(1.8px 1.8px at 50px 90px, var(--star) 75%, transparent 77%),
        radial-gradient(1.8px 1.8px at 140px 210px, var(--star) 75%, transparent 77%),
        radial-gradient(1.8px 1.8px at 260px 40px, var(--star) 75%, transparent 77%);
    background-size: 320px 320px, 420px 420px, 520px 520px;
    opacity: 0.6;
    animation: drift-stars2 90s linear infinite;
}

.header-stars3 {
    --star: rgba(207, 227, 255, 0.8);
    background-image: 
        radial-gradient(1.2px 1.2px at 30px 40px, var(--star) 70%, transparent 72%),
        radial-gradient(1.2px 1.2px at 110px 180px, var(--star) 70%, transparent 72%),
        radial-gradient(1.2px 1.2px at 250px 70px, var(--star) 70%, transparent 72%);
    background-size: 220px 220px, 310px 310px, 480px 480px;
    opacity: 0.5;
    animation: drift-stars3 120s linear infinite;
}

@keyframes drift-stars {
    from { background-position: 0 0, 0 0, 0 0; }
    to { background-position: -240px 240px, -340px 340px, -520px 520px; }
}

@keyframes drift-stars2 {
    from { background-position: 0 0, 0 0, 0 0; }
    to { background-position: -320px 320px, -420px 420px, -520px 520px; }
}

@keyframes drift-stars3 {
    from { background-position: 0 0, 0 0, 0 0; }
    to { background-position: -220px 220px, -310px 310px, -480px 480px; }
}

/* ==========================================================================
   Body Section
   ========================================================================== */

.auth-body {
    padding: 2rem;
}

.auth-body.text-center {
    text-align: center;
}

/* ==========================================================================
   Form Controls
   ========================================================================== */

.auth-page .form-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.auth-page .form-control {
    font-size: 0.9375rem;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    transition: all 0.2s ease;
}

.auth-page .form-control:focus {
    border-color: var(--ion-violet);
    box-shadow: 0 0 0 0.2rem rgba(107, 91, 255, 0.15);
    outline: none;
}

.auth-page .form-control:hover:not(:focus) {
    border-color: rgba(0, 0, 0, 0.15);
}

.auth-page .form-control.is-valid {
    border-color: #10b981;
    background-image: none;
}

.auth-page .form-control.is-invalid {
    border-color: #ef4444;
    background-image: none;
}

/* ==========================================================================
   Buttons
   ========================================================================== */

.auth-page .btn-primary {
    background: linear-gradient(135deg, var(--ion-violet) 0%, var(--ion-violet-hover) 100%);
    border: none;
    padding: 0.875rem 2rem;
    font-weight: 600;
    font-size: 0.9375rem;
    border-radius: var(--radius-md);
    transition: all 0.2s ease;
}

.auth-page .btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(107, 91, 255, 0.4);
}

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

.auth-page .btn-lg {
    padding: 1rem 2rem;
}

.auth-page .btn-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border: none;
    font-weight: 600;
}

.auth-page .btn-success:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
}

/* ==========================================================================
   Links
   ========================================================================== */

.forgot-password,
.back-link {
    color: var(--ion-violet);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: color 0.2s ease;
}

.forgot-password:hover,
.back-link:hover {
    color: var(--ion-violet-hover);
    text-decoration: none;
}

.auth-page a:not(.btn):not(.nav-link):not(.btn-nav-cta):not(.btn-nav-primary) {
    color: var(--ion-violet);
    font-weight: 500;
    text-decoration: none;
    transition: color 0.2s ease;
}

.auth-page a:not(.btn):not(.nav-link):not(.btn-nav-cta):not(.btn-nav-primary):hover {
    color: var(--ion-violet-hover);
}

/* ==========================================================================
   Divider
   ========================================================================== */

.divider {
    text-align: center;
    margin: 1.5rem 0;
    position: relative;
}

.divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--border-color);
}

.divider span {
    background: var(--bg-light);
    padding: 0 1rem;
    color: var(--text-secondary);
    font-size: 0.875rem;
    position: relative;
}

/* ==========================================================================
   Input Groups
   ========================================================================== */

.auth-page .input-group .btn-outline-secondary {
    border-color: var(--border-color);
    color: var(--text-secondary);
    transition: all 0.2s ease;
}

.auth-page .input-group .btn-outline-secondary:hover {
    background-color: #f9fafb;
    border-color: var(--border-color);
    color: var(--text-primary);
}

.auth-page .input-group .btn-outline-secondary:focus {
    box-shadow: 0 0 0 0.2rem rgba(107, 91, 255, 0.15);
    border-color: var(--ion-violet);
}

/* ==========================================================================
   Password Requirements
   ========================================================================== */

.password-requirements {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    margin-top: 0.75rem;
    padding: 0.75rem;
    background-color: #f9fafb;
    border-radius: var(--radius-md);
}

.requirement {
    margin: 0.375rem 0;
    display: flex;
    align-items: center;
    transition: color 0.2s ease;
}

.requirement.valid {
    color: #10b981;
    font-weight: 500;
}

.requirement.valid::before {
    content: '✓';
    margin-right: 0.5rem;
}

.requirement.invalid {
    color: var(--text-secondary);
}

.requirement.invalid::before {
    content: '•';
    margin-right: 0.5rem;
}

/* ==========================================================================
   Form Check (Remember Me)
   ========================================================================== */

.auth-page .form-check-input:checked {
    background-color: var(--ion-violet);
    border-color: var(--ion-violet);
}

.auth-page .form-check-input:focus {
    box-shadow: 0 0 0 0.2rem rgba(107, 91, 255, 0.15);
    border-color: var(--ion-violet);
}

.auth-page .form-check-label {
    font-size: 0.875rem;
    color: var(--text-primary);
}

/* ==========================================================================
   Alerts
   ========================================================================== */

.auth-page .alert {
    border-radius: var(--radius-md);
    border: none;
    font-size: 0.9375rem;
}

.auth-page .alert-danger {
    background-color: #fef2f2;
    color: #991b1b;
}

.auth-page .alert-success {
    background-color: #f0fdf4;
    color: #166534;
}

.auth-page .alert-info {
    background-color: #eff6ff;
    color: #1e40af;
}

.auth-page .alert i {
    margin-right: 0.5rem;
}

/* ==========================================================================
   Validation Feedback
   ========================================================================== */

.auth-page .invalid-feedback {
    font-size: 0.8125rem;
    color: #ef4444;
    margin-top: 0.375rem;
}

.auth-page .valid-feedback {
    font-size: 0.8125rem;
    color: #10b981;
    margin-top: 0.375rem;
}

/* ==========================================================================
   Icon Utilities
   ========================================================================== */

.icon-large {
    font-size: 4rem;
    margin-bottom: 1.5rem;
}

.success-icon {
    color: #10b981;
}

.error-icon {
    color: #ef4444;
}

/* ==========================================================================
   Back to Home Link
   ========================================================================== */

.back-to-home {
    position: absolute;
    top: 1.5rem;
    left: 2rem;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: color 0.2s ease;
    z-index: 10;
}

.back-to-home:hover {
    color: rgba(255, 255, 255, 1);
}

.back-to-home i {
    font-size: 0.75rem;
}

/* ==========================================================================
   Responsive Adjustments
   ========================================================================== */

@media (max-width: 576px) {
    .auth-page > .container {
        padding-top: 100px;
        padding-bottom: 40px;
        min-height: calc(100vh - 140px);
    }
    
    .auth-container {
        margin: 0 1rem;
        max-width: none;
        width: 100%;
    }
    
    .auth-header {
        padding: 2rem 1.5rem 1.5rem;
    }
    
    .auth-header h2 {
        font-size: 1.5rem;
    }
    
    .auth-body {
        padding: 1.5rem;
    }
    
    .back-to-home {
        top: 1rem;
        left: 1rem;
    }
}

/* ==========================================================================
   Animations
   ========================================================================== */

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

.auth-container {
    animation: fadeIn 0.4s ease;
}

/* Loading state for buttons */
.btn-loading {
    position: relative;
    color: transparent !important;
}

.btn-loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin-left: -8px;
    margin-top: -8px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Navbar styling is handled by external.css */
