/**
 * Mahhalcom Auth Pages CSS
 * Golden/orange gradient design for Login & SignUp
 * Responsive, RTL/LTR
 */

/* ========== Reset old auth styles ========== */
.woocommerce-account .mh-auth-shell,
.woocommerce-account .mh-auth-layout,
.woocommerce-account .mh-auth-brand-panel,
.woocommerce-account .mh-auth-forms-panel,
.woocommerce-account .mh-auth-card--main {
    display: none !important;
}

/* Hide any "SETUP REQUIRED" badges from plugins */
.mh-auth-page .setup-required,
.mh-auth-page .woocommerce-apple-pay-login-button-setup-required,
.mh-auth-page [class*="setup-required"],
.mh-auth-page .apple-sign-in-setup-required {
    display: none !important;
}

/* Hide third-party social buttons injected by plugins - we have our own */
.mh-auth-page .woocommerce-form-login .googlesitekit-sign-in-with-google__frontend-output-button,
.mh-auth-page .woocommerce-form-login .wp-social-login-widget,
.mh-auth-page .woocommerce-form-register .googlesitekit-sign-in-with-google__frontend-output-button,
.mh-auth-page .woocommerce-form-register .wp-social-login-widget {
    display: none !important;
}

/* ========== Page Layout ========== */
.mh-auth-page {
    display: flex;
    min-height: 100vh;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    color: #333;
    overflow: hidden;
}
.mh-auth-page *,
.mh-auth-page *::before,
.mh-auth-page *::after {
    box-sizing: border-box;
}

/* ========== Left Brand Panel ========== */
.mh-auth-brand {
    flex: 0 0 45%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f5a623 0%, #e8930a 40%, #d4800a 70%, #c97008 100%);
    position: relative;
    overflow: hidden;
    padding: 40px;
}
.mh-auth-brand::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -30%;
    width: 160%;
    height: 160%;
    background: radial-gradient(ellipse at 30% 50%, rgba(255,255,255,0.15) 0%, transparent 60%);
    pointer-events: none;
}
.mh-auth-brand::after {
    content: '';
    position: absolute;
    bottom: -20%;
    right: -20%;
    width: 80%;
    height: 80%;
    background: radial-gradient(circle, rgba(255,200,50,0.2) 0%, transparent 70%);
    pointer-events: none;
}

.mh-auth-brand-content {
    position: relative;
    z-index: 2;
    text-align: center;
    color: #fff;
}

.mh-auth-logo-circle {
    width: 140px;
    height: 140px;
    margin: 0 auto 30px;
    border-radius: 50%;
    background: linear-gradient(145deg, rgba(255,255,255,0.3) 0%, rgba(255,255,255,0.1) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 20px 60px rgba(0,0,0,0.15), inset 0 0 30px rgba(255,255,255,0.1);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255,255,255,0.25);
    animation: mh-logo-pulse 3s ease-in-out infinite;
}
@keyframes mh-logo-pulse {
    0%, 100% { box-shadow: 0 20px 60px rgba(0,0,0,0.15), inset 0 0 30px rgba(255,255,255,0.1); }
    50% { box-shadow: 0 20px 80px rgba(0,0,0,0.2), inset 0 0 40px rgba(255,255,255,0.15); }
}
.mh-auth-logo-img {
    width: 80px;
    height: 80px;
    object-fit: contain;
    filter: brightness(0) invert(1);
}

.mh-auth-brand-text h1 {
    font-size: 32px;
    font-weight: 800;
    margin: 0 0 8px;
    text-shadow: 0 2px 10px rgba(0,0,0,0.15);
}
.mh-auth-brand-text h2 {
    font-size: 36px;
    font-weight: 900;
    margin: 0 0 8px;
    letter-spacing: 3px;
    text-shadow: 0 2px 10px rgba(0,0,0,0.15);
}
.mh-auth-brand-text p {
    font-size: 16px;
    opacity: 0.9;
    margin: 0;
}

/* ========== Right Form Panel ========== */
.mh-auth-forms {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    background: linear-gradient(180deg, #faf8f5 0%, #f5f0e8 100%);
    overflow-y: auto;
}

.mh-auth-card {
    width: 100%;
    max-width: 460px;
    background: #fff;
    border-radius: 24px;
    padding: 36px 32px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.08);
}

/* ========== Tab Switcher ========== */
.mh-auth-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 24px;
    border-bottom: 2px solid #f0ede8;
    position: relative;
}
.mh-auth-tab {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 16px;
    background: none;
    border: none;
    font-size: 14px;
    font-weight: 700;
    color: #aaa;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    letter-spacing: 0.5px;
}
.mh-auth-tab::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 3px;
    background: transparent;
    border-radius: 3px 3px 0 0;
    transition: background 0.3s ease;
}
.mh-auth-tab.is-active {
    color: #e8930a;
}
.mh-auth-tab.is-active::after {
    background: linear-gradient(90deg, #f5c842, #e8930a);
}
.mh-auth-tab:hover:not(.is-active) {
    color: #666;
}
.mh-auth-tab svg {
    flex-shrink: 0;
}

/* ========== Panels (Login / Register) ========== */
.mh-auth-panel {
    display: none;
}
.mh-auth-panel.is-active {
    display: block;
    animation: mh-fadeIn 0.3s ease;
}
@keyframes mh-fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ========== Form Title ========== */
.mh-auth-form-title {
    font-size: 28px;
    font-weight: 800;
    color: #1a1a2e;
    margin: 0 0 6px;
    text-align: center;
}
.mh-auth-form-subtitle {
    font-size: 14px;
    color: #888;
    margin: 0 0 20px;
    text-align: center;
}

/* ========== Labels ========== */
.mh-auth-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #555;
    margin-bottom: 6px;
}
.mh-required {
    color: #e8930a;
}

