/**
 * LuVaii Auth Modal - Phase 2 EP03
 * Login + Register popup modal
 */

/* Overlay */
.luvaii-auth-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.luvaii-auth-modal.is-open {
    display: flex;
}

body.luvaii-auth-modal-open {
    overflow: hidden;
}

/* Box */
.luvaii-auth-modal__box {
    background: #fff;
    border-radius: 8px;
    max-width: 480px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    padding: 32px;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: luvaii-modal-in 0.2s ease-out;
}

@keyframes luvaii-modal-in {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Close button */
.luvaii-auth-modal__close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: none;
    border: 0;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    color: #999;
    padding: 4px 8px;
}

.luvaii-auth-modal__close:hover {
    color: #1a1a1a;
}

/* Tabs */
.luvaii-auth-modal__tabs {
    display: flex;
    gap: 24px;
    border-bottom: 1px solid #e0e0e0;
    margin-bottom: 24px;
    padding-bottom: 0;
}

.luvaii-auth-modal__tab {
    background: none;
    border: 0;
    padding: 12px 0;
    cursor: pointer;
    font-size: 18px;
    font-weight: 500;
    color: #999;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    transition: color 0.2s, border-color 0.2s;
}

.luvaii-auth-modal__tab.is-active {
    color: #1a1a1a;
    border-bottom-color: #1a1a1a;
}

/* Forms */
.luvaii-auth-modal__form {
    display: none;
}

.luvaii-auth-modal__form.is-active {
    display: block;
}

/* Fields */
.luvaii-auth-modal__field {
    margin-bottom: 16px;
}

.luvaii-auth-modal__field label {
    display: block;
    margin-bottom: 6px;
    font-size: 14px;
    color: #333;
    font-weight: 500;
}

.luvaii-auth-modal__field input[type="text"],
.luvaii-auth-modal__field input[type="email"],
.luvaii-auth-modal__field input[type="password"] {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    box-sizing: border-box;
    font-family: inherit;
}

.luvaii-auth-modal__field input:focus {
    outline: none;
    border-color: #1a1a1a;
}

.luvaii-auth-modal__field .required {
    color: #c00;
}

.luvaii-auth-modal__checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 12px 0;
    font-size: 13px;
    color: #666;
    cursor: pointer;
}

.luvaii-auth-modal__checkbox input {
    margin: 0;
}

/* Submit button */
.luvaii-auth-modal__submit {
    width: 100%;
    padding: 14px;
    background: #1a1a1a;
    color: #fff;
    border: 0;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    margin-top: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: background 0.2s;
}

.luvaii-auth-modal__submit:hover {
    background: #333;
}

.luvaii-auth-modal__submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Divider */
.luvaii-auth-modal__divider {
    text-align: center;
    margin: 24px 0;
    position: relative;
    color: #999;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.luvaii-auth-modal__divider::before,
.luvaii-auth-modal__divider::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 35%;
    height: 1px;
    background: #e0e0e0;
}

.luvaii-auth-modal__divider::before {
    left: 0;
}

.luvaii-auth-modal__divider::after {
    right: 0;
}

/* Social buttons (placeholder for later epics) */
.luvaii-auth-modal__social {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
}

.luvaii-auth-modal__social-btn {
    padding: 12px 16px;
    border: 1px solid #ddd;
    background: #fff;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: border-color 0.2s, background 0.2s;
    text-decoration: none;
    color: #333;
}

.luvaii-auth-modal__social-btn:hover {
    border-color: #999;
    background: #f9f9f9;
}

.luvaii-auth-modal__social-btn[data-provider="facebook"]::before {
    content: 'f';
    background: #1877f2;
    color: #fff;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

.luvaii-auth-modal__social-btn[data-provider="google"]::before {
    content: 'G';
    background: #fff;
    color: #4285f4;
    width: 24px;
    height: 24px;
    border: 1px solid #ddd;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

.luvaii-auth-modal__social-btn[data-provider="zalo"]::before {
    content: 'Z';
    background: #0068ff;
    color: #fff;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

.luvaii-auth-modal__social-btn[data-provider="instagram"]::before {
    content: 'IG';
    background: linear-gradient(45deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888);
    color: #fff;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: bold;
}

/* Notice */
.luvaii-auth-modal__notice {
    padding: 12px 16px;
    border-radius: 4px;
    margin-bottom: 16px;
    font-size: 14px;
}

.luvaii-auth-modal__notice--error {
    background: #fff0f0;
    color: #c00;
    border: 1px solid #ffd0d0;
}

.luvaii-auth-modal__notice--success {
    background: #f0fff0;
    color: #060;
    border: 1px solid #d0ffd0;
}

/* Footer links */
.luvaii-auth-modal__footer {
    text-align: center;
    margin-top: 16px;
    font-size: 14px;
}

.luvaii-auth-modal__footer a {
    color: #1a1a1a;
    text-decoration: underline;
}

.luvaii-auth-modal__terms {
    margin: 16px 0;
    font-size: 13px;
    color: #666;
}

.luvaii-auth-modal__terms a {
    color: #1a1a1a;
    text-decoration: underline;
}

/* Mobile responsive */
@media (max-width: 600px) {
    .luvaii-auth-modal__box {
        padding: 24px 20px;
        max-width: 100%;
    }
    .luvaii-auth-modal__tab {
        font-size: 16px;
    }
}

/* Header trigger button */
.luvaii-auth-trigger {
    cursor: pointer;
}

/* Fixed position top-right for header auth trigger */
.luvaii-header-auth {
    position: fixed;
    top: 12px;
    right: 20px;
    z-index: 99998;
    background: rgba(255,255,255,0.95);
    padding: 6px 14px;
    border-radius: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    font-size: 13px;
    backdrop-filter: blur(8px);
}
.luvaii-header-auth a {
    color: #1a1a1a;
    text-decoration: none;
    font-weight: 500;
    padding: 2px 4px;
}
.luvaii-header-auth a:hover {
    color: #666;
}
.luvaii-header-auth--loggedin a:first-child {
    color: #1a1a1a;
}
@media (max-width: 768px) {
    .luvaii-header-auth {
        top: 8px;
        right: 10px;
        font-size: 12px;
        padding: 4px 10px;
    }
}

/* Forgot password state - hide tabs, hide forgot tab button always */
.luvaii-auth-modal__tab--forgot {
    display: none !important;
}
.luvaii-auth-modal.is-forgot .luvaii-auth-modal__tabs {
    display: none;
}
.luvaii-auth-modal.is-forgot .luvaii-auth-modal__box {
    /* Add top padding since tabs are hidden */
    padding-top: 48px;
}
.luvaii-auth-modal__heading {
    margin: 0 0 8px 0;
    font-size: 22px;
    font-weight: 600;
    color: #1a1a1a;
}
.luvaii-auth-modal__hint {
    margin: 0 0 20px 0;
    font-size: 14px;
    color: #666;
    line-height: 1.5;
}
