/* DTT Auth Modal — global, scoped, mobile-safe. */
#mkmAuthModal,
#mkmAuthModal * {
    box-sizing: border-box;
}

#mkmAuthModal {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: max(18px, env(safe-area-inset-top)) 14px max(18px, env(safe-area-inset-bottom));
    background: rgba(21, 18, 27, .58);
    -webkit-backdrop-filter: blur(12px) saturate(1.08);
    backdrop-filter: blur(12px) saturate(1.08);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity .24s ease, visibility .24s ease;
}

#mkmAuthModal.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

#mkmAuthModal .mkm-auth-modal {
    position: relative;
    width: min(440px, calc(100vw - 28px));
    max-width: 440px;
    max-height: min(760px, calc(100dvh - 36px));
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    border: 1px solid rgba(93, 77, 67, .10);
    border-radius: 26px;
    background:
        radial-gradient(circle at 92% 2%, rgba(124, 93, 246, .08), transparent 13rem),
        #fff;
    box-shadow: 0 34px 90px rgba(24, 18, 31, .24), inset 0 1px 0 rgba(255,255,255,.85);
    transform: translateY(18px) scale(.975);
    transition: transform .28s cubic-bezier(.2,.8,.2,1);
    -webkit-overflow-scrolling: touch;
}

#mkmAuthModal.active .mkm-auth-modal {
    transform: translateY(0) scale(1);
}

#mkmAuthModal .mkm-auth-header {
    position: sticky;
    top: 0;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 70px;
    padding: 20px 22px 15px;
    border-bottom: 1px solid #f0ece9;
    background: rgba(255,255,255,.94);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
}

#mkmAuthModal .mkm-auth-tabs {
    display: flex;
    align-items: center;
    gap: 11px;
}

#mkmAuthModal .mkm-auth-tab {
    position: relative;
    min-height: 36px;
    padding: 4px 0;
    border: 0;
    background: transparent;
    color: #9a929e;
    cursor: pointer;
    font-size: 15px !important;
    font-weight: 800;
    line-height: 1.25;
}

#mkmAuthModal .mkm-auth-tab.active {
    color: #211b25;
}

#mkmAuthModal .mkm-auth-tab.active::after {
    content: "";
    position: absolute;
    right: 0;
    bottom: -16px;
    left: 0;
    height: 3px;
    border-radius: 999px 999px 0 0;
    background: linear-gradient(90deg, #7c5df6, #f56a1f);
}

#mkmAuthModal .mkm-auth-tab-divider {
    color: #d6d0d8;
    font-size: 15px;
}

#mkmAuthModal .mkm-auth-close {
    display: grid;
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    place-items: center;
    padding: 0;
    border: 1px solid #ece7e4;
    border-radius: 12px;
    background: #faf8f7;
    color: #716975;
    cursor: pointer;
    font-size: 24px !important;
    line-height: 1;
    transition: background .18s ease, color .18s ease, transform .18s ease;
}

#mkmAuthModal .mkm-auth-close:hover {
    background: #f2eeeb;
    color: #211b25;
    transform: rotate(3deg);
}

#mkmAuthModal .mkm-auth-body {
    padding: 24px 22px 22px;
}

/* Critical: exactly one auth pane may be visible at a time. */
#mkmAuthModal .mkm-auth-form {
    display: none !important;
    width: 100%;
    margin: 0;
    animation: dttAuthFadeIn .22s ease both;
}

#mkmAuthModal .mkm-auth-form.active {
    display: block !important;
}

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

#mkmAuthModal .mkm-form-group {
    margin: 0 0 17px;
}

#mkmAuthModal .mkm-form-group label {
    display: block;
    margin: 0 0 7px;
    color: #4f4651;
    font-size: 13px !important;
    font-weight: 800;
    line-height: 1.4;
}

#mkmAuthModal .mkm-input-wrap {
    position: relative;
    display: flex;
    min-height: 50px;
    align-items: center;
    overflow: hidden;
    padding: 0 12px;
    border: 1px solid #e8e2df;
    border-radius: 13px;
    background: #fcfbfa;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.85);
    transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}

#mkmAuthModal .mkm-input-wrap:focus-within {
    border-color: rgba(124,93,246,.55);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(124,93,246,.09);
}

#mkmAuthModal .mkm-input-wrap > i:not(.mkm-pwd-toggle) {
    flex: 0 0 20px;
    color: #9d95a2;
    font-size: 15px !important;
    text-align: center;
}

