/**
 * Songlingo Portal - Authentication Pages Styles
 * Dark theme with music-inspired design
 */

/* ============================================
   Auth Container Layout
   ============================================ */
.auth-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.auth-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-xl) var(--space-lg);
    position: relative;
    overflow: hidden;
    background: var(--bg-primary);
}

/* Animated gradient background */
.auth-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(ellipse at 30% 20%, rgba(147, 51, 234, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse at 70% 80%, rgba(99, 102, 241, 0.1) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 50%, rgba(249, 115, 22, 0.05) 0%, transparent 40%);
    pointer-events: none;
    animation: gradientShift 15s ease-in-out infinite;
}

@keyframes gradientShift {
    0%, 100% { transform: scale(1) rotate(0deg); }
    50% { transform: scale(1.1) rotate(5deg); }
}

/* Floating music notes decoration */
.auth-container::after {
    content: '🎵';
    position: absolute;
    top: 15%;
    right: 15%;
    font-size: 4rem;
    opacity: 0.05;
    animation: float 4s ease-in-out infinite;
    pointer-events: none;
}

/* ============================================
   Auth Card
   ============================================ */
.auth-card {
    width: 100%;
    max-width: 440px;
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    padding: var(--space-2xl);
    position: relative;
    z-index: 1;
    animation: fadeInUp 0.6s ease;
    border: 1px solid var(--border-primary);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

/* Glowing border effect on focus */
.auth-card::before {
    content: '';
    position: absolute;
    top: -1px;
    left: -1px;
    right: -1px;
    bottom: -1px;
    background: linear-gradient(135deg, rgba(147, 51, 234, 0.5), rgba(99, 102, 241, 0.3), rgba(249, 115, 22, 0.2));
    border-radius: inherit;
    z-index: -1;
    opacity: 0;
    transition: opacity var(--transition-base);
}

.auth-card:focus-within::before {
    opacity: 1;
}

.auth-card:focus-within {
    box-shadow: var(--shadow-glow);
}

/* ============================================
   Auth Header
   ============================================ */
.auth-header {
    text-align: center;
    margin-bottom: var(--space-xl);
}

.auth-logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: auto;
    height: auto;
    background: transparent;
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-lg);
    padding: var(--space-md);
}

.auth-logo-img {
    height: 60px;
    width: auto;
    object-fit: contain;
}

.auth-logo span {
    font-size: 2.5rem;
}

.auth-header h1 {
    font-size: 1.75rem;
    margin-bottom: var(--space-sm);
    color: var(--text-primary);
}

.auth-header p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.5;
}

.auth-header strong {
    color: var(--primary-light);
    font-weight: 600;
}

/* ============================================
   Auth Form
   ============================================ */
.auth-form {
    margin-bottom: var(--space-lg);
}

.auth-form .form-label {
    color: var(--text-secondary);
}

.auth-form .form-input {
    height: 56px;
    font-size: 1.05rem;
    background: var(--bg-tertiary);
    border: 2px solid var(--border-primary);
    color: var(--text-primary);
}

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

.auth-form .form-input:focus {
    background: var(--bg-elevated);
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-glow);
}

.auth-form .form-help {
    color: var(--text-muted);
}

/* Auth Button */
.btn-auth {
    width: 100%;
    height: 56px;
    font-size: 1rem;
    font-weight: 600;
    border-radius: var(--radius-md);
    position: relative;
    overflow: hidden;
}

.btn-auth .spinner {
    display: none;
    width: 22px;
    height: 22px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: var(--text-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.btn-auth.loading .spinner {
    display: block;
}

.btn-auth.loading .btn-text {
    margin-left: var(--space-sm);
}

/* ============================================
   OTP Input Section
   ============================================ */
.otp-container {
    margin-bottom: var(--space-xl);
}

.otp-inputs {
    display: flex;
    justify-content: center;
    gap: var(--space-sm);
    margin-bottom: var(--space-lg);
}

.otp-input {
    width: 52px;
    height: 68px;
    font-family: var(--font-display);
    font-size: 1.75rem;
    font-weight: 700;
    text-align: center;
    color: var(--text-primary);
    background: var(--bg-tertiary);
    border: 2px solid var(--border-primary);
    border-radius: var(--radius-md);
    outline: none;
    transition: all var(--transition-fast);
    caret-color: var(--primary);
}

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

.otp-input:focus {
    border-color: var(--primary);
    background: var(--bg-elevated);
    box-shadow: 0 0 0 4px var(--primary-glow);
    transform: scale(1.05);
}

.otp-input.filled {
    border-color: var(--primary);
    background: var(--bg-elevated);
    color: var(--primary-light);
}

.otp-input.error {
    border-color: var(--error);
    box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.15);
    animation: shake 0.5s ease;
}

.otp-input.success {
    border-color: var(--success);
    color: var(--success);
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-5px); }
    40%, 80% { transform: translateX(5px); }
}

/* OTP Timer */
.otp-timer {
    text-align: center;
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.otp-timer.warning {
    color: var(--warning);
}

.otp-timer.expired {
    color: var(--error);
}

.otp-timer .time {
    font-family: var(--font-mono);
    font-weight: 700;
    color: var(--primary-light);
    font-size: 1rem;
}

.otp-timer.warning .time {
    color: var(--warning);
}

.otp-timer.expired .time {
    color: var(--error);
}

/* ============================================
   Resend Section
   ============================================ */
.resend-section {
    text-align: center;
    padding: var(--space-lg) 0;
    border-top: 1px solid var(--border-primary);
}

.resend-text {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: var(--space-sm);
}

.btn-resend {
    background: transparent;
    border: none;
    color: var(--primary-light);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}

.btn-resend:hover:not(:disabled) {
    background: rgba(147, 51, 234, 0.1);
}

.btn-resend:disabled {
    color: var(--text-muted);
    cursor: not-allowed;
}

/* ============================================
   Auth Links
   ============================================ */
.auth-links {
    text-align: center;
    padding-top: var(--space-lg);
}

.auth-links p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.auth-link {
    color: var(--primary-light);
    font-weight: 600;
    text-decoration: none;
    transition: all var(--transition-fast);
}

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

/* ============================================
   Auth Divider
   ============================================ */
.auth-divider {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    margin: var(--space-xl) 0;
    color: var(--text-muted);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

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

/* ============================================
   Success State
   ============================================ */
.auth-success {
    text-align: center;
    padding: var(--space-xl) 0;
}

.success-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto var(--space-lg);
    background: rgba(29, 185, 84, 0.15);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    animation: scaleIn 0.5s var(--transition-spring);
    border: 2px solid rgba(29, 185, 84, 0.3);
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.5);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.auth-success h2 {
    font-size: 1.5rem;
    margin-bottom: var(--space-sm);
    color: var(--text-primary);
}

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

/* ============================================
   Responsive Styles
   ============================================ */
@media (max-width: 480px) {
    .auth-card {
        padding: var(--space-xl) var(--space-lg);
        border-radius: var(--radius-lg);
        margin: var(--space-md);
    }
    
    .auth-logo-img {
        height: 50px;
    }
    
    .auth-header h1 {
        font-size: 1.5rem;
    }
    
    .otp-input {
        width: 44px;
        height: 58px;
        font-size: 1.5rem;
    }
    
    .otp-inputs {
        gap: 6px;
    }
}

@media (max-width: 360px) {
    .otp-input {
        width: 40px;
        height: 52px;
        font-size: 1.25rem;
    }
    
    .otp-inputs {
        gap: 4px;
    }
}
