/* AI Manifestation Code - Clean White Theme with Blue Accents */

:root {
    /* Primary Blue Color Scheme */
    --primary-color: #1D48C2;
    --primary-hover: #1640B8;
    --primary-light: #E3EAFF;
    --primary-dark: #1A3FA8;
    
    /* Background Colors - Clean White */
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-card: #ffffff;
    --bg-input: #ffffff;
    --bg-hover: #f8fafc;
    
    /* Text Colors */
    --text-primary: #1e293b;
    --text-secondary: #475569;
    --text-muted: #64748b;
    --text-white: #ffffff;
    --text-error: #dc2626;
    --text-success: #059669;
    
    /* Border Colors */
    --border-color: #e2e8f0;
    --border-focus: #1D48C2;
    --border-error: #ef4444;
    --border-hover: #cbd5e1;
    
    /* Status Colors */
    --success-color: #10b981;
    --error-color: #ef4444;
    --warning-color: #f59e0b;
    
    /* Spacing */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    
    /* Border Radius */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    
    /* Transitions */
    --transition: 200ms ease-in-out;
}

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-secondary);
    min-height: 100vh;
}

/* Container and Layout */
.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-md);
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
}

.auth-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 2.5rem;
    width: 100%;
    max-width: 450px;
    border: 1px solid var(--border-color);
    position: relative;
    overflow: hidden;
}

.auth-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--primary-hover));
}

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

.auth-logo {
    font-size: 28px;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    text-shadow: 0 2px 4px rgba(29, 72, 194, 0.1);
}

