/* ===== MarketMetrix Auth Pages ===== */
/* Corporate Design: Primary #0f172a, Accent #0ea5e9 → #8b5cf6 */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Newsreader:wght@400;500;600&display=swap');

:root {
    --primary-dark: #0f172a;
    --primary-medium: #1e293b;
    --primary-light: #334155;
    --accent-primary: #0ea5e9;
    --accent-secondary: #8b5cf6;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
    --bg-color: #f8fafc;
    --gradient-primary: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-light) 100%);
    --gradient-accent: linear-gradient(90deg, var(--accent-primary) 0%, var(--accent-secondary) 100%);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--gradient-primary);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    pointer-events: none;
    z-index: 0;
}

h1, h2, h3, h4 {
    font-family: 'Newsreader', Georgia, serif;
}

/* Auth Container */
.auth-container {
    width: 100%;
    max-width: 440px;
    position: relative;
    z-index: 1;
}

/* Auth Card */
.auth-card {
    background: white;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.4);
}

/* Card Header */
.auth-header {
    background: var(--gradient-primary);
    padding: 2.5rem 2rem;
    text-align: center;
    color: white;
    position: relative;
    overflow: hidden;
}

.auth-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    opacity: 0.5;
}

.auth-logo {
    width: 80px;
    height: 80px;
    background: white;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.25rem;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    position: relative;
    z-index: 1;
    animation: float 3s ease-in-out infinite;
    padding: 8px;
}

.auth-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}

.auth-header h2 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    position: relative;
    z-index: 1;
}

.auth-header p {
    opacity: 0.9;
    font-size: 0.9rem;
    position: relative;
    z-index: 1;
    letter-spacing: 1px;
    text-transform: uppercase;
}

/* Card Body */
.auth-body {
    padding: 2rem;
}

/* Alerts */
.alert {
    padding: 1rem;
    border-radius: 10px;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.95rem;
}

.alert i {
    font-size: 1.1rem;
}

.alert-danger {
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
}

.alert-success {
    background: #f0fdf4;
    color: #16a34a;
    border: 1px solid #bbf7d0;
}

.alert-info {
    background: #eff6ff;
    color: #2563eb;
    border: 1px solid #bfdbfe;
}

.alert-warning {
    background: #fffbeb;
    color: #d97706;
    border: 1px solid #fde68a;
}

/* Form Groups */
.form-group {
    margin-bottom: 1.25rem;
}

.form-label {
    display: block;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

/* Input Group */
.input-group {
    display: flex;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    overflow: hidden;
    transition: all 0.2s ease;
    background: white;
}

.input-group:focus-within {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.15);
}

.input-group.error {
    border-color: var(--danger-color);
}

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

.input-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    background: var(--bg-color);
    color: var(--text-muted);
    border-right: 1px solid var(--border-color);
    flex-shrink: 0;
}

.input-group input {
    flex: 1;
    padding: 0.875rem 1rem;
    border: none;
    outline: none;
    font-size: 1rem;
    font-family: inherit;
    color: var(--text-primary);
    background: transparent;
    min-width: 0;
}

.input-group input::placeholder {
    color: var(--text-muted);
}

.toggle-password {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    transition: color 0.2s;
    flex-shrink: 0;
}

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

/* Field Error */
.field-error {
    color: var(--danger-color);
    font-size: 0.8rem;
    margin-top: 0.375rem;
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

/* Checkbox */
.form-check {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.form-check input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--accent-primary);
    cursor: pointer;
    margin-top: 2px;
    flex-shrink: 0;
}

.form-check label {
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 0.95rem;
    line-height: 1.5;
}

.form-check label a {
    color: var(--accent-primary);
    text-decoration: none;
    font-weight: 500;
}

.form-check label a:hover {
    text-decoration: underline;
}

/* Submit Button */
.btn-submit {
    width: 100%;
    padding: 1rem;
    background: var(--gradient-accent);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    box-shadow: 0 4px 12px rgba(14, 165, 233, 0.3);
}

.btn-submit:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(14, 165, 233, 0.4);
}

.btn-submit:active:not(:disabled) {
    transform: translateY(0);
}

.btn-submit:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

/* Spinner */
.spinner {
    animation: spin 0.8s linear infinite;
}

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

/* Form Links */
.form-links {
    text-align: center;
    margin-top: 1.5rem;
}

.form-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
}

.form-links a:hover {
    color: var(--accent-primary);
}

/* Divider */
.divider {
    display: flex;
    align-items: center;
    margin: 1.5rem 0;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-color);
}

.divider span {
    padding: 0 1rem;
}

/* Register/Login Link */
.auth-switch {
    text-align: center;
    margin-top: 1.25rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--border-color);
}

.auth-switch p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin: 0;
}

.auth-switch a {
    color: var(--accent-primary);
    font-weight: 600;
    text-decoration: none;
}

.auth-switch a:hover {
    text-decoration: underline;
}

/* Card Footer */
.auth-footer {
    background: var(--bg-color);
    padding: 1rem 1.5rem;
    text-align: center;
    border-top: 1px solid var(--border-color);
}

.auth-footer p {
    color: var(--text-muted);
    font-size: 0.8rem;
    margin: 0;
}

.auth-footer a {
    color: var(--text-muted);
    text-decoration: none;
    margin: 0 0.5rem;
    transition: color 0.2s;
}

.auth-footer a:hover {
    color: var(--accent-primary);
}

/* Disclaimer Banner */
.disclaimer-banner {
    margin-top: 1.5rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.8rem;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    backdrop-filter: blur(4px);
}

/* Password Strength */
.password-strength {
    margin-top: 0.5rem;
}

.strength-bar {
    height: 4px;
    background: var(--border-color);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 0.375rem;
}

.strength-bar-fill {
    height: 100%;
    border-radius: 2px;
    transition: all 0.3s ease;
    width: 0;
}

.strength-bar-fill.weak { width: 33%; background: var(--danger-color); }
.strength-bar-fill.medium { width: 66%; background: var(--warning-color); }
.strength-bar-fill.strong { width: 100%; background: var(--success-color); }

.strength-text {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.strength-text.weak { color: var(--danger-color); }
.strength-text.medium { color: var(--warning-color); }
.strength-text.strong { color: var(--success-color); }

/* Back to Home */
.back-link {
    position: absolute;
    top: 1.5rem;
    left: 1.5rem;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    transition: color 0.2s;
    z-index: 10;
}

.back-link:hover {
    color: white;
}

/* Responsive */
@media (max-width: 480px) {
    body {
        padding: 1rem;
    }
    
    .auth-header {
        padding: 2rem 1.5rem;
    }
    
    .auth-body {
        padding: 1.5rem;
    }
    
    .auth-logo {
        width: 70px;
        height: 70px;
    }
    
    .auth-header h2 {
        font-size: 1.5rem;
    }
    
    .back-link {
        position: static;
        margin-bottom: 1rem;
        justify-content: center;
    }
}
