/* ========================================
   AUTHENTICATION PAGES BUNDLE
   Styles specific to login, register, etc.
   ======================================== */

/* Import Main Bundle */
@import url('./main.css');

/* ========================================
   AUTHENTICATION LAYOUT
   ======================================== */

.auth-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: transparent;
    position: relative;
}

.auth-page::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: transparent;
    pointer-events: none;
    z-index: 0;
}

.auth-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-6);
    position: relative;
    z-index: 1;
}

.auth-card-wrapper {
    width: 100%;
    max-width: 480px;
    margin: 0 auto;
}

.auth-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-2xl);
    box-shadow: var(--shadow-2xl);
    padding: var(--space-8);
    position: relative;
    backdrop-filter: blur(10px);
}

[data-theme="dark"] .auth-card {
    box-shadow: var(--shadow-2xl);
}

/* ========================================
   AUTHENTICATION HEADER
   ======================================== */

.auth-header {
    text-align: center;
    justify-items: anchor-center;
    margin-bottom: var(--space-8);
}

.auth-title {
    font-size: var(--font-size-3xl);
    font-weight: var(--font-weight-bold);
    color: var(--text-primary);
    margin-bottom: var(--space-3);
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.auth-subtitle {
    font-size: var(--font-size-base);
    color: var(--text-secondary);
    margin: 0;
    line-height: var(--line-height-relaxed);
}

/* ========================================
   AUTHENTICATION FORM
   ======================================== */

.auth-form {
    margin-bottom: var(--space-6);
}

.auth-form .form-group {
    margin-bottom: var(--space-6);
}

.auth-form .form-control {
    padding: var(--space-4);
    font-size: var(--font-size-base);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    transition: all var(--transition-fast);
    background-color: var(--input-bg);
}

.auth-form .form-control:focus {
    border-color: var(--primary-color);
    box-shadow: var(--input-focus-shadow);
    transform: translateY(-1px);
}

.auth-form .form-label {
    font-weight: var(--font-weight-semibold);
    color: var(--text-primary);
    margin-bottom: var(--space-3);
}

/* ========================================
   OAUTH BUTTONS
   ======================================== */

.auth-options {
    margin-bottom: var(--space-6);
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.auth-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-3);
    width: 100%;
    padding: var(--space-4) var(--space-6);
    background: var(--white);
    color: var(--gray-700);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    text-decoration: none;
    font-weight: var(--font-weight-medium);
    font-size: var(--font-size-base);
    transition: all var(--transition-fast);
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
}

.auth-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, var(--white-overlay), transparent);
    transition: left 0.5s;
}

.auth-button:hover::before {
    left: 100%;
}

.auth-button:hover {
    background: var(--gray-50);
    border-color: var(--border-hover);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
    text-decoration: none;
    color: var(--gray-700);
}

