/* =====================================================
   AUTHENTICATION STYLES - Overlay, Forms, Responsive
   ===================================================== */

/* ===== AUTH OVERLAY ===== */
.auth-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 1;
    transition: opacity 0.3s ease;
    overflow-y: auto;
    padding: 20px;
}

.auth-overlay.hidden {
    display: none;
    opacity: 0;
}

.auth-container {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    width: 90%;
    max-width: 420px;
    padding: 40px;
    position: relative;
    animation: authSlideIn 0.4s ease-out;
    margin: auto;
    flex-shrink: 0;
}

@keyframes authSlideIn {
    from {
        opacity: 0;
        transform: translateY(-30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ===== AUTH HEADER ===== */
.auth-header {
    text-align: center;
    margin-bottom: 30px;
}

.auth-header h2 {
    color: white;
    font-size: 28px;
    margin-bottom: 8px;
    font-weight: 600;
}

.auth-header p {
    color: rgba(255, 255, 255, 0.8);
    font-size: 14px;
}

/* ===== AUTH TABS ===== */
.auth-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 25px;
    background: rgba(255, 255, 255, 0.15);
    padding: 0;
    border-radius: 10px;
    overflow: hidden;
}

.auth-tab {
    flex: 1;
    padding: 10px 8px;
    border: none;
    background: transparent;
    color: rgba(255, 255, 255, 0.7);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.25s ease;
    white-space: nowrap;
    line-height: 1.2;
}

.auth-tab:hover:not(.active) {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.95);
}

.auth-tab.active {
    background: white;
    color: #667eea;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* ===== AUTH FORMS ===== */
.auth-form {
    display: none;
}

.auth-form.active {
    display: block;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    color: white;
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 8px;
}

.form-group input {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.9);
    font-size: 15px;
    transition: all 0.3s;
    box-sizing: border-box;
}

.form-group input:focus {
    outline: none;
    border-color: white;
    background: white;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.2);
}

/* ===== PASSWORD STRENGTH ===== */
.password-strength {
    margin-top: 8px;
    font-size: 12px;
    display: none;
}

.password-strength.show {
    display: block;
}

.strength-bar {
    height: 4px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
    margin-bottom: 5px;
    overflow: hidden;
}

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

.strength-fill.weak {
    width: 33%;
    background: #ff4444;
}

.strength-fill.medium {
    width: 66%;
    background: #ffaa00;
}

.strength-fill.strong {
    width: 100%;
    background: #00C851;
}

.strength-text {
    color: white;
    font-weight: 500;
}

/* ===== AUTH MESSAGES ===== */
.error-message {
    background: rgba(255, 68, 68, 0.2);
    border: 1px solid rgba(255, 68, 68, 0.5);
    color: white;
    padding: 12px;
    border-radius: 10px;
    margin-bottom: 15px;
    font-size: 13px;
    display: none;
}

.error-message.show {
    display: block;
}

.success-message {
    background: rgba(0, 200, 81, 0.2);
    border: 1px solid rgba(0, 200, 81, 0.5);
    color: white;
    padding: 12px;
    border-radius: 10px;
    margin-bottom: 15px;
    font-size: 13px;
    display: none;
}

.success-message.show {
    display: block;
}

/* ===== AUTH BUTTON ===== */
.auth-button {
    width: 100%;
    padding: 15px;
    border: none;
    border-radius: 12px;
    background: white;
    color: #667eea;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    margin-bottom: 15px;
}

.auth-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

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

.auth-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* ===== AUTH DIVIDER ===== */
.auth-divider {
    text-align: center;
    color: rgba(255, 255, 255, 0.7);
    font-size: 13px;
    margin: 25px 0;
    position: relative;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 40%;
    height: 1px;
    background: rgba(255, 255, 255, 0.3);
}

.auth-divider::before {
    left: 0;
}

.auth-divider::after {
    right: 0;
}

/* ===== OAUTH ===== */
.oauth-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.oauth-button {
    width: 100%;
    padding: 14px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.oauth-button:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: white;
    transform: translateY(-2px);
}

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

/* ===== FORGOT PASSWORD ===== */
.forgot-password {
    text-align: center;
    margin-top: 15px;
}

.forgot-password a {
    color: white;
    font-size: 13px;
    text-decoration: none;
    opacity: 0.8;
    transition: opacity 0.3s;
}

.forgot-password a:hover {
    opacity: 1;
    text-decoration: underline;
}

/* ===== LOADING SPINNER ===== */
.auth-loading {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.8s linear infinite;
}

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

/* =====================================================
   AUTH RESPONSIVE — Card stays compact at all sizes
   ===================================================== */

