/* ====================================
   VELORA AUTHENTICATION PAGES
   Unified styling for all auth flows
   Extends design system components
   ==================================== */

/* ========================================
   AUTH HERO SECTION
   ======================================== */

.auth-hero {
    background: var(--velora-gradient-cosmic);
    padding: 80px 0;
    min-height: 100vh;
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.auth-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image:
        radial-gradient(2px 2px at 20% 30%, rgba(255, 255, 255, 0.3), transparent),
        radial-gradient(2px 2px at 60% 70%, rgba(255, 255, 255, 0.2), transparent),
        radial-gradient(1px 1px at 50% 50%, rgba(255, 255, 255, 0.2), transparent);
    background-size: 200px 200px;
    background-repeat: repeat;
    opacity: 0.5;
    animation: twinkle 5s ease-in-out infinite;
    pointer-events: none;
}

@keyframes twinkle {
    0%, 100% {
        opacity: 0.3;
    }
    50% {
        opacity: 0.6;
    }
}

/* ========================================
   AUTH CONTAINER
   ======================================== */

.auth-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
    position: relative;
    z-index: 1;
}

/* ========================================
   AUTH CARD
   ======================================== */

.auth-card {
    /* Extends .velora-card and .velora-card-form base styling */
    /* Base styles come from .velora-card and .velora-card-form */
    /* Only auth-specific overrides here */
    border-radius: 20px;
    padding: 2.5rem;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

/* ========================================
   AUTH HEADER
   ======================================== */

.auth-header {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-header i {
    font-size: 3rem;
    color: var(--velora-accent-primary);
    margin-bottom: 1rem;
    display: block;
}

.auth-header h1 {
    color: var(--velora-text-primary);
    margin-bottom: 0.5rem;
    font-family: 'Crimson Text', serif;
}

.auth-header p {
    color: var(--velora-text-secondary);
}

/* ========================================
   AUTH EXPLANATORY TEXT
   Typography for explanatory paragraphs in auth forms
   ======================================== */

.auth-explanatory-text {
    font-size: var(--form-hint-size, 0.875rem);
    line-height: var(--form-hint-leading, 1.4);
    color: var(--velora-text-secondary);
    margin-bottom: 1.5rem;
}

/* ========================================
   AUTH FORM
   ======================================== */

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* ========================================
   FORM GROUP
   ======================================== */

.auth-card .form-group {
    /* Maps to .velora-form-group behavior */
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.auth-card .form-group label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
    color: var(--velora-text-primary);
}

.auth-card .form-group label i {
    color: var(--velora-accent-primary);
}

/* ========================================
   FORM INPUT
   ======================================== */

.auth-card .form-input {
    /* Extends .velora-input styling */
    padding: 1rem 1.25rem;
    border: 2px solid var(--velora-border-primary);
    border-radius: 10px;
    background: var(--velora-bg-card);
    color: var(--velora-text-primary);
    font-size: 1rem;
    min-height: 44px; /* WCAG touch target compliance */
    transition: all 0.3s ease;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    width: 100%;
    touch-action: manipulation; /* Prevents double-tap zoom */
}

.auth-card .form-input:focus {
    outline: 2px solid var(--velora-accent-primary);
    outline-offset: 3px; /* Larger offset for better mobile visibility */
    border-color: var(--velora-accent-primary);
    box-shadow: 0 0 0 3px rgba(107, 70, 193, 0.1);
}

.auth-card .form-input::placeholder {
    color: var(--velora-text-secondary);
    opacity: 0.7;
}

/* ========================================
   VALIDATION STATES
   ======================================== */

.auth-card .form-input.error {
    border-color: var(--velora-error, #ef4444);
    background: rgba(239, 68, 68, 0.05);
}

.error-message {
    color: var(--velora-error, #ef4444);
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

.alert-success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--velora-success, #10b981);
    border-left: 4px solid var(--velora-success, #10b981);
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
}

/* Validation state classes */
.auth-card .form-input.success {
    border-color: var(--velora-success);
    background: rgba(16, 185, 129, 0.05);
}

.auth-card .form-input.warning {
    border-color: var(--velora-warning, #f59e0b);
    background: rgba(245, 158, 11, 0.05);
}

.auth-card .form-input.info {
    border-color: var(--velora-info, #3b82f6);
    background: rgba(59, 130, 246, 0.05);
}

.success-message {
    color: var(--velora-success);
    font-size: 0.875rem;
    margin-top: 0.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.success-message::before {
    content: '✓';
    font-size: 1rem;
}

.warning-message {
    color: var(--velora-warning, #f59e0b);
    font-size: 0.875rem;
    margin-top: 0.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.warning-message::before {
    content: '⚠';
    font-size: 1rem;
}

.info-message {
    color: var(--velora-info, #3b82f6);
    font-size: 0.875rem;
    margin-top: 0.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.info-message::before {
    content: 'ℹ';
    font-size: 1rem;
}

/* ========================================
   FORM OPTIONS
   ======================================== */

.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 1rem 0;
    flex-wrap: wrap;
    gap: 1rem;
}

/* ========================================
   CHECKBOX STYLING
   ======================================== */

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    position: relative;
    min-height: 44px; /* WCAG touch target compliance */
    padding: 0.5rem 0;
}

.checkbox-label input[type="checkbox"] {
    /* Accessible visually-hidden pattern that preserves focusability */
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
    clip: rect(0, 0, 0, 0);
    clip-path: inset(50%);
    overflow: hidden;
    white-space: nowrap;
}

.checkmark {
    width: 20px;
    height: 20px;
    border: 2px solid var(--velora-border-primary);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

/* Mobile: larger checkmark for easier tapping */
@media (max-width: 768px) {
    .checkmark {
        width: 24px;
        height: 24px;
    }
}

.checkbox-label input[type="checkbox"]:checked + .checkmark {
    background: var(--velora-accent-primary);
    border-color: var(--velora-accent-primary);
}

.checkbox-label input[type="checkbox"]:checked + .checkmark::after {
    content: '✓';
    color: white;
    font-size: 12px;
    font-weight: bold;
}

.checkbox-text {
    color: var(--velora-text-secondary);
}

/* ========================================
   FORM ROW
   ======================================== */

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

/* ========================================
   FORM DIVIDER
   ======================================== */

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

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

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

/* ========================================
   AUTH FOOTER
   ======================================== */

.auth-footer {
    text-align: center;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--velora-border-primary);
}

.auth-link {
    color: var(--velora-accent-primary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.auth-link:hover {
    color: var(--velora-accent-secondary);
}

.forgot-link {
    color: var(--velora-accent-primary);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.3s ease;
}

.forgot-link:hover {
    color: var(--velora-accent-secondary);
}

/* ========================================
   AUTH BENEFITS SECTION
   ======================================== */

.auth-benefits {
    background: rgba(0, 0, 0, 0.2);
    padding: 2rem;
    border-radius: 20px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: white;
}

.auth-benefits h3 {
    font-size: 1.5rem;
    margin-bottom: 2rem;
    text-align: center;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    color: white;
}

/* ========================================
   BENEFITS LIST
   ======================================== */

.benefits-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* ========================================
   BENEFIT ITEM
   ======================================== */

.benefit-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 15px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.benefit-item i {
    font-size: 2rem;
    color: #ffd700;
    flex-shrink: 0;
}

.benefit-item h4 {
    margin: 0 0 0.5rem 0;
    font-size: 1.1rem;
    color: white;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.benefit-item p {
    margin: 0;
    opacity: 0.95;
    font-size: 0.9rem;
    line-height: 1.4;
    color: white;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

/* ========================================
   MOBILE RESPONSIVE
   ======================================== */

@media (max-width: 768px) {
    .auth-hero {
        padding: 60px 0;
    }

    .auth-container {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .auth-card {
        padding: 1.5rem;
    }

    .auth-card .form-group label {
        font-size: 1rem;
        margin-bottom: 0.75rem;
    }

    .auth-form {
        gap: 1.25rem;
    }

    .form-options {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .auth-benefits {
        padding: 1.5rem;
    }

    .benefit-item {
        padding: 1rem;
    }

    /* Mobile Touch Targets */
    button,
    .auth-link,
    .forgot-link,
    .checkbox-label {
        min-height: 44px;
        min-width: 44px;
    }

    .forgot-link,
    .auth-link {
        padding: 0.5rem 0.75rem;
        display: inline-block;
    }
}

@media (max-width: 640px) {
    .auth-card {
        padding: 1.25rem;
    }

    .auth-card .form-input {
        padding: 1rem 1.25rem;
        font-size: 1.0625rem; /* 17px prevents iOS zoom */
    }

    .form-row {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .auth-card {
        padding: 1rem;
    }

    .auth-card .form-group label {
        font-size: 0.9375rem;
    }
}

/* Autofocus styling */
.auth-card .form-input:autofocus {
    box-shadow: 0 0 0 4px rgba(107, 70, 193, 0.2);
}

/* ========================================
   DARK MODE ADJUSTMENTS
   ======================================== */

[data-theme="dark"] .auth-hero {
    background: linear-gradient(135deg, #0F0F0F 0%, #1A1A1A 50%, #262626 100%);
}

[data-theme="dark"] .auth-card {
    background: rgba(30, 41, 59, 0.95);
    border-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .auth-card .form-input {
    background: rgba(15, 23, 42, 0.8);
    border-color: rgba(255, 255, 255, 0.1);
    color: var(--velora-text-primary);
}

[data-theme="dark"] .auth-benefits {
    background: rgba(0, 0, 0, 0.4);
}

/* ========================================
   ACCESSIBILITY
   ======================================== */

/* Focus states for all interactive elements */
.auth-card .form-input:focus,
.auth-link:focus,
.forgot-link:focus,
.checkbox-label:focus-within,
button:focus {
    outline: 2px solid var(--velora-accent-primary);
    outline-offset: 2px;
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .auth-hero::before {
        animation: none;
    }

    * {
        transition: none !important;
        animation: none !important;
    }
}

/* Touch action optimization */
.auth-card .form-input,
.auth-link,
.forgot-link,
.checkbox-label,
button {
    touch-action: manipulation;
}
