/**
 * 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;
}

/* Official brand SVG icons via inline data URI */
.luvaii-auth-modal__social-btn::before {
    content: '';
    width: 22px;
    height: 22px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    display: inline-block;
    flex-shrink: 0;
}

.luvaii-auth-modal__social-btn[data-provider="facebook"]::before {
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><circle cx='12' cy='12' r='12' fill='%231877F2'/><path fill='%23fff' d='M15.997 14.061h-2.504v8.951h-3.71v-8.951H8v-3.16h1.783V8.823c0-1.486.696-3.806 3.794-3.806l2.79.01v3.073h-2.022c-.331 0-.798.169-.798.886v2.222h2.83l-.38 3.453z'/></svg>");
}

.luvaii-auth-modal__social-btn[data-provider="google"]::before {
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path fill='%234285F4' d='M22.5 12.25c0-.78-.07-1.53-.2-2.25H12v4.26h5.92c-.26 1.37-1.04 2.53-2.21 3.31v2.76h3.57c2.08-1.92 3.22-4.74 3.22-8.08z'/><path fill='%2334A853' d='M12 23c2.97 0 5.46-.98 7.28-2.66l-3.57-2.77c-.99.66-2.25 1.06-3.71 1.06-2.86 0-5.29-1.93-6.16-4.53H2.18v2.85C3.99 20.53 7.7 23 12 23z'/><path fill='%23FBBC05' d='M5.84 14.09c-.22-.66-.35-1.36-.35-2.09s.13-1.43.35-2.09V7.07H2.18C1.43 8.55 1 10.22 1 12s.43 3.45 1.18 4.93l3.66-2.84z'/><path fill='%23EA4335' d='M12 5.38c1.62 0 3.06.56 4.21 1.64l3.15-3.15C17.45 2.09 14.97 1 12 1 7.7 1 3.99 3.47 2.18 7.07l3.66 2.84C6.71 7.31 9.14 5.38 12 5.38z'/></svg>");
}

.luvaii-auth-modal__social-btn[data-provider="zalo"]::before {
    background-image: url("../images/zalo-logo.webp");
}

/* 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;
}

/* Legacy header auth pill superseded by circular .luvaii-header-icon in functions.php (9/6/2026) */

/* 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;
}
