/* ==========================================================================
   Authentication Pages CSS - Homepage V2 Aligned
   
   Page-specific styles for authentication forms:
   - login
   - register
   - forgot-password
   - reset-password
   - verify-email
   
   Updated to match homepage-v2.css design language:
   - Clean, light aesthetic
   - No star backgrounds
   - Violet/coral accent colors
   - Compact padding for laptop viewports
   ========================================================================== */

/* ==========================================================================
   CSS Variables (inherit from homepage-v2)
   ========================================================================== */

:root {
    /* Brand Colors */
    --auth-primary: #FF3D5A;
    --auth-primary-hover: #E6355C;
    --auth-violet: #6B5BFF;
    --auth-violet-hover: #5A4DE6;
    --auth-teal: #00D7C8;
    
    /* Neutrals */
    --auth-bg: #FAFAFA;
    --auth-bg-white: #FFFFFF;
    --auth-bg-dark: #0a0a0a;
    --auth-text-primary: #111111;
    --auth-text-secondary: #6B7280;
    --auth-text-muted: #9CA3AF;
    --auth-border: rgba(0, 0, 0, 0.08);
    --auth-border-strong: rgba(0, 0, 0, 0.12);
    
    /* Radius */
    --auth-radius-sm: 6px;
    --auth-radius-md: 10px;
    --auth-radius-lg: 16px;
}

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

body.auth-page {
    font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--auth-bg);
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
}

/* Subtle dot pattern background - matches homepage */
body.auth-page::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: radial-gradient(circle, rgba(107, 91, 255, 0.08) 1px, transparent 1px);
    background-size: 24px 24px;
    pointer-events: none;
    z-index: -1;
}

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

.auth-page > .container {
    padding-top: calc(64px + 40px); /* Height of fixed header + minimum gap */
    padding-bottom: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
    min-height: 100vh;
    box-sizing: border-box;
}

.auth-container {
    background: var(--auth-bg-white);
    border-radius: var(--auth-radius-lg);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
    overflow: hidden;
    width: 100%;
    max-width: 420px; /* Slightly reduced */
    border: 1px solid var(--auth-border);
}

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

/* ==========================================================================
   Header Section - Light Design with Gradient Accent
   ========================================================================== */

.auth-header {
    /* Light background with subtle gradient tint */
    background: linear-gradient(180deg, 
        rgba(255, 61, 90, 0.06) 0%,
        rgba(107, 91, 255, 0.04) 50%,
        var(--auth-bg-white) 100%
    );
    border-bottom: none;
    padding: 2.5rem 2rem 1.5rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

/* Gradient accent bar at top - coral to violet */
.auth-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, 
        var(--auth-primary) 0%, 
        var(--auth-violet) 100%
    );
}

/* Bottom border separator */
.auth-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 1.5rem;
    right: 1.5rem;
    height: 1px;
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(0, 0, 0, 0.08) 20%,
        rgba(0, 0, 0, 0.08) 80%,
        transparent 100%
    );
}

.auth-header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--auth-text-primary);
    margin-bottom: 0;
    letter-spacing: -0.02em;
    position: relative;
    z-index: 1;
}

.auth-header p {
    margin-bottom: 0;
    margin-top: 0.5rem;
    color: var(--auth-text-secondary);
    font-size: 0.9rem;
    font-weight: 400;
    position: relative;
    z-index: 1;
}

/* Beta Badge - Coral accent on light header */
.auth-header .beta-badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: linear-gradient(135deg, 
        rgba(255, 61, 90, 0.1) 0%, 
        rgba(107, 91, 255, 0.1) 100%
    );
    color: var(--auth-primary);
    padding: 0.35rem 0.75rem;
    border-radius: 50px;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    border: 1px solid rgba(255, 61, 90, 0.25);
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    z-index: 2;
}

.auth-header .beta-badge i {
    font-size: 0.65rem;
}

/* Success state header */
.auth-header.success-header {
    background: linear-gradient(180deg, 
        rgba(0, 215, 200, 0.08) 0%,
        rgba(16, 185, 129, 0.04) 50%,
        var(--auth-bg-white) 100%
    );
}

.auth-header.success-header::before {
    background: linear-gradient(90deg, 
        var(--auth-teal) 0%, 
        #10b981 100%
    );
}

.auth-header .success-icon {
    display: block;
    color: var(--auth-teal);
    font-size: 2.5rem;
    margin-bottom: 0.75rem;
    position: relative;
    z-index: 1;
}

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

.auth-body {
    padding: 2rem 2rem 2rem;
}

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

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

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