/* ========== Fields ========== */
.mh-auth-field {
    margin-bottom: 16px;
}
.mh-auth-input {
    width: 100%;
    padding: 13px 16px;
    border: 1.5px solid #e0dcd5;
    border-radius: 12px;
    font-size: 15px;
    color: #333;
    background: #faf9f7;
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
}
.mh-auth-input:focus {
    border-color: #e8930a;
    box-shadow: 0 0 0 3px rgba(232,147,10,0.12);
    background: #fff;
}
.mh-auth-input::placeholder {
    color: #bbb;
}

/* Phone input group */
.mh-auth-phone-wrap {
    display: flex;
    border: 1.5px solid #e0dcd5;
    border-radius: 12px;
    overflow: hidden;
    background: #faf9f7;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.mh-auth-phone-wrap:focus-within {
    border-color: #e8930a;
    box-shadow: 0 0 0 3px rgba(232,147,10,0.12);
}
.mh-auth-phone-prefix {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0 14px;
    background: #f0ede8;
    border-right: 1px solid #e0dcd5;
    font-weight: 600;
    font-size: 14px;
    color: #555;
    white-space: nowrap;
    cursor: default;
    flex-shrink: 0;
}
[dir="rtl"] .mh-auth-phone-prefix {
    border-right: none;
    border-left: 1px solid #e0dcd5;
}
.mh-auth-flag {
    width: 24px;
    height: 16px;
    object-fit: cover;
    border-radius: 2px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
.mh-auth-phone-wrap .mh-auth-input {
    border: none;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}
.mh-auth-phone-wrap .mh-auth-input:focus {
    box-shadow: none;
}

/* Input with icon */
.mh-auth-input-wrap {
    display: flex;
    align-items: center;
    border: 1.5px solid #e0dcd5;
    border-radius: 12px;
    background: #faf9f7;
    overflow: hidden;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.mh-auth-input-wrap:focus-within {
    border-color: #e8930a;
    box-shadow: 0 0 0 3px rgba(232,147,10,0.12);
}
.mh-auth-input-icon {
    padding: 0 12px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
}
.mh-auth-input--icon {
    border: none;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    flex: 1;
    min-width: 0;
}
.mh-auth-input--icon:focus {
    box-shadow: none;
}
.mh-auth-eye-btn {
    background: none;
    border: none;
    padding: 0 14px;
    cursor: pointer;
    opacity: 0.5;
    transition: opacity 0.2s;
    display: flex;
    align-items: center;
    flex-shrink: 0;
}
.mh-auth-eye-btn:hover {
    opacity: 1;
}

/* ========== Remember / Forgot Row ========== */
.mh-auth-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    font-size: 13px;
}
.mh-auth-remember {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    color: #666;
}
.mh-auth-remember input {
    accent-color: #e8930a;
    width: 16px;
    height: 16px;
}
.mh-auth-forgot {
    color: #e8930a;
    text-decoration: none;
    font-weight: 600;
}
.mh-auth-forgot:hover {
    text-decoration: underline;
}

/* ========== Buttons ========== */
.mh-auth-btn {
    width: 100%;
    padding: 14px 20px;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    margin-bottom: 12px;
    position: relative;
    overflow: hidden;
}

/* Gold button */
.mh-auth-btn--gold {
    background: linear-gradient(135deg, #f5c842 0%, #e8930a 50%, #d4800a 100%);
    color: #fff;
    box-shadow: 0 4px 15px rgba(232,147,10,0.35);
    text-shadow: 0 1px 2px rgba(0,0,0,0.1);
}
.mh-auth-btn--gold:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(232,147,10,0.45);
}
.mh-auth-btn--gold:active {
    transform: translateY(0);
    box-shadow: 0 2px 10px rgba(232,147,10,0.3);
}

/* ========== Social Buttons - Unified Design ========== */
.mh-auth-social {
    margin-bottom: 8px;
}

.mh-auth-btn--social {
    width: 100%;
    padding: 14px 20px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    margin-bottom: 12px;
    border: none;
    position: relative;
    overflow: hidden;
}

/* Google Button - White elegant */
.mh-auth-btn--google {
    background: #ffffff;
    color: #333;
    border: 1.5px solid #e0dcd5 !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.mh-auth-btn--google:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.1);
    border-color: #ccc !important;
    background: #fafafa;
}
.mh-auth-btn--google:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}