.auth-button img {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

/* Dark theme OAuth buttons */
[data-theme="dark"] .auth-button {
    background: var(--gray-800);
    color: var(--gray-200);
    border-color: var(--gray-700);
}

[data-theme="dark"] .auth-button:hover {
    background: var(--gray-700);
    color: var(--gray-100);
}

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

.divider {
    position: relative;
    text-align: center;
    margin: var(--space-6) 0;
}

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

.divider span {
    background: var(--card-bg);
    padding: 0 var(--space-4);
    color: var(--text-tertiary);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    position: relative;
    z-index: 1;
}

/* ========================================
   AUTHENTICATION FOOTER
   ======================================== */

.auth-footer {
    text-align: center;
    margin-top: var(--space-6);
}

.auth-links {
    margin-bottom: var(--space-4);
}

.auth-link {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    color: var(--primary-color);
    text-decoration: none;
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    padding: var(--space-2) var(--space-3);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.auth-link:hover {
    color: var(--primary-hover);
    background-color: var(--primary-light);
    text-decoration: none;
    transform: translateY(-1px);
}

.auth-switch {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    flex-wrap: wrap;
}

.auth-switch-text {
    color: var(--text-secondary);
    font-size: var(--font-size-sm);
}

.register-link,
.login-link {
    font-weight: var(--font-weight-semibold);
}

/* ========================================
   ERROR & SUCCESS MESSAGES
   ======================================== */

.error-message,
.success-message,
.info-message {
    padding: var(--space-4);
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-6);
    display: flex;
    align-items: center;
    gap: var(--space-3);
    font-size: var(--font-size-sm);
    line-height: var(--line-height-normal);
    position: relative;
}

.error-message {
    background-color: var(--error-light);
    border: 1px solid var(--error);
    color: var(--error-dark);
}

.success-message {
    background-color: var(--success-light);
    border: 1px solid var(--success);
    color: var(--success-dark);
}

.info-message {
    background-color: var(--info-light);
    border: 1px solid var(--info);
    color: var(--info-dark);
}

/* Message Content Layout */
.error-content,
.success-content,
.info-content {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    flex: 1;
}

.error-content .error-icon,
.success-content .success-icon,
.info-content .info-icon {
    font-size: var(--font-size-base);
    flex-shrink: 0;
}

/* Dismiss Button Styling */
.error-dismiss,
.success-dismiss,
.info-dismiss {
    background: none;
    border: none;
    color: inherit;
    cursor: pointer;
    padding: var(--space-1);
    border-radius: var(--radius-sm);
    opacity: 0.7;
    transition: opacity var(--transition-fast);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
}

.error-dismiss:hover,
.success-dismiss:hover,
.info-dismiss:hover {
    opacity: 1;
    background-color: rgba(255, 255, 255, 0.1);
}

.error-dismiss i,
.success-dismiss i,
.info-dismiss i {
    font-size: var(--font-size-sm);
}

/* Legacy support for old icon structure */
.error-message i,
.success-message i,
.info-message i {
    font-size: var(--font-size-base);
    flex-shrink: 0;
}

/* ========================================
   PASSWORD STRENGTH (Auth-specific)
   ======================================== */

.password-strength {
    margin-top: var(--space-3);
    padding: var(--space-4);
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.strength-meter {
    height: 6px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-full);
    overflow: hidden;
    margin-bottom: var(--space-3);
}

.strength-fill {
    height: 100%;
    border-radius: var(--radius-full);
    transition: all var(--transition-slow);
    position: relative;
}

.strength-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, var(--white-overlay), transparent);
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

.strength-text {
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    color: var(--text-primary);
    margin-bottom: var(--space-3);
}

.strength-requirements {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-2);
}

.requirement {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: var(--font-size-xs);
    color: var(--text-tertiary);
    transition: color var(--transition-fast);
}

.requirement.met {
    color: var(--success);
}

.requirement-icon {
    width: 12px;
    height: 12px;
    border-radius: var(--radius-full);
    background: var(--border-color);
    transition: all var(--transition-fast);
    position: relative;
}

.requirement.met .requirement-icon {
    background: var(--success);
}

.requirement.met .requirement-icon::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: var(--white);
    font-size: 8px;
    font-weight: bold;
}

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

@media (max-width: 768px) {
    .auth-container {
        padding: var(--space-4);
    }
    
    .auth-card {
        padding: var(--space-6);
        border-radius: var(--radius-xl);
    }
    
    .auth-title {
        font-size: var(--font-size-2xl);
    }
    
    .auth-button {
        padding: var(--space-4);
        font-size: var(--font-size-sm);
    }
    
    .strength-requirements {
        grid-template-columns: 1fr;
        gap: var(--space-3);
    }
    
    .auth-switch {
        flex-direction: column;
        gap: var(--space-3);
    }
}

@media (max-width: 480px) {
    .auth-container {
        padding: var(--space-3);
    }
    
    .auth-card {
        padding: var(--space-4);
    }
    
    .auth-title {
        font-size: var(--font-size-xl);
    }
    
    .auth-subtitle {
        font-size: var(--font-size-sm);
    }
    
    .auth-form .form-control {
        font-size: 16px; /* Prevent zoom on iOS */
    }
}

/* ========================================
   HIGH CONTRAST & ACCESSIBILITY
   ======================================== */

@media (prefers-contrast: high) {
    .auth-card {
        border-width: 2px;
    }
    
    .auth-button {
        border-width: 2px;
    }
    
    .error-message,
    .success-message,
    .info-message {
        border-width: 2px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .auth-button::before {
        animation: none;
    }
    
    .strength-fill::after {
        animation: none;
    }
    
    .auth-button:hover,
    .auth-link:hover {
        transform: none;
    }
}