/* ========================================
   AUTH MODAL STYLES
======================================== */

/* Modal Overlay */
.auth-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    z-index: 9999;
    animation: fadeIn 0.3s ease;
}

.auth-modal-overlay.active {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

/* Modal Container */
.auth-modal {
    background: white;
    border-radius: 20px;
    width: 100%;
    max-width: 480px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease;
    position: relative;
}

/* Modal Header */
.auth-modal-header {
    padding: 30px 30px 20px;
    border-bottom: 1px solid #f0f0f0;
    position: relative;
}

.auth-modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: #f5f5f5;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.auth-modal-close:hover {
    background: #e0e0e0;
    transform: rotate(90deg);
}

.auth-modal-title {
    font-size: 28px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 8px 0;
}

.auth-modal-subtitle {
    color: #666;
    font-size: 14px;
    margin: 0;
}

/* Modal Tabs */
.auth-tabs {
    display: flex;
    gap: 8px;
    padding: 0 30px;
    margin-top: 20px;
}

.auth-tab {
    flex: 1;
    padding: 12px 20px;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    color: #999;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.auth-tab.active {
    color: #2f2f42;
    border-bottom-color: #2f2f42;
}

.auth-tab:hover {
    color: #2f2f42;
}

/* Modal Body */
.auth-modal-body {
    padding: 30px;
}

.auth-form {
    display: none;
}

.auth-form.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

/* Form Groups */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
}

.form-label .required {
    color: #e74c3c;
    margin-left: 2px;
}

.form-input-wrapper {
    position: relative;
}

.form-input {
    width: 100%;
    padding: 14px 16px;
    padding-left: 45px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 15px;
    transition: all 0.3s ease;
    font-family: inherit;
}

.form-input:focus {
    outline: none;
    border-color: #2f2f42;
    box-shadow: 0 0 0 4px rgba(47, 47, 66, 0.1);
}

.form-input.error {
    border-color: #e74c3c;
}

.form-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
    pointer-events: none;
}

.form-input:focus ~ .form-icon {
    color: #2f2f42;
}

/* Password input with toggle button needs extra padding */
.form-input-wrapper.has-password-toggle .form-input {
    padding-right: 50px;
}

/* Password Toggle */
.password-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10;
    pointer-events: auto;
}

.password-toggle:hover {
    color: #2f2f42;
    background: rgba(47, 47, 66, 0.1);
    border-radius: 6px;
}

.password-toggle:active {
    transform: translateY(-50%) scale(0.95);
}

.password-toggle svg {
    pointer-events: none;
}

/* Error Message */
.form-error {
    color: #e74c3c;
    font-size: 13px;
    margin-top: 6px;
    display: none;
}

.form-error.show {
    display: block;
    animation: shake 0.5s ease;
}

/* Remember Me & Forgot Password */
.form-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.checkbox-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
}

.checkbox-wrapper input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #2f2f42;
}

.checkbox-wrapper label {
    font-size: 14px;
    color: #666;
    cursor: pointer;
    user-select: none;
}

.forgot-link {
    font-size: 14px;
    color: #2f2f42;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}

.forgot-link:hover {
    color: #1a1a2e;
    text-decoration: underline;
}

/* Submit Button */
.btn-submit {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, #2f2f42 0%, #1a1a2e 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(47, 47, 66, 0.3);
}

.btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(47, 47, 66, 0.4);
}

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

.btn-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Divider */
.auth-divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 25px 0;
    color: #999;
    font-size: 14px;
}

.auth-divider::before,
.auth-divider::after {
    content: "";
    flex: 1;
    border-bottom: 1px solid #e0e0e0;
}

.auth-divider span {
    padding: 0 15px;
    font-weight: 500;
}

/* Social Login Buttons */
.social-login {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.btn-social {
    width: 100%;
    padding: 14px 20px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    background: white;
    color: #333;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    transition: all 0.3s ease;
}

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

.btn-social svg {
    width: 20px;
    height: 20px;
}

.btn-google {
    border-color: #db4437;
    color: #db4437;
}

.btn-google:hover {
    background: #db4437;
    color: white;
}

.btn-facebook {
    border-color: #4267b2;
    color: #4267b2;
}

.btn-facebook:hover {
    background: #4267b2;
    color: white;
}

/* Register Extra Fields */
.form-row-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

/* Alert Messages */
.alert {
    padding: 14px 16px;
    border-radius: 10px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    animation: slideDown 0.3s ease;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* Loading State */
.btn-loading {
    position: relative;
    pointer-events: none;
}

.btn-loading::after {
    content: "";
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin-left: -8px;
    margin-top: -8px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

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

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes shake {
    0%,
    100% {
        transform: translateX(0);
    }
    25% {
        transform: translateX(-10px);
    }
    75% {
        transform: translateX(10px);
    }
}

/* Responsive */
@media (max-width: 768px) {
    .auth-modal {
        margin: 0 10px;
        border-radius: 15px;
    }

    .auth-modal-header {
        padding: 25px 20px 15px;
    }

    .auth-modal-title {
        font-size: 24px;
    }

    .auth-tabs {
        padding: 0 20px;
    }

    .auth-modal-body {
        padding: 20px;
    }

    .form-row-2 {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .auth-modal {
        max-height: 100vh;
        border-radius: 0;
    }

    .auth-modal-header {
        padding: 20px 15px 15px;
    }

    .auth-modal-title {
        font-size: 22px;
    }

    .auth-tabs {
        padding: 0 15px;
    }

    .auth-modal-body {
        padding: 15px;
    }
}