#mkmAuthModal .mkm-input-wrap input {
    min-width: 0;
    width: 100%;
    min-height: 48px;
    margin: 0;
    padding: 12px 10px;
    border: 0 !important;
    border-radius: 0;
    outline: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    color: #241e27;
    font-size: 15px !important;
    line-height: 1.45;
}

#mkmAuthModal .mkm-input-wrap input::placeholder {
    color: #aaa2ae;
    opacity: 1;
}

#mkmAuthModal .mkm-pwd-toggle {
    display: grid;
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    place-items: center;
    padding: 0;
    border-radius: 10px;
    background: #f0ecef;
    color: #716a76 !important;
    cursor: pointer;
    font-size: 14px !important;
}

#mkmAuthModal .mkm-auth-options {
    display: flex;
    justify-content: flex-end;
    margin: -3px 0 18px;
}

#mkmAuthModal .mkm-auth-link {
    color: #6d4ff2;
    font-size: 13px !important;
    font-weight: 750;
    text-decoration: none;
}

#mkmAuthModal .mkm-auth-link:hover { text-decoration: underline; }

#mkmAuthModal .mkm-btn-submit,
#mkmAuthModal .mkm-btn-google {
    display: flex;
    width: 100%;
    min-height: 50px;
    align-items: center;
    justify-content: center;
    gap: 9px;
    margin: 0;
    padding: 12px 16px;
    border-radius: 13px;
    cursor: pointer;
    font-size: 14px !important;
    font-weight: 850;
    line-height: 1.3;
    text-decoration: none;
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

#mkmAuthModal .mkm-btn-submit {
    border: 0;
    background: linear-gradient(135deg, #6d4ff2, #795ef4 55%, #ef7130);
    color: #fff;
    box-shadow: 0 12px 24px rgba(105,78,237,.20);
}

#mkmAuthModal .mkm-btn-submit:hover {
    transform: translateY(-1px);
    box-shadow: 0 16px 28px rgba(105,78,237,.26);
}

#mkmAuthModal .mkm-btn-google {
    margin-top: 10px;
    border: 1px solid #e7e2df;
    background: #fff;
    color: #403943;
    box-shadow: 0 5px 14px rgba(38,30,42,.04);
}

#mkmAuthModal .mkm-btn-google:hover {
    border-color: #d9d1cc;
    transform: translateY(-1px);
}

#mkmAuthModal .mkm-btn-google img {
    width: 19px !important;
    height: 19px !important;
    flex: 0 0 19px;
    object-fit: contain;
}

#mkmAuthModal .mkm-auth-footer-text {
    margin: 20px 0 0;
    color: #766e79;
    font-size: 13px !important;
    line-height: 1.55;
    text-align: center;
}

#mkmAuthModal .mkm-auth-footer-text button {
    color: #6545ef !important;
    font-size: inherit !important;
    font-weight: 850 !important;
    text-decoration: none;
}

#mkmAuthModal .mkm-auth-close-text {
    margin: 13px 0 0;
    padding: 5px;
    color: #9a929d;
    cursor: pointer;
    font-size: 12px !important;
    font-weight: 700;
    line-height: 1.4;
    text-align: center;
}

#mkmAuthModal .mkm-auth-alert {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 16px;
    padding: 11px 13px;
    border-radius: 11px;
    font-size: 13px !important;
    font-weight: 650;
    line-height: 1.5;
}

@media (max-width: 480px) {
    #mkmAuthModal {
        align-items: center;
        padding-right: 12px;
        padding-left: 12px;
    }

    #mkmAuthModal .mkm-auth-modal {
        width: calc(100vw - 24px);
        max-height: calc(100dvh - 30px);
        border-radius: 22px;
    }

    #mkmAuthModal .mkm-auth-header {
        min-height: 64px;
        padding: 17px 18px 13px;
    }

    #mkmAuthModal .mkm-auth-body {
        padding: 20px 18px 18px;
    }

    #mkmAuthModal .mkm-auth-tab {
        font-size: 14px !important;
    }

    #mkmAuthModal .mkm-auth-tab.active::after {
        bottom: -14px;
    }
}

@media (prefers-reduced-motion: reduce) {
    #mkmAuthModal,
    #mkmAuthModal .mkm-auth-modal,
    #mkmAuthModal .mkm-auth-form {
        transition: none !important;
        animation: none !important;
    }
}
