/* Authentication Styles - Yodlee Design System */
/* Consistent with existing styles.css design patterns */

/* =============================================================================
 * AUTH PAGE LAYOUT
 * ============================================================================= */

.auth-body {
    background: linear-gradient(135deg, var(--yodlee-bg-main) 0%, #E8E8F0 100%);
    min-height: 100vh;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    position: relative;
    overflow-x: hidden;
    overflow-y: auto;
    padding: 2rem 0;
    font-family: 'Aptos Narrow', 'Aptos', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.auth-container {
    width: 100%;
    max-width: 420px;
    padding: 2rem;
    position: relative;
    z-index: 10;
    animation: fadeInUp 0.6s ease-out;
}

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

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

.auth-logo {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--yodlee-primary) 0%, var(--yodlee-primary-dark) 100%);
    border-radius: var(--yodlee-radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    box-shadow: var(--yodlee-shadow-lg);
}

.auth-logo i {
    font-size: 1.8rem;
    color: white;
}

.auth-title {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--yodlee-text-primary);
    margin-bottom: 0.5rem;
    letter-spacing: -0.02em;
}

.auth-subtitle {
    font-size: 0.95rem;
    color: var(--yodlee-text-secondary);
    font-weight: 400;
}

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

.auth-card {
    background: var(--yodlee-bg-card);
    border-radius: var(--yodlee-radius-lg);
    box-shadow: var(--yodlee-shadow-lg);
    border: 1px solid var(--yodlee-border-light);
    overflow: hidden;
    position: relative;
}

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

/* =============================================================================
 * FLASH MESSAGES
 * ============================================================================= */

.flash-messages {
    padding: 1rem;
    border-bottom: 1px solid var(--yodlee-border-light);
}

.flash-message {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    border-radius: var(--yodlee-radius-sm);
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    position: relative;
    animation: slideIn 0.3s ease-out;
}

.flash-message:last-child {
    margin-bottom: 0;
}

.flash-message i {
    margin-right: 0.75rem;
    font-size: 1rem;
}

.flash-success {
    background: #E8F5E8;
    border: 1px solid #C3E6C3;
    color: #2D5A2D;
}

.flash-error {
    background: #FDF2F2;
    border: 1px solid #FECACA;
    color: #7F1D1D;
}

.flash-info {
    background: #EFF6FF;
    border: 1px solid #BFDBFE;
    color: #1E3A8A;
}

.flash-warning {
    background: #FFFBEB;
    border: 1px solid #FDE68A;
    color: #92400E;
}

.flash-close {
    background: none;
    border: none;
    color: inherit;
    cursor: pointer;
    margin-left: auto;
    padding: 0.25rem;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.flash-close:hover {
    opacity: 1;
}

/* =============================================================================
 * RATE LIMIT NOTICE
 * ============================================================================= */

.rate-limit-notice {
    padding: 1rem;
    background: #FFF7ED;
    border: 1px solid #FDBA74;
    border-radius: var(--yodlee-radius-sm);
    margin: 1rem;
    text-align: center;
    color: #9A3412;
}

.rate-limit-notice i {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
    display: block;
}

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

.auth-form {
    padding: 2rem;
}

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

.form-header h2 {
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--yodlee-text-primary);
    margin-bottom: 0.5rem;
}

.form-header p {
    font-size: 0.9rem;
    color: var(--yodlee-text-secondary);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: flex;
    align-items: center;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--yodlee-text-primary);
    margin-bottom: 0.5rem;
}

.form-label i {
    margin-right: 0.5rem;
    color: var(--yodlee-text-secondary);
    width: 16px;
    text-align: center;
}

.form-input {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 2px solid var(--yodlee-border);
    border-radius: var(--yodlee-radius-sm);
    font-size: 0.95rem;
    transition: all 0.2s ease;
    background: white;
    color: var(--yodlee-text-primary);
}

.form-input:focus {
    outline: none;
    border-color: var(--yodlee-primary);
    box-shadow: 0 0 0 3px rgba(91, 93, 140, 0.1);
}

.form-input::placeholder {
    color: var(--yodlee-text-tertiary);
}

/* Password Field */
.password-field {
    position: relative;
}

.password-toggle {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--yodlee-text-secondary);
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 4px;
    transition: color 0.2s;
}

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

/* =============================================================================
 * AUTH BUTTONS
 * ============================================================================= */

