/* Login popup — native <dialog> + layout; colors from admin settings (--tm-*) */
.tm-otp-popup-root {
    position: fixed;
    inset: 0;
    z-index: 2147483647;
    display: none;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: none;
    max-height: none;
    height: 100%;
    margin: 0;
    padding: 20px;
    border: none;
    background: transparent !important;
    background-color: transparent !important;
    font-family: 'Tajawal', sans-serif;
    box-sizing: border-box;
    overflow: hidden;
}

.tm-otp-popup-root[open],
.tm-otp-popup-root.is-open {
    display: flex !important;
}

.tm-otp-popup-root::backdrop {
    background: rgba(18, 22, 20, 0.55);
}

@media (pointer: fine) {
    .tm-otp-popup-root::backdrop {
        backdrop-filter: blur(8px);
        -webkit-backdrop-filter: blur(8px);
    }
}

.tm-otp-popup-dialog {
    position: relative;
    z-index: 1;
    pointer-events: auto !important;
    width: 100%;
    max-width: 400px;
    max-height: min(92vh, 680px);
    display: flex;
    flex-direction: column;
    background: var(--tm-bg, #fff);
    border-radius: 20px;
    border: 1px solid color-mix(in srgb, var(--tm-border, #e2e8e4) 80%, transparent);
    box-shadow:
        0 28px 70px rgba(0, 0, 0, 0.16),
        0 2px 8px rgba(0, 0, 0, 0.04);
    overflow: hidden;
    isolation: isolate;
    animation: tm-popup-slide-up 0.32s cubic-bezier(.22, 1, .36, 1);
    outline: none;
    margin: auto;
}

/* Alt drawer opens upward — only relax body clip; dialog keeps overflow:hidden for corners */
.tm-otp-popup-root.tm-otp-alt-overlay .tm-otp-popup-body {
    overflow: visible !important;
}

.tm-otp-popup-sheet-handle {
    display: none;
}

.tm-otp-popup-toolbar {
    position: relative;
    flex-shrink: 0;
    height: 48px;
    pointer-events: none;
}

.tm-otp-popup-root .tm-otp-popup-close {
    position: absolute;
    top: 12px;
    inset-inline-end: 12px;
    z-index: 21;
    width: 32px;
    height: 32px;
    margin: 0 !important;
    padding: 0 !important;
    border: 1px solid var(--tm-border, #e2e8e4) !important;
    border-radius: 50% !important;
    background: var(--tm-bg, #fff) !important;
    color: var(--tm-muted, #888) !important;
    cursor: pointer !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    line-height: 1 !important;
    min-height: 0 !important;
    min-width: 0 !important;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06) !important;
    transition: background 0.15s, color 0.15s, border-color 0.15s, transform 0.15s !important;
    pointer-events: auto !important;
    appearance: none !important;
    -webkit-appearance: none !important;
    font: inherit !important;
    text-transform: none !important;
    letter-spacing: normal !important;
}

.tm-otp-popup-close-icon {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 14px !important;
    height: 14px !important;
    line-height: 0 !important;
    pointer-events: none !important;
}

.tm-otp-popup-root .tm-otp-popup-close svg,
.tm-otp-popup-root .tm-otp-popup-close svg * {
    display: block !important;
    pointer-events: none !important;
    box-sizing: content-box !important;
}

.tm-otp-popup-root .tm-otp-popup-close:hover {
    background: var(--tm-surface, #f5f5f5) !important;
    color: var(--tm-text, #333) !important;
    border-color: color-mix(in srgb, var(--tm-p, #8e44ad) 35%, var(--tm-border, #e2e8e4)) !important;
    transform: scale(1.04);
}

.tm-otp-popup-root .tm-otp-popup-close:focus-visible {
    outline: 2px solid var(--tm-p, #8e44ad) !important;
    outline-offset: 2px !important;
}

.tm-otp-popup-body {
    position: relative;
    z-index: 2;
    flex: 1;
    overflow-y: auto;
    padding: 0;
    background: var(--tm-bg, #fff);
    -webkit-overflow-scrolling: touch;
}

/* Reset theme bleed inside popup dialog — layout tokens only; colors from admin inline CSS */
.tm-otp-popup-body #tm-otp-popup-main-container.tm-otp-context-popup {
    all: initial;
    --tm-r: 20px;
    --tm-r-sm: 8px;
    --tm-popup-control-max: 300px;
    --tm-ease: cubic-bezier(.4, 0, .2, 1);
    display: block !important;
    position: relative !important;
    font-family: 'Tajawal', sans-serif !important;
    overflow: visible !important;
    box-sizing: border-box !important;
    width: 100% !important;
}

.tm-otp-popup-body #tm-otp-popup-main-container.tm-otp-context-popup *,
.tm-otp-popup-body #tm-otp-popup-main-container.tm-otp-context-popup *::before,
.tm-otp-popup-body #tm-otp-popup-main-container.tm-otp-context-popup *::after {
    box-sizing: border-box;
}

/* iOS: keep inputs tappable and prevent zoom */
.tm-otp-popup-body #tm-otp-popup-main-container input,
.tm-otp-popup-body #tm-otp-popup-main-container select,
.tm-otp-popup-body #tm-otp-popup-main-container textarea {
    pointer-events: auto !important;
    touch-action: manipulation !important;
    -webkit-user-select: text !important;
    user-select: text !important;
    font-size: 16px !important;
    opacity: 1 !important;
    visibility: visible !important;
}

.tm-otp-popup-body #tm-otp-popup-main-container .tm-otp-phone-box,
.tm-otp-popup-body #tm-otp-popup-main-container .tm-otp-field-wrapper {
    pointer-events: auto !important;
    touch-action: manipulation !important;
}

/* Popup layout — centered text (overrides .tm-otp-main-container start alignment) */
.tm-otp-context-popup,
.tm-otp-context-popup.rtl,
.tm-otp-context-popup.ltr {
    text-align: center !important;
}

.tm-otp-context-popup .tm-otp-label-secondary,
.tm-otp-context-popup.rtl .tm-otp-label-secondary,
.tm-otp-context-popup.ltr .tm-otp-label-secondary {
    text-align: center !important;
}

.tm-otp-context-popup .tm-otp-help-text,
.tm-otp-context-popup.rtl .tm-otp-help-text,
.tm-otp-context-popup.ltr .tm-otp-help-text,
.tm-otp-context-popup .tm-otp-forgot-wrap {
    text-align: center !important;
}

/* Form inside popup — strip outer card chrome */
.tm-otp-context-popup.tm-otp-popup-card {
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    background: transparent !important;
}

.tm-otp-context-popup.tm-otp-popup-card::before {
    display: none !important;
}

.tm-otp-context-popup .tm-otp-ajax-form,
.tm-otp-context-popup .tm-otp-chooser-wrap,
.tm-otp-context-popup .tm-otp-popup-form {
    padding: 8px 32px 32px !important;
    position: relative !important;
    overflow: visible !important;
    text-align: center !important;
}

/* Popup form header — user icon + title */
.tm-otp-context-popup .tm-otp-popup-form-head {
    text-align: center;
    margin-bottom: 22px;
}

.tm-otp-context-popup .tm-otp-popup-user-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 14px;
    border-radius: 50%;
    border: 1.5px solid var(--tm-border, #e2e8e4);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--tm-muted, #888);
    background: var(--tm-surface, #fafafa);
}

.tm-otp-context-popup .tm-otp-popup-form-title {
    margin: 0 !important;
    font-size: 20px !important;
    font-weight: 800 !important;
    color: var(--tm-text, #1a1a1a) !important;
}

/* Hide default emoji icon / subtitle in popup forms */
.tm-otp-context-popup .tm-otp-popup-form > .tm-otp-icon,
.tm-otp-context-popup .tm-otp-popup-form > .tm-otp-step-subtitle {
    display: none !important;
}

/* Labels — centered in popup */
.tm-otp-context-popup .tm-otp-label-secondary {
    font-size: 13px !important;
    font-weight: 600 !important;
    color: var(--tm-text, #1a1a1a) !important;
    margin-bottom: 8px !important;
    display: block !important;
    text-align: center !important;
}

.tm-otp-context-popup .tm-otp-form-meta-row {
    margin: 2px 0 14px !important;
    justify-content: center !important;
}

.tm-otp-context-popup .tm-otp-meta-link {
    font-size: 13px !important;
}

.tm-otp-context-popup .tm-otp-field-wrapper {
    width: 100% !important;
    max-width: 100% !important;
    margin-bottom: 4px !important;
    text-align: center !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
}

.tm-otp-context-popup .tm-otp-footer-links {
    text-align: center !important;
}

/* Unified control width — matches "طرق دخول أخرى" toggle */
.tm-otp-context-popup .tm-otp-popup-submit,
.tm-otp-context-popup .tm-otp-btn-main,
.tm-otp-context-popup .tm-otp-phone-box,
.tm-otp-context-popup .tm-otp-password-wrap,
.tm-otp-context-popup .tm-otp-field-wrapper > .tm-otp-phone-input,
.tm-otp-context-popup .tm-otp-field-wrapper > .tm-otp-input-field {
    width: min(100%, var(--tm-popup-control-max, 300px)) !important;
    max-width: min(100%, var(--tm-popup-control-max, 300px)) !important;
    margin-left: auto !important;
    margin-right: auto !important;
}

.tm-otp-context-popup .tm-otp-field-wrapper .tm-otp-help-text {
    width: min(100%, var(--tm-popup-control-max, 300px)) !important;
    max-width: min(100%, var(--tm-popup-control-max, 300px)) !important;
    text-align: center !important;
}

/* Popup submit — spacing only; chrome from .tm-otp-btn-main in style.css */
.tm-otp-context-popup .tm-otp-popup-submit {
    margin-top: 16px !important;
    border-radius: 8px !important;
}

.tm-otp-context-popup .tm-otp-popup-form.tm-otp-alt-dim::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 40;
    border-radius: 0;
    background: color-mix(in srgb, var(--tm-bg, #fff) 50%, transparent);
    backdrop-filter: blur(7px);
    -webkit-backdrop-filter: blur(7px);
    pointer-events: none;
    opacity: 1;
    transition: opacity 0.28s ease, backdrop-filter 0.28s ease;
}

.tm-otp-context-popup .tm-otp-popup-form.tm-otp-alt-dim > .tm-otp-popup-form-head,
.tm-otp-context-popup .tm-otp-popup-form.tm-otp-alt-dim > .tm-otp-field-wrapper,
.tm-otp-context-popup .tm-otp-popup-form.tm-otp-alt-dim > .tm-otp-form-meta-row,
.tm-otp-context-popup .tm-otp-popup-form.tm-otp-alt-dim > .tm-otp-btn-main,
.tm-otp-context-popup .tm-otp-popup-form.tm-otp-alt-dim > .tm-otp-popup-submit,
.tm-otp-context-popup .tm-otp-popup-form.tm-otp-alt-dim > .tm-otp-pw-reg-panel,
.tm-otp-context-popup .tm-otp-popup-form.tm-otp-alt-dim > .tm-otp-inline-message,
.tm-otp-context-popup .tm-otp-popup-form.tm-otp-alt-dim > .tm-otp-footer-links {
    opacity: 0.45;
    transition: opacity 0.28s ease;
    pointer-events: none;
}

/* Alternate methods — float upward, no popup height growth */
.tm-otp-context-popup .tm-otp-alt-methods {
    position: relative;
    z-index: 50;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 14px;
}

.tm-otp-context-popup .tm-otp-alt-methods-toggle {
    display: block;
    width: min(100%, var(--tm-popup-control-max, 300px));
    margin: 0 auto;
    padding: 13px 18px;
    border: 1.5px solid var(--tm-border, #ebdef0);
    border-radius: 10px;
    background: var(--tm-bg, #fff);
    color: var(--tm-muted, #8e849b);
    font-family: 'Tajawal', sans-serif;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
    line-height: 1.4;
    transition: color 0.22s ease, border-color 0.22s ease, background 0.22s ease, box-shadow 0.22s ease;
}

.tm-otp-context-popup .tm-otp-alt-methods-toggle:hover,
.tm-otp-context-popup .tm-otp-alt-methods.is-open .tm-otp-alt-methods-toggle {
    color: var(--tm-p, #8e44ad);
    border-color: color-mix(in srgb, var(--tm-p, #8e44ad) 40%, var(--tm-border, #ebdef0));
    background: var(--tm-surface, #fdfaff);
    box-shadow: 0 4px 16px color-mix(in srgb, var(--tm-p, #8e44ad) 10%, transparent);
}

.tm-otp-context-popup .tm-otp-alt-methods-drawer {
    position: absolute;
    left: 50%;
    bottom: calc(100% + 10px);
    z-index: 2;
    width: min(100%, var(--tm-popup-control-max, 300px));
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateX(-50%) translateY(10px) scale(0.96);
    transform-origin: bottom center;
    transition:
        opacity 0.32s cubic-bezier(0.4, 0, 0.2, 1),
        visibility 0.32s cubic-bezier(0.4, 0, 0.2, 1),
        transform 0.36s cubic-bezier(0.34, 1.15, 0.64, 1);
}

.tm-otp-context-popup .tm-otp-alt-methods.is-open .tm-otp-alt-methods-drawer {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateX(-50%) translateY(0) scale(1);
}

.tm-otp-context-popup .tm-otp-alt-methods.is-closing .tm-otp-alt-methods-drawer {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateX(-50%) translateY(8px) scale(0.97);
    transition-duration: 0.22s;
}

.tm-otp-context-popup .tm-otp-alt-methods-drawer-inner {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    max-height: min(240px, 42vh);
    overflow-y: auto;
    padding: 10px;
    border-radius: 14px;
    border: 1.5px solid var(--tm-border, #ebdef0);
    background: var(--tm-bg, #fff);
    box-shadow:
        0 -14px 40px color-mix(in srgb, var(--tm-text, #2e1a47) 12%, transparent),
        0 6px 20px color-mix(in srgb, var(--tm-p, #8e44ad) 8%, transparent);
    -webkit-overflow-scrolling: touch;
}

.tm-otp-context-popup .tm-otp-popup-alt-btn {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    margin: 0;
    padding: 11px 10px;
    border: 1.5px solid var(--tm-border, #ebdef0);
    border-radius: 10px;
    background: var(--tm-surface, #fdfaff);
    color: var(--tm-text, #2e1a47);
    font-family: 'Tajawal', sans-serif;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    text-align: center;
    line-height: 1.35;
    transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.tm-otp-context-popup .tm-otp-alt-methods.is-open .tm-otp-popup-alt-btn {
    animation: tmOtpAltBtnIn 0.36s cubic-bezier(0.34, 1.1, 0.64, 1) backwards;
}

.tm-otp-context-popup .tm-otp-alt-methods.is-open .tm-otp-popup-alt-btn:nth-child(1) { animation-delay: 0.04s; }
.tm-otp-context-popup .tm-otp-alt-methods.is-open .tm-otp-popup-alt-btn:nth-child(2) { animation-delay: 0.08s; }
.tm-otp-context-popup .tm-otp-alt-methods.is-open .tm-otp-popup-alt-btn:nth-child(3) { animation-delay: 0.12s; }

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

.tm-otp-context-popup .tm-otp-popup-alt-btn:hover {
    background: var(--tm-bg, #fff);
    border-color: color-mix(in srgb, var(--tm-p, #8e44ad) 42%, var(--tm-border, #ebdef0));
    box-shadow: 0 4px 14px color-mix(in srgb, var(--tm-p, #8e44ad) 10%, transparent);
}

.tm-otp-context-popup .tm-otp-alt-btn-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    flex-shrink: 0;
    color: var(--tm-p, #8e44ad);
    background: color-mix(in srgb, var(--tm-p, #8e44ad) 11%, var(--tm-surface, #fdfaff));
    border: 1px solid color-mix(in srgb, var(--tm-p, #8e44ad) 18%, var(--tm-border, #ebdef0));
}

.tm-otp-context-popup .tm-otp-alt-btn-icon .tm-otp-alt-svg {
    width: 20px;
    height: 20px;
    display: block;
}

.tm-otp-context-popup .tm-otp-alt-btn-icon .tm-otp-alt-svg--fill {
    width: 20px;
    height: 20px;
    stroke: none;
}

.tm-otp-context-popup .tm-otp-alt-btn-label {
    flex: 0 1 auto;
    text-align: center;
    line-height: 1.35;
}

/* Hide legacy full-screen status overlay inside popup */
.tm-otp-context-popup #tm-otp-status,
.tm-otp-context-popup #tm-otp-popup-status,
.tm-otp-popup-body #tm-otp-status,
.tm-otp-popup-body #tm-otp-popup-status {
    display: none !important;
}

/* Subtle fetch — form stays visible; keep inputs tappable on mobile */
.tm-otp-context-popup .tm-otp-content--fetching {
    opacity: 0.72;
    transition: opacity 0.18s ease;
}

.tm-otp-context-popup .tm-otp-content--fetching input,
.tm-otp-context-popup .tm-otp-content--fetching select,
.tm-otp-context-popup .tm-otp-content--fetching textarea,
.tm-otp-context-popup .tm-otp-content--fetching .tm-otp-phone-box,
.tm-otp-context-popup .tm-otp-content--fetching .tm-otp-field-wrapper {
    pointer-events: auto !important;
}

/* Submitting — dim fields, button keeps loading spinner */
.tm-otp-context-popup .tm-otp-form--submitting .tm-otp-popup-form-head,
.tm-otp-context-popup .tm-otp-form--submitting .tm-otp-field-wrapper,
.tm-otp-context-popup .tm-otp-form--submitting .tm-otp-alt-methods {
    opacity: 0.55;
    transition: opacity 0.18s ease;
}

.tm-otp-context-popup .tm-otp-form--submitting .tm-otp-popup-submit {
    opacity: 1 !important;
}

.tm-otp-context-popup .tm-otp-btn-main.tm-otp-btn-loading {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 0 !important;
    min-height: 50px !important;
}

/* Inline feedback — above submit button */
.tm-otp-context-popup .tm-otp-inline-message {
    margin: 0 0 12px;
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.55;
    text-align: center;
}

.tm-otp-context-popup .tm-otp-inline-message.is-error {
    background: color-mix(in srgb, var(--tm-err, #e74c3c) 10%, var(--tm-bg, #fff));
    border: 1px solid color-mix(in srgb, var(--tm-err, #e74c3c) 28%, transparent);
    color: var(--tm-err2, #c0392b);
}

.tm-otp-context-popup .tm-otp-inline-message.is-success {
    background: color-mix(in srgb, var(--tm-ok, #27ae60) 10%, var(--tm-bg, #fff));
    border: 1px solid color-mix(in srgb, var(--tm-ok, #27ae60) 28%, transparent);
    color: var(--tm-ok2, #1e8449);
}

/* Panel switch */
.tm-otp-popup-flow .tm-otp-local-panel.is-active {
    animation: tm-popup-panel-in 0.22s ease;
}

@keyframes tm-popup-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes tm-popup-slide-up {
    from {
        opacity: 0;
        transform: translateY(24px) scale(0.97);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes tm-popup-panel-in {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Resend button loading */
.tm-otp-context-popup .tm-otp-btn-resend.tm-otp-btn-loading {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-width: 120px;
}

/* Salla / theme menus: disable ghost touch layers while OTP popup is open */
body.tm-otp-popup-open salla-menu,
body.tm-otp-popup-open salla-user-menu,
body.tm-otp-popup-open .s-mobile-menu,
body.tm-otp-popup-open .mobile-menu,
body.tm-otp-popup-open .menu-drawer,
body.tm-otp-popup-open .drawer,
body.tm-otp-popup-open .mm-wrapper,
body.tm-otp-popup-open .mm-ocd,
body.tm-otp-popup-open .s-menu-overlay,
body.tm-otp-popup-open [class*="menu-overlay"] {
    pointer-events: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    z-index: -1 !important;
}

.tm-otp-account-login-trigger {
    margin: 0 0 18px;
    text-align: center;
}

.tm-otp-open-login-btn {
    width: 100%;
    max-width: 320px;
    padding: 12px 20px !important;
    border-radius: 8px !important;
    font-weight: 700 !important;
    background: linear-gradient(135deg, var(--tm-p, #8e44ad) 0%, var(--tm-p2, #6c3483) 100%) !important;
    color: #fff !important;
    border: none !important;
}

/* Popup mode: hide WooCommerce classic login forms */
body.tm-otp-popup-mode.tm-otp-hide-wc-login #customer_login,
body.tm-otp-popup-mode.tm-otp-hide-wc-login .woocommerce-form-login,
body.tm-otp-popup-mode.tm-otp-hide-wc-login .woocommerce-form-register,
body.tm-otp-popup-mode.tm-otp-hide-wc-login .u-columns.col2-set,
body.tm-otp-popup-mode.tm-otp-on-checkout .woocommerce-form-login-toggle,
body.tm-otp-popup-mode.tm-otp-on-checkout .woocommerce-form-login,
body.tm-otp-popup-mode.tm-otp-on-checkout .woocommerce-info:has(a[href*="my-account"]) {
    display: none !important;
}

body.tm-otp-popup-mode.tm-otp-hide-wc-login .tm-otp-account-login-trigger,
body.tm-otp-popup-mode.tm-otp-on-checkout .tm-otp-account-login-trigger {
    display: block;
}

@media (max-width: 768px) {
    .tm-otp-popup-root {
        position: fixed;
        inset: 0;
        width: 100%;
        height: 100%;
        height: 100dvh;
        max-height: 100dvh;
        padding: 0 !important;
        margin: 0 !important;
        border: none;
        overflow: hidden;
        align-items: stretch;
        justify-content: flex-end;
        background: none !important;
        background-color: transparent !important;
        box-shadow: none !important;
        appearance: none;
        -webkit-appearance: none;
    }

    /* Fog lives behind the sheet so rounded top corners stay clean */
    .tm-otp-popup-root::backdrop {
        background: transparent !important;
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
        opacity: 1 !important;
    }

    .tm-otp-popup-sheet-dim {
        display: none;
    }

    .tm-otp-popup-root.tm-otp-sheet-dim-visible .tm-otp-popup-sheet-dim {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 1;
        margin: 0;
        padding: 0;
        border: none;
        background: rgba(18, 22, 20, 0.42);
        backdrop-filter: blur(14px) saturate(1.15);
        -webkit-backdrop-filter: blur(14px) saturate(1.15);
        -webkit-tap-highlight-color: transparent;
        cursor: pointer;
    }

    .tm-otp-popup-root.is-sheet-closing .tm-otp-popup-sheet-dim {
        opacity: 0;
        transition: opacity 0.36s cubic-bezier(0.4, 0, 0.68, 1);
        -webkit-transition: opacity 0.36s cubic-bezier(0.4, 0, 0.68, 1);
    }

    .tm-otp-popup-sheet-handle {
        display: block;
        width: 40px;
        height: 4px;
        margin: 10px auto 2px;
        border-radius: 999px;
        background: color-mix(in srgb, var(--tm-muted, #888) 40%, var(--tm-border, #e2e8e4));
        pointer-events: none;
        flex-shrink: 0;
    }

    .tm-otp-popup-toolbar {
        height: auto;
        min-height: 36px;
        padding-bottom: 0;
        flex-shrink: 0;
    }

    .tm-otp-popup-root .tm-otp-popup-close {
        top: 10px;
    }

    .tm-otp-popup-dialog {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 3;
        overflow: hidden;
        isolation: isolate;
        pointer-events: auto !important;
        width: 100%;
        max-width: none;
        max-height: min(90dvh, var(--tm-vv-height, 90dvh));
        margin: 0;
        padding: 0;
        border-radius: 20px 20px 0 0;
        border-bottom: none;
        box-shadow: 0 -4px 32px rgba(0, 0, 0, 0.14);
        animation: none !important;
        transform: translate3d(0, 100%, 0);
        -webkit-transform: translate3d(0, 100%, 0);
        transition: transform 0.48s cubic-bezier(0.32, 0.72, 0, 1), bottom 0.26s cubic-bezier(0.32, 0.72, 0, 1), max-height 0.26s cubic-bezier(0.32, 0.72, 0, 1);
        -webkit-transition: -webkit-transform 0.48s cubic-bezier(0.32, 0.72, 0, 1), bottom 0.26s cubic-bezier(0.32, 0.72, 0, 1), max-height 0.26s cubic-bezier(0.32, 0.72, 0, 1);
        will-change: transform, bottom, max-height;
        -webkit-backface-visibility: hidden;
        backface-visibility: hidden;
        touch-action: manipulation;
    }

    .tm-otp-popup-root.is-sheet-visible:not(.is-sheet-closing) .tm-otp-popup-dialog {
        transform: translate3d(0, 0, 0);
        -webkit-transform: translate3d(0, 0, 0);
        bottom: var(--tm-kb-inset, 0px);
    }

    .tm-otp-popup-root.is-keyboard-open .tm-otp-popup-dialog {
        max-height: var(--tm-vv-height, 90dvh);
        border-radius: 20px 20px 0 0;
        transition: bottom 0.22s cubic-bezier(0.32, 0.72, 0, 1), max-height 0.22s cubic-bezier(0.32, 0.72, 0, 1);
        -webkit-transition: bottom 0.22s cubic-bezier(0.32, 0.72, 0, 1), max-height 0.22s cubic-bezier(0.32, 0.72, 0, 1);
    }

    .tm-otp-popup-root.is-sheet-closing .tm-otp-popup-dialog {
        bottom: 0 !important;
        transform: translate3d(0, 100%, 0);
        -webkit-transform: translate3d(0, 100%, 0);
        transition: transform 0.42s cubic-bezier(0.4, 0, 0.68, 1), bottom 0.42s cubic-bezier(0.4, 0, 0.68, 1), max-height 0.42s cubic-bezier(0.4, 0, 0.68, 1);
        -webkit-transition: -webkit-transform 0.42s cubic-bezier(0.4, 0, 0.68, 1), bottom 0.42s cubic-bezier(0.4, 0, 0.68, 1), max-height 0.42s cubic-bezier(0.4, 0, 0.68, 1);
    }

    .tm-otp-popup-body {
        padding-bottom: 0;
    }

    .tm-otp-context-popup .tm-otp-ajax-form,
    .tm-otp-context-popup .tm-otp-chooser-wrap,
    .tm-otp-context-popup .tm-otp-popup-form {
        padding: 4px 24px max(20px, env(safe-area-inset-bottom, 0px)) !important;
    }

    .tm-otp-popup-root.is-keyboard-open .tm-otp-context-popup .tm-otp-ajax-form,
    .tm-otp-popup-root.is-keyboard-open .tm-otp-context-popup .tm-otp-chooser-wrap,
    .tm-otp-popup-root.is-keyboard-open .tm-otp-context-popup .tm-otp-popup-form {
        padding-bottom: 12px !important;
    }
}

@media (max-width: 768px) and (prefers-reduced-motion: reduce) {
    .tm-otp-popup-dialog {
        transition: none !important;
        -webkit-transition: none !important;
        transform: none !important;
        -webkit-transform: none !important;
        position: fixed;
        bottom: 0;
    }

    .tm-otp-popup-root::backdrop {
        background: transparent !important;
    }

    .tm-otp-popup-root.tm-otp-sheet-dim-visible .tm-otp-popup-sheet-dim {
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        background: rgba(18, 22, 20, 0.5);
    }
}
