/* Auth Modal - Mobile-First Responsive Design */

.auth-overlay {
    position: fixed;
    inset: 0;
    background: rgba(17, 24, 39, 0.55);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 16px;
    backdrop-filter: blur(4px);
}

.auth-overlay.is-open { 
    display: flex; 
}

.auth-modal {
    width: 100%;
    max-width: 480px;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
}

/* Prevent background scroll when modal is open */
html.auth-locked, 
body.auth-locked { 
    overflow: hidden !important; 
}

.auth-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px 16px 24px;
    border-bottom: 1px solid #e5e7eb;
    background: #f9fafb;
    position: sticky;
    top: 0;
    z-index: 10;
}

.auth-title {
    margin: 0;
    font-size: 22px;
    font-weight: 700;
    color: #111827;
}

.auth-close {
    border: 0;
    background: transparent;
    cursor: pointer;
    color: #6b7280;
    padding: 8px;
    border-radius: 50%;
    transition: all 0.2s ease;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.auth-close:hover {
    background: #e5e7eb;
    color: #374151;
}

.auth-body {
    padding: 24px;
}

.auth-subtitle { 
    margin: 0 0 20px; 
    color: #374151; 
    font-size: 15px;
    line-height: 1.5;
}

.social-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    margin-bottom: 20px;
}

.social-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    height: 48px;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    background: #ffffff;
    color: #111827;
    font-weight: 600;
    cursor: pointer;
    font-size: 15px;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.social-btn:hover {
    background: #f9fafb;
    border-color: #d1d5db;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.social-btn:active {
    transform: translateY(0);
}

.social-btn img {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.divider {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 24px 0 20px;
    color: #6b7280;
    font-size: 14px;
}

.divider::before,
.divider::after {
    content: "";
    flex: 1 1 auto;
    height: 1px;
    background: #e5e7eb;
}

.auth-field {
    margin-bottom: 16px;
}

.auth-field label {
    display: block;
    font-size: 14px;
    color: #374151;
    margin-bottom: 8px;
    font-weight: 500;
}

.auth-input {
    width: 100%;
    height: 48px;
    border: 1px solid #d1d5db;
    border-radius: 12px;
    padding: 0 16px;
    font-size: 15px;
    transition: all 0.2s ease;
    background: #ffffff;
}

.auth-input:focus { 
    outline: none; 
    border-color: #2563eb; 
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15); 
}

.auth-input:invalid {
    border-color: #ef4444;
}

.auth-actions { 
    margin-top: 20px; 
}

.auth-primary {
    width: 100%;
    height: 48px;
    background: #2563eb;
    color: #ffffff;
    border: 0;
    border-radius: 12px;
    font-weight: 700;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.2s ease;
}

.auth-primary:hover {
    background: #1d4ed8;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

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

.auth-primary:disabled { 
    opacity: .6; 
    cursor: not-allowed; 
    transform: none;
    box-shadow: none;
}

.auth-muted-link { 
    color: #2563eb; 
    font-size: 14px; 
    text-decoration: none; 
    font-weight: 500;
}

.auth-muted-link:hover {
    text-decoration: underline;
}

.auth-row-between { 
    display: flex; 
    align-items: center; 
    justify-content: space-between; 
    margin-bottom: 8px;
}

.auth-alt { 
    margin-top: 20px; 
    text-align: center; 
    color: #4b5563; 
    font-size: 14px; 
    line-height: 1.5;
}

.auth-alt a { 
    color: #2563eb; 
    text-decoration: none; 
    font-weight: 600; 
}

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

.auth-error { 
    background: #fee2e2; 
    color: #991b1b; 
    border: 1px solid #fecaca; 
    padding: 12px 16px; 
    border-radius: 12px; 
    margin-bottom: 16px; 
    display: none; 
    font-size: 14px;
    line-height: 1.5;
}

.auth-success { 
    background: #ecfdf5; 
    color: #065f46; 
    border: 1px solid #a7f3d0; 
    padding: 12px 16px; 
    border-radius: 12px; 
    margin-bottom: 16px; 
    display: none; 
    font-size: 14px;
    line-height: 1.5;
}

.auth-hidden { 
    display: none; 
}

/* Mobile Responsive Breakpoints */
@media (max-width: 480px) {
    .auth-overlay {
        padding: 12px;
        align-items: flex-end;
    }
    
    .auth-modal {
        max-width: 100%;
        border-radius: 20px 20px 0 0;
        max-height: 85vh;
        margin-bottom: 0;
    }
    
    .auth-header {
        padding: 16px 20px 12px 20px;
    }
    
    .auth-title {
        font-size: 20px;
    }
    
    .auth-body {
        padding: 20px;
    }
    
    .auth-subtitle {
        font-size: 14px;
        margin-bottom: 16px;
    }
    
    .social-btn {
        height: 44px;
        font-size: 14px;
        border-radius: 10px;
    }
    
    .social-btn img {
        width: 18px;
        height: 18px;
    }
    
    .auth-input {
        height: 44px;
        font-size: 14px;
        border-radius: 10px;
    }
    
    .auth-primary {
        height: 44px;
        font-size: 15px;
        border-radius: 10px;
    }
    
    .divider {
        margin: 20px 0 16px;
        font-size: 13px;
    }
}

@media (max-width: 360px) {
    .auth-overlay {
        padding: 8px;
    }
    
    .auth-header {
        padding: 14px 16px 10px 16px;
    }
    
    .auth-title {
        font-size: 18px;
    }
    
    .auth-body {
        padding: 16px;
    }
    
    .auth-subtitle {
        font-size: 13px;
        margin-bottom: 14px;
    }
    
    .social-btn {
        height: 40px;
        font-size: 13px;
        gap: 8px;
    }
    
    .auth-input {
        height: 40px;
        font-size: 13px;
        padding: 0 12px;
    }
    
    .auth-primary {
        height: 40px;
        font-size: 14px;
    }
    
    .auth-field {
        margin-bottom: 14px;
    }
    
    .auth-field label {
        font-size: 13px;
        margin-bottom: 6px;
    }
}

/* Tablet and larger screens */
@media (min-width: 768px) {
    .auth-modal {
        max-width: 520px;
    }
    
    .social-row {
        grid-template-columns: 1fr 1fr 1fr;
        gap: 16px;
    }
    
    .social-btn {
        height: 52px;
        font-size: 16px;
    }
    
    .social-btn img {
        width: 22px;
        height: 22px;
    }
}

/* Large screens */
@media (min-width: 1024px) {
    .auth-modal {
        max-width: 560px;
    }
    
    .auth-body {
        padding: 28px;
    }
    
    .auth-header {
        padding: 24px 28px 20px 28px;
    }
}

/* Focus states for accessibility */
.auth-input:focus,
.auth-primary:focus,
.social-btn:focus,
.auth-close:focus {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .auth-modal {
        border: 2px solid #000000;
    }
    
    .auth-input {
        border-width: 2px;
    }
    
    .social-btn {
        border-width: 2px;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .auth-modal,
    .social-btn,
    .auth-primary {
        transition: none !important;
        transform: none !important;
    }
    
    .social-btn:hover,
    .auth-primary:hover {
        transform: none !important;
    }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
    .social-btn:hover,
    .auth-primary:hover {
        transform: none;
        box-shadow: none;
    }
    
    .auth-close:hover {
        background: transparent;
    }
}


