@font-face {
    font-family: 'Vazirmatn';
    src: url('../fonts/Vazirmatn.woff2') format('woff2');
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
}

.dmo-wrapper, .dmo-wrapper *, .dmo-modal-content, .dmo-modal-content * {
    font-family: 'Vazirmatn', tahoma, sans-serif !important;
    direction: rtl;
    text-align: right;
    box-sizing: border-box;
}

.dmo-card {
    background: #ffffff;
    border-radius: 14px;
    padding: 24px;
    max-width: 400px;
    margin: 0 auto;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    border: 1px solid #f0f0f0;
    transition: all 0.3s ease;
}

/* حالت متمایز برای ثبت‌نام */
.dmo-card.dmo-state-register {
    border: 2px solid #ffa41b;
    background: #fffdf9;
}

.dmo-card h3.dmo-title {
    margin-top: 0;
    margin-bottom: 20px;
    font-size: 20px;
    color: #2c3e50;
    text-align: center;
    font-weight: bold;
}

.dmo-notice-box {
    background-color: #fff8eb;
    border-right: 4px solid #ffa41b;
    color: #8a5300;
    padding: 10px 12px;
    font-size: 12px;
    border-radius: 6px;
    margin-bottom: 16px;
    line-height: 1.8;
}

.dmo-field {
    margin-bottom: 14px;
}

.dmo-field label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    color: #555;
}

.dmo-field input {
    width: 100%;
    padding: 11px 14px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    font-size: 15px;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
    text-align: center;
}

.dmo-field input:focus {
    border-color: #ffa41b;
    box-shadow: 0 0 0 3px rgba(255, 164, 27, 0.15);
}

.dmo-btn {
    width: 100%;
    padding: 12px;
    background-color: #ffa41b;
    color: #ffffff;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    font-family: 'Vazirmatn';
    transition: background-color 0.2s, transform 0.1s;
}

.dmo-btn:hover {
    background-color: #e6900f;
}

.dmo-btn:active {
    transform: scale(0.99);
}

.dmo-btn:disabled {
    cursor: wait;
    opacity: .65;
}

.dmo-is-loading::after {
    content: '…';
    margin-right: 6px;
}

.dmo-timer-box {
    margin-top: 15px;
    font-size: 13px;
    color: #777;
    text-align: center;
}

.dmo-resend-link {
    color: #ffa41b;
    text-decoration: none;
    font-weight: bold;
}

.dmo-message {
    margin-top: 15px;
    font-size: 14px;
    text-align: center;
    padding: 10px 14px;
    border-radius: 8px;
    line-height: 1.6;
    transition: all 0.3s ease;
}

.dmo-message.error {
    color: #c0392b;
    background-color: #fadbd8;
    border: 1px solid #e74c3c;
}

.dmo-message.success {
    color: #1e8449;
    background-color: #d5f4e6;
    border: 1px solid #27ae60;
}

.dmo-message.info {
    color: #64748b;
    background: transparent;
    border: 0;
    padding: 7px 0 0;
    font-size: 13px;
}

.dmo-message.info::before {
    content: '';
    display: inline-block;
    width: 12px;
    height: 12px;
    margin-left: 7px;
    vertical-align: -1px;
    border: 2px solid #cbd5e1;
    border-top-color: #64748b;
    border-radius: 50%;
    animation: dmoSpin .65s linear infinite;
}

.dmo-message:empty {
    display: none;
}

/* Checkout login uses the same OTP modal as the header. */
body.dmo-checkout-otp .woocommerce form.woocommerce-form-login,
body.dmo-checkout-otp .woocommerce form.login {
    display: none !important;
}

/* Modal Design */
.dmo-modal-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.6);
    z-index: 999999;
    align-items: center;
    justify-content: center;
    padding: 15px;
}

.dmo-modal-content {
    position: relative;
    width: 100%;
    max-width: 400px;
    max-height: calc(100vh - 30px);
    overflow-y: auto;
    animation: dmoFadeIn 0.3s ease;
}

.dmo-modal-close {
    position: absolute;
    top: 12px;
    left: 16px;
    font-size: 24px;
    cursor: pointer;
    color: #aaa;
    z-index: 10;
    transition: color 0.2s;
}

.dmo-modal-close:hover {
    color: #ffa41b;
}
/* مخفی‌سازی کامل کشوی ورود وودمارت */
.login-form-side.wd-side-hidden.woocommerce.wd-left.wd-opened {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

@keyframes dmoFadeIn {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 480px) {
    .dmo-modal-overlay {
        padding: 0;
        align-items: flex-end;
    }

    .dmo-modal-content {
        max-width: none;
        max-height: 92vh;
        border-radius: 18px 18px 0 0;
    }

    .dmo-card {
        padding: 18px;
        border-radius: 18px 18px 0 0;
    }

    .dmo-field input, .dmo-btn { min-height: 46px; }
}

@keyframes dmoSpin {
    to { transform: rotate(360deg); }
}
/* Mobile viewport and third-party widget protection */
.dmo-modal-overlay {
    z-index: 2147483647;
    isolation: isolate;
}

@media (max-width: 600px) {
    .dmo-modal-overlay {
        height: 100vh;
        min-height: 100vh;
        height: 100dvh;
        min-height: 100dvh;
        padding: max(16px, env(safe-area-inset-top)) 16px max(16px, env(safe-area-inset-bottom));
        align-items: center;
    }

    .dmo-modal-content {
        width: 100%;
        max-width: 420px;
        max-height: calc(100vh - 32px);
        max-height: calc(100dvh - 32px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
        overflow-y: auto;
        overscroll-behavior: contain;
        -webkit-overflow-scrolling: touch;
        border-radius: 18px 18px 12px 12px;
    }

    .dmo-card {
        padding: 20px 16px max(20px, env(safe-area-inset-bottom));
        border-radius: 18px 18px 12px 12px;
    }

    .dmo-card h3.dmo-title {
        padding: 0 34px;
        margin-bottom: 18px;
        font-size: 19px;
    }

    .dmo-modal-close {
        top: 13px;
        left: 14px;
        width: 34px;
        height: 34px;
        line-height: 30px;
        text-align: center;
        border-radius: 50%;
        background: #f8fafc;
    }

    .dmo-field {
        margin-bottom: 12px;
    }

    .dmo-field input,
    .dmo-btn {
        min-height: 50px;
    }

    .dmo-btn {
        position: relative;
        z-index: 1;
    }
}
/* Button label and placeholder clarity */
.dmo-btn {
    text-align: center !important;
    justify-content: center;
}

.dmo-field input::placeholder {
    color: #aeb8c4;
    opacity: 1;
}