.auth-button {
    width: 100%;
    padding: 0.875rem 1.5rem;
    border: none;
    border-radius: var(--yodlee-radius-sm);
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    position: relative;
    overflow: hidden;
}

.auth-button i {
    margin-right: 0.5rem;
}

.auth-button:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.auth-button-primary {
    background: linear-gradient(135deg, var(--yodlee-primary) 0%, var(--yodlee-primary-dark) 100%);
    color: white;
    box-shadow: var(--yodlee-shadow-sm);
    margin-bottom: 1.5rem;
}

.auth-button-primary:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: var(--yodlee-shadow-md);
}

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

.auth-button-secondary {
    background: white;
    color: var(--yodlee-primary);
    border: 2px solid var(--yodlee-border);
}

.auth-button-secondary:hover {
    border-color: var(--yodlee-primary);
    background: #FAFAFA;
}

/* =============================================================================
 * AUTH DIVIDER
 * ============================================================================= */

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

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

.auth-divider span {
    background: white;
    color: var(--yodlee-text-tertiary);
    font-size: 0.85rem;
    padding: 0 1rem;
    position: relative;
    z-index: 1;
}

/* =============================================================================
 * AUTH ALTERNATIVES
 * ============================================================================= */

.auth-alternatives {
    padding: 0 2rem 2rem;
}

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

.auth-footer {
    text-align: center;
    margin-top: 2rem;
    padding-top: 1rem;
    color: var(--yodlee-text-tertiary);
    font-size: 0.8rem;
}

.auth-footer-links {
    margin-top: 0.5rem;
}

.auth-footer-links a {
    color: var(--yodlee-text-secondary);
    text-decoration: none;
    margin: 0 0.75rem;
    transition: color 0.2s;
}

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

/* =============================================================================
 * BACKGROUND ELEMENTS
 * ============================================================================= */

.auth-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.auth-bg-circle {
    position: absolute;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(91, 93, 140, 0.08) 0%, rgba(124, 127, 168, 0.04) 100%);
    animation: float 6s ease-in-out infinite;
}

.auth-bg-circle-1 {
    width: 300px;
    height: 300px;
    top: -150px;
    left: -150px;
    animation-delay: 0s;
}

.auth-bg-circle-2 {
    width: 200px;
    height: 200px;
    bottom: -100px;
    right: -100px;
    animation-delay: 2s;
}

.auth-bg-circle-3 {
    width: 150px;
    height: 150px;
    top: 20%;
    left: -75px;
    animation-delay: 4s;
}

/* =============================================================================
 * ANIMATIONS
 * ============================================================================= */

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

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px) rotate(0deg);
    }
    50% {
        transform: translateY(-20px) rotate(5deg);
    }
}

/* =============================================================================
 * RESPONSIVE DESIGN
 * ============================================================================= */

@media (max-width: 480px) {
    .auth-container {
        padding: 1rem;
        max-width: 100%;
    }
    
    .auth-form {
        padding: 1.5rem;
    }
    
    .auth-alternatives {
        padding: 0 1.5rem 1.5rem;
    }
    
    .auth-title {
        font-size: 1.5rem;
    }
    
    .auth-logo {
        width: 50px;
        height: 50px;
    }
    
    .auth-logo i {
        font-size: 1.5rem;
    }
    
    .auth-bg-circle-1,
    .auth-bg-circle-2,
    .auth-bg-circle-3 {
        display: none;
    }
}

@media (max-width: 360px) {
    .auth-container {
        padding: 0.5rem;
    }
    
    .auth-form {
        padding: 1rem;
    }
    
    .auth-alternatives {
        padding: 0 1rem 1rem;
    }
}

/* =============================================================================
 * LOADING STATES
 * ============================================================================= */

.auth-button .fa-spinner {
    animation: spin 1s linear infinite;
}

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

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

@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus indicators for keyboard navigation */
.auth-button:focus,
.form-input:focus,
.password-toggle:focus {
    outline: 2px solid var(--yodlee-primary);
    outline-offset: 2px;
}

/* High contrast support */
@media (prefers-contrast: high) {
    .auth-card {
        border: 2px solid var(--yodlee-text-primary);
    }
    
    .form-input {
        border-width: 2px;
    }
}

/* =============================================================================
 * PRINT STYLES
 * ============================================================================= */

@media print {
    .auth-background,
    .auth-bg-circle {
        display: none !important;
    }
    
    .auth-body {
        background: white !important;
    }
    
    .auth-card {
        box-shadow: none !important;
        border: 1px solid #000 !important;
    }
}