/* --- Tablets --- */
@media (max-width: 768px) {
    .auth-container {
        padding: 32px;
    }

    .auth-header h2 {
        font-size: 26px;
    }
}

/* --- Small tablets / large phones --- */
@media (max-width: 600px) {
    .auth-overlay {
        padding: 16px;
    }

    .auth-container {
        padding: 28px 24px;
        max-width: 400px;
        border-radius: 16px;
    }

    .auth-header {
        margin-bottom: 22px;
    }

    .auth-header h2 {
        font-size: 22px;
        margin-bottom: 6px;
    }

    .auth-header p {
        font-size: 13px;
    }

    .auth-tabs {
        margin-bottom: 20px;
        padding: 3px;
    }

    .auth-tab {
        padding: 10px 6px;
        font-size: 13px;
    }

    .form-group {
        margin-bottom: 14px;
    }

    .form-group label {
        font-size: 12px;
        margin-bottom: 6px;
    }

    .form-group input {
        padding: 12px 14px;
        font-size: 16px;
        border-radius: 10px;
    }

    .auth-button {
        padding: 13px;
        font-size: 15px;
        border-radius: 10px;
        margin-bottom: 10px;
    }

    .auth-button:hover {
        transform: none;
        box-shadow: none;
    }

    .forgot-password {
        margin-top: 8px;
    }

    .forgot-password a {
        font-size: 13px;
        padding: 6px;
        display: inline-block;
    }

    .auth-divider {
        margin: 16px 0;
        font-size: 12px;
    }

    .oauth-button {
        padding: 12px;
        font-size: 14px;
        border-radius: 10px;
    }

    .oauth-button:hover {
        transform: none;
    }

    .error-message,
    .success-message {
        padding: 10px;
        font-size: 12px;
        border-radius: 8px;
    }

    .password-strength {
        font-size: 11px;
    }
}

/* --- Phones (< 420px) --- */
@media (max-width: 420px) {
    .auth-overlay {
        padding: 12px;
    }

    .auth-container {
        padding: 24px 20px;
        border-radius: 14px;
    }

    .auth-header {
        margin-bottom: 18px;
    }

    .auth-header h2 {
        font-size: 20px;
    }

    .auth-header p {
        font-size: 12px;
    }

    .auth-tab {
        padding: 9px 5px;
        font-size: 12px;
    }

    .form-group {
        margin-bottom: 12px;
    }

    .form-group label {
        font-size: 11px;
        margin-bottom: 4px;
    }

    .form-group input {
        padding: 11px 12px;
        font-size: 16px;
        border-radius: 8px;
    }

    .auth-button {
        padding: 12px;
        font-size: 14px;
        border-radius: 8px;
    }

    .auth-divider {
        margin: 12px 0;
        font-size: 11px;
    }

    .oauth-button {
        padding: 11px;
        font-size: 13px;
        border-radius: 8px;
    }
}

/* --- Very small phones (< 360px) --- */
@media (max-width: 360px) {
    .auth-overlay {
        padding: 8px;
    }

    .auth-container {
        padding: 20px 16px;
        border-radius: 12px;
    }

    .auth-header h2 {
        font-size: 18px;
    }

    .auth-tabs {
        margin-bottom: 14px;
    }

    .auth-tab {
        font-size: 11px;
        padding: 8px 4px;
    }

    .form-group input {
        padding: 10px;
    }

    .auth-button {
        padding: 10px;
        font-size: 13px;
    }

    .oauth-button {
        padding: 10px;
        font-size: 12px;
    }
}

/* --- Landscape phones --- */
@media (max-height: 500px) and (orientation: landscape) {
    .auth-overlay {
        padding: 8px;
        align-items: flex-start;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .auth-container {
        padding: 16px 20px;
        margin: 8px auto;
    }

    .auth-header {
        margin-bottom: 8px;
    }

    .auth-header h2 {
        font-size: 18px;
        margin-bottom: 2px;
    }

    .auth-header p {
        font-size: 11px;
    }

    .auth-tabs {
        margin-bottom: 8px;
    }

    .auth-tab {
        padding: 7px 5px;
        font-size: 12px;
    }

    .form-group {
        margin-bottom: 6px;
    }

    .form-group label {
        margin-bottom: 2px;
        font-size: 11px;
    }

    .form-group input {
        padding: 8px 10px;
        font-size: 14px;
    }

    .auth-button,
    .oauth-button {
        padding: 8px;
        font-size: 13px;
        margin-bottom: 4px;
    }

    .auth-divider {
        margin: 6px 0;
        font-size: 11px;
    }

    .forgot-password {
        margin-top: 4px;
    }
}