.auth-page .form-control,
.auth-page .form-select {
    font-size: 0.875rem;
    padding: 0.625rem 0.875rem; /* Slightly reduced */
    border: 1px solid var(--auth-border-strong);
    border-radius: var(--auth-radius-md);
    transition: all 0.2s ease;
    background: var(--auth-bg-white);
}

.auth-page .form-control:focus,
.auth-page .form-select:focus {
    border-color: var(--auth-violet);
    box-shadow: 0 0 0 3px rgba(107, 91, 255, 0.1);
    outline: none;
}

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

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

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

.auth-page .form-text {
    font-size: 0.75rem;
    color: var(--auth-text-muted);
    margin-top: 0.375rem;
}

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

.auth-page .btn-primary {
    background: var(--auth-violet);
    border: none;
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    font-size: 0.875rem;
    border-radius: var(--auth-radius-md);
    transition: all 0.2s ease;
    color: white;
}

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

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

.auth-page .btn-lg {
    padding: 0.875rem 1.5rem;
}

.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.3);
}

.auth-page .btn-outline-secondary {
    border: 1px solid var(--auth-border-strong);
    color: var(--auth-text-secondary);
    background: transparent;
    font-weight: 500;
}

.auth-page .btn-outline-secondary:hover {
    background: var(--auth-bg);
    border-color: var(--auth-border-strong);
    color: var(--auth-text-primary);
}

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

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

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

.auth-page a:not(.btn):not(.nav-link):not(.btn-nav-cta):not(.btn-nav-primary) {
    color: var(--auth-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(--auth-violet-hover);
}

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

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

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

.divider span {
    background: var(--auth-bg-white);
    padding: 0 0.75rem;
    color: var(--auth-text-muted);
    font-size: 0.8125rem;
    position: relative;
}

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

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

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

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

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

.password-requirements {
    font-size: 0.75rem;
    color: var(--auth-text-secondary);
    margin-top: 0.5rem;
    padding: 0.625rem;
    background-color: var(--auth-bg);
    border-radius: var(--auth-radius-sm);
}

.requirement {
    margin: 0.25rem 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.375rem;
}

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

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

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

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

.auth-page .form-check-input:focus {
    box-shadow: 0 0 0 3px rgba(107, 91, 255, 0.1);
    border-color: var(--auth-violet);
}

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

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

.auth-page .alert {
    border-radius: var(--auth-radius-md);
    border: none;
    font-size: 0.875rem;
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
}

.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.75rem;
    color: #ef4444;
    margin-top: 0.25rem;
}

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

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

.icon-large {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.success-icon {
    color: var(--auth-teal);
}

.error-icon {
    color: #ef4444;
}

/* ==========================================================================
   Spacing Adjustments
   ========================================================================== */

.auth-page .mb-3 {
    margin-bottom: 0.875rem !important;
}

.auth-page .mb-4 {
    margin-bottom: 1rem !important;
}

.auth-page .mt-4 {
    margin-top: 1.25rem !important;
}

/* Footer links in form */
.auth-body .text-center.mt-4 p {
    font-size: 0.8125rem;
    color: var(--auth-text-secondary);
    margin-bottom: 0.5rem;
}

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

@media (max-width: 576px) {
    .auth-page > .container {
        padding-top: calc(56px + 32px); /* Smaller header on mobile + minimum gap */
        padding-bottom: 32px;
        min-height: 100vh;
    }
    
    .auth-container {
        margin: 0 1rem;
        max-width: none;
        width: calc(100% - 2rem);
    }
    
    .auth-header {
        padding: 1.25rem 1.25rem 1rem;
    }
    
    .auth-header h1 {
        font-size: 1.25rem;
    }
    
    .auth-body {
        padding: 1.75rem 1.25rem 1.25rem;
    }
}

@media (max-height: 700px) {
    /* For very short viewports, allow scrolling but maintain gap */
    .auth-page > .container {
        padding-top: calc(64px + 24px); /* Header height + minimum gap */
        padding-bottom: 24px;
        min-height: auto;
        align-items: flex-start;
    }
    
    .auth-header {
        padding: 1rem 1.5rem 0.875rem;
    }
    
    .auth-body {
        padding: 1.5rem 1.5rem 1.25rem;
    }
    
    .auth-page .mb-3 {
        margin-bottom: 0.625rem !important;
    }
}

/* Combined: mobile + short viewport */
@media (max-width: 576px) and (max-height: 700px) {
    .auth-page > .container {
        padding-top: calc(56px + 20px); /* Mobile header + minimum gap */
        padding-bottom: 20px;
    }
}

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

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

.auth-container {
    animation: fadeIn 0.3s 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); }
}

/* Button spinner utility */
.btn-spinner {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

#submitBtn {
    position: relative;
    transition: all 0.3s ease;
}

#submitBtn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}