.auth-title {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, var(--text-primary), var(--primary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.auth-subtitle {
    color: var(--text-secondary);
    font-size: 16px;
    line-height: 1.6;
    max-width: 300px;
    margin: 0 auto;
}

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

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

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

.form-label {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 14px;
    margin-bottom: 0.25rem;
}

.form-input, .form-select {
    padding: 14px 16px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 16px;
    background-color: var(--bg-input);
    color: var(--text-primary);
    transition: all var(--transition);
    width: 100%;
    font-family: inherit;
}

.form-input:focus, .form-select:focus {
    outline: none;
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgba(29, 72, 194, 0.1);
    transform: translateY(-1px);
}

.form-input:hover, .form-select:hover {
    border-color: var(--border-hover);
}

.form-input.error {
    border-color: var(--border-error);
    background-color: #fef2f2;
}

.form-input.error:focus {
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

/* Input Icons */
.input-group {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 12px;
    color: var(--text-muted);
    font-size: 16px;
    z-index: 1;
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Font Awesome icons are handled by the <i> tags directly */

.input-group .form-input {
    padding-left: 44px;
}

.input-group .password-toggle {
    right: 12px;
}

/* Select Dropdown Styling */
.form-select {
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6,9 12,15 18,9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
    padding-right: 40px;
}

.input-group .form-select {
    padding-left: 44px;
    padding-right: 40px;
}

/* Password Strength Indicator */
.password-strength {
    margin-top: 0.5rem;
    font-size: 12px;
}

.password-strength-weak {
    color: #ef4444;
}

.password-strength-medium {
    color: #f59e0b;
}

.password-strength-strong {
    color: #10b981;
}

/* Form Validation States */
.form-input.valid {
    border-color: var(--success-color);
    background-color: #f0fdf4;
}

.form-input.valid:focus {
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

/* Loading Animation for Forms */
.form-loading {
    opacity: 0.7;
    pointer-events: none;
}

.form-loading .form-input,
.form-loading .form-select {
    background-color: #f8fafc;
}

/* Enhanced OTP Input */
.otp-input {
    text-align: center;
    font-size: 18px;
    font-weight: 600;
    letter-spacing: 4px;
    font-family: 'Courier New', monospace;
}

/* Improved Checkbox Styling */
.checkbox {
    width: 20px;
    height: 20px;
    accent-color: var(--primary-color);
    cursor: pointer;
}

.checkbox-label {
    cursor: pointer;
    line-height: 1.5;
}

/* Enhanced Links */
.auth-link {
    position: relative;
    transition: all var(--transition);
}

.auth-link::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -2px;
    left: 0;
    background-color: var(--primary-color);
    transition: width var(--transition);
}

.auth-link:hover::after {
    width: 100%;
}

/* Form Row Responsive */
@media (max-width: 640px) {
    .form-row {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .form-group[style*="flex: 0 0 140px"] {
        flex: 1 !important;
    }
}

/* Password Input with Toggle */
.password-input-container {
    position: relative;
}

.password-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    border-radius: var(--radius-sm);
    transition: color var(--transition);
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.password-toggle::before {
    font-family: 'Font Awesome 5 Free', 'Font Awesome 5 Pro', sans-serif;
    font-weight: 900;
    content: '\f06e'; /* eye icon */
}

.password-toggle.hide::before {
    content: '\f070'; /* eye-slash icon */
}

.password-toggle:hover {
    color: var(--text-primary);
}

/* Buttons */
.btn {
    padding: 14px 28px;
    border-radius: var(--radius-md);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    border: 2px solid transparent;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    min-height: 52px;
    width: 100%;
    position: relative;
    overflow: hidden;
}

.btn::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;
}

.btn:hover::before {
    left: 100%;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
    color: var(--text-white);
    border-color: var(--primary-color);
    box-shadow: 0 4px 15px rgba(29, 72, 194, 0.2);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-hover), var(--primary-dark));
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(29, 72, 194, 0.3);
}

.btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 4px 15px rgba(29, 72, 194, 0.2);
}

.btn-secondary {
    background-color: transparent;
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-secondary:hover {
    background-color: var(--primary-light);
    transform: translateY(-1px);
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

.btn:disabled::before {
    display: none;
}

/* Error and Success Messages */
.error-message {
    color: var(--text-error);
    font-size: 14px;
    margin-top: var(--spacing-xs);
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
}

.success-message {
    color: var(--text-success);
    font-size: 14px;
    margin-top: var(--spacing-xs);
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
}

.alert {
    padding: 12px 16px;
    border-radius: var(--radius-md);
    margin-bottom: var(--spacing-lg);
    border: 1px solid;
}

.alert-error {
    background-color: #fef2f2;
    border-color: #fecaca;
    color: var(--text-error);
}

.alert-success {
    background-color: #f0fdf4;
    border-color: #bbf7d0;
    color: var(--text-success);
}

.alert-info {
    background-color: var(--primary-light);
    border-color: var(--primary-color);
    color: var(--primary-dark);
}

/* Links */
.auth-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    transition: color var(--transition);
}

.auth-link:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

/* Footer Links */
.auth-footer {
    text-align: center;
    margin-top: var(--spacing-xl);
    padding-top: var(--spacing-lg);
    border-top: 1px solid var(--border-color);
}

.auth-footer p {
    color: var(--text-secondary);
    font-size: 14px;
}

/* Checkbox */
.checkbox-container {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.checkbox {
    width: 18px;
    height: 18px;
    accent-color: var(--primary-color);
}

.checkbox-label {
    font-size: 14px;
    color: var(--text-secondary);
    cursor: pointer;
}

/* OTP Input */
.otp-container {
    text-align: center;
    padding: var(--spacing-lg);
    background-color: var(--bg-secondary);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    margin-bottom: var(--spacing-lg);
}

.otp-info {
    color: var(--text-secondary);
    margin-bottom: var(--spacing-md);
}

.otp-email {
    font-weight: 600;
    color: var(--primary-color);
}

.otp-input {
    font-size: 18px;
    text-align: center;
    letter-spacing: 2px;
    font-weight: 600;
}

/* Loading States */
.loading {
    opacity: 0.7;
    pointer-events: none;
}

.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Responsive Design */
@media (max-width: 480px) {
    .auth-container {
        padding: var(--spacing-sm);
    }
    
    .auth-card {
        padding: var(--spacing-lg);
    }
    
    .auth-title {
        font-size: 24px;
    }
}

/* Focus Visible for Accessibility */
.btn:focus-visible,
.form-input:focus-visible,
.auth-link:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    :root {
        --border-color: #000000;
        --text-secondary: #000000;
    }
}

/* Popup Styles */
.popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.popup-overlay.active {
    opacity: 1;
    visibility: visible;
}

.popup-content {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    max-width: 600px;
    max-height: 80vh;
    width: 90%;
    margin: 2rem;
    overflow: hidden;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.popup-overlay.active .popup-content {
    transform: scale(1);
}

.popup-header {
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--primary-color);
    color: white;
}

.popup-header h2 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
}

.popup-close {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: var(--radius-sm);
    transition: background-color 0.2s ease;
}

.popup-close:hover {
    background: rgba(255, 255, 255, 0.1);
}

.popup-body {
    padding: 2rem;
    max-height: 60vh;
    overflow-y: auto;
    line-height: 1.6;
}

.popup-body h3 {
    color: var(--primary-color);
    margin: 1.5rem 0 1rem 0;
    font-size: 1.1rem;
    font-weight: 600;
}

.popup-body p {
    margin-bottom: 1rem;
    color: var(--text-secondary);
}

.popup-body ul {
    margin: 1rem 0;
    padding-left: 1.5rem;
}

.popup-body li {
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
}

.popup-body strong {
    color: var(--text-primary);
}