/* Apple Button - Dark elegant */
.mh-auth-btn--apple {
    background: linear-gradient(135deg, #2d2d2d 0%, #1a1a1a 100%);
    color: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}
.mh-auth-btn--apple:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.25);
    background: linear-gradient(135deg, #3a3a3a 0%, #222 100%);
}
.mh-auth-btn--apple:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

/* Remove disabled styling for social buttons */
.mh-auth-btn--social:disabled {
    opacity: 1;
    cursor: pointer;
}

/* ========== Divider ========== */
.mh-auth-divider {
    text-align: center;
    margin: 20px 0;
    position: relative;
}
.mh-auth-divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: #e0dcd5;
}
.mh-auth-divider span {
    position: relative;
    background: #fff;
    padding: 0 16px;
    font-size: 13px;
    color: #999;
}

/* ========== OTP Section ========== */
.mh-auth-otp-section {
    text-align: center;
    margin-bottom: 16px;
    padding: 16px 0;
}
.mh-auth-otp-label {
    font-size: 14px;
    color: #666;
    margin: 0 0 12px;
}
.mh-auth-otp-boxes {
    display: flex;
    gap: 12px;
    justify-content: center;
}
.mh-auth-otp-input {
    width: 56px;
    height: 56px;
    text-align: center;
    font-size: 22px;
    font-weight: 700;
    border: 2px solid #e0dcd5;
    border-radius: 12px;
    background: #faf9f7;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.mh-auth-otp-input:focus {
    border-color: #e8930a;
    box-shadow: 0 0 0 3px rgba(232,147,10,0.12);
}

/* ========== Secure Badge ========== */
.mh-auth-secure {
    text-align: center;
    font-size: 12px;
    color: #999;
    margin: 8px 0 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

/* ========== Footer Text ========== */
.mh-auth-footer-text {
    text-align: center;
    font-size: 14px;
    color: #666;
    margin: 12px 0 0;
}
.mh-auth-switch {
    color: #e8930a;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
}
.mh-auth-switch:hover {
    text-decoration: underline;
}

/* ========== WooCommerce notices ========== */
.mh-auth-page .woocommerce-error,
.mh-auth-page .woocommerce-message,
.mh-auth-page .woocommerce-info {
    border-radius: 12px;
    margin-bottom: 16px;
}

/* ========== Hide default WooCommerce my-account elements ========== */
.woocommerce-account .mh-auth-page ~ .woocommerce-MyAccount-navigation,
.woocommerce-account .mh-auth-page ~ .woocommerce-MyAccount-content {
    display: none;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 900px) {
    .mh-auth-page {
        flex-direction: column;
    }
    .mh-auth-brand {
        flex: none;
        padding: 40px 20px 30px;
    }
    .mh-auth-logo-circle {
        width: 100px;
        height: 100px;
        margin-bottom: 16px;
    }
    .mh-auth-logo-img {
        width: 55px;
        height: 55px;
    }
    .mh-auth-brand-text h1 {
        font-size: 24px;
    }
    .mh-auth-brand-text h2 {
        font-size: 28px;
    }
    .mh-auth-brand-text p {
        font-size: 14px;
    }
    .mh-auth-forms {
        padding: 24px 16px;
    }
    .mh-auth-card {
        padding: 28px 20px;
        border-radius: 20px;
    }
    .mh-auth-form-title {
        font-size: 24px;
    }
}

@media (max-width: 480px) {
    .mh-auth-brand {
        padding: 30px 16px 24px;
    }
    .mh-auth-logo-circle {
        width: 80px;
        height: 80px;
        margin-bottom: 12px;
    }
    .mh-auth-logo-img {
        width: 45px;
        height: 45px;
    }
    .mh-auth-brand-text h1 {
        font-size: 20px;
    }
    .mh-auth-brand-text h2 {
        font-size: 22px;
    }
    .mh-auth-card {
        padding: 24px 16px;
    }
    .mh-auth-otp-input {
        width: 48px;
        height: 48px;
        font-size: 20px;
    }
    .mh-auth-otp-boxes {
        gap: 8px;
    }
    .mh-auth-btn {
        font-size: 15px;
        padding: 12px 16px;
    }
    .mh-auth-tab {
        font-size: 13px;
        padding: 10px 12px;
    }
}

/* ========== RTL Adjustments ========== */
[dir="rtl"] .mh-auth-page {
    text-align: right;
}
[dir="rtl"] .mh-auth-phone-wrap {
    direction: ltr;
}
[dir="rtl"] .mh-auth-form-title,
[dir="rtl"] .mh-auth-form-subtitle,
[dir="rtl"] .mh-auth-secure,
[dir="rtl"] .mh-auth-footer-text,
[dir="rtl"] .mh-auth-divider span,
[dir="rtl"] .mh-auth-otp-label {
    text-align: center;
}
[dir="rtl"] .mh-auth-row {
    flex-direction: row-reverse;
}
[dir="rtl"] .mh-auth-label {
    text-align: right;
}
