/* Shared login UI: SweetAlert2 theme, password toggle, loading buttons, OTP step */

.dtf-login-step-hidden {
    display: none !important;
}

/* ---------- SweetAlert2 theme ---------- */
.swal2-container {
    padding: max(12px, env(safe-area-inset-top, 0px)) 12px max(12px, env(safe-area-inset-bottom, 0px));
    z-index: 3000;
}

.swal2-container.swal2-backdrop-show {
    background: rgba(2, 6, 23, 0.55);
    backdrop-filter: blur(3px);
}

.dm-swal-popup {
    width: min(420px, 100%) !important;
    padding: 26px 22px 22px !important;
    border-radius: 20px !important;
    font-family: 'Inter', Arial, sans-serif;
    box-shadow: 0 24px 60px rgba(2, 6, 23, 0.35);
}

.dm-swal-popup .swal2-icon {
    margin: 4px auto 14px;
    transform: scale(0.82);
}

.dm-swal-title {
    padding: 0 !important;
    font-family: 'Plus Jakarta Sans', 'Inter', sans-serif;
    font-size: 1.3rem !important;
    font-weight: 800 !important;
    color: #0f172a !important;
}

.dm-swal-text {
    margin: 8px 0 0 !important;
    padding: 0 !important;
    font-size: 0.93rem !important;
    line-height: 1.55;
    color: #475569 !important;
    word-break: break-word;
}

.dm-swal-popup .swal2-actions {
    width: 100%;
    gap: 10px;
    margin-top: 20px;
    flex-wrap: nowrap;
}

.dm-swal-btn {
    flex: 1 1 0;
    min-height: 46px;
    padding: 10px 18px;
    border: 0;
    border-radius: 12px;
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.dm-swal-btn:focus-visible {
    outline: 3px solid rgba(79, 70, 229, 0.35);
    outline-offset: 2px;
}

.dm-swal-btn-primary {
    color: #fff;
    background: linear-gradient(135deg, #4f46e5, #2563eb);
    box-shadow: 0 10px 22px rgba(79, 70, 229, 0.28);
}

.dm-swal-btn-danger {
    color: #fff;
    background: linear-gradient(135deg, #ef4444, #dc2626);
    box-shadow: 0 10px 22px rgba(220, 38, 38, 0.25);
}

.dm-swal-btn-ghost {
    color: #334155;
    background: #f1f5f9;
}

.dm-swal-btn:hover {
    transform: translateY(-1px);
}

.dm-swal-toast {
    border-radius: 14px !important;
    font-family: 'Inter', Arial, sans-serif;
    box-shadow: 0 14px 34px rgba(15, 23, 42, 0.18) !important;
}

.dm-swal-toast .swal2-title {
    font-size: 0.92rem !important;
    color: #0f172a !important;
}

/* ---------- Password visibility toggle ---------- */
.dm-pass-toggle {
    position: absolute;
    top: 50%;
    right: 6px;
    transform: translateY(-50%);
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: #94a3b8;
    cursor: pointer;
}

.dm-pass-toggle:hover,
.dm-pass-toggle:focus-visible {
    color: #4f46e5;
    background: #eef2ff;
    outline: none;
}

.dm-pass-toggle i {
    position: static !important;
    transform: none !important;
    color: inherit !important;
}

.dm-has-toggle .form-control {
    padding-right: 48px !important;
}

/* ---------- Loading buttons ---------- */
.dm-btn-loading {
    position: relative;
    color: transparent !important;
    pointer-events: none;
}

.dm-btn-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2.5px solid rgba(255, 255, 255, 0.45);
    border-top-color: #fff;
    border-radius: 50%;
    animation: dm-spin 0.7s linear infinite;
}

.btn-outline-secondary.dm-btn-loading::after {
    border-color: rgba(71, 85, 105, 0.3);
    border-top-color: #475569;
}

@keyframes dm-spin {
    to { transform: rotate(360deg); }
}

/* ---------- OTP step ---------- */
.dtf-otp-panel {
    margin-top: 0 !important;
    animation: dm-fade-up 0.25s ease;
}

.dtf-otp-panel h3 {
    font-family: 'Plus Jakarta Sans', 'Inter', sans-serif;
    font-weight: 800;
    color: #0f172a;
}

.dtf-otp-panel p strong {
    color: #0f172a;
    display: inline-block;
    overflow-wrap: anywhere;
}

.dtf-otp-input {
    min-height: 56px;
    border-radius: 14px !important;
    border: 1.5px solid #c7d2fe !important;
    background: #fff;
    font-size: 1.5rem !important;
    font-variant-numeric: tabular-nums;
}

.dtf-otp-input::placeholder {
    color: #cbd5e1;
}

.dtf-otp-input:focus {
    border-color: #4f46e5 !important;
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.14) !important;
}

.dtf-otp-actions {
    display: grid !important;
    grid-template-columns: 1fr 1fr;
    gap: 10px !important;
}

.dtf-otp-actions .btn {
    min-height: 46px;
    border-radius: 12px;
    font-weight: 700;
}

.dtf-otp-actions .btn-primary {
    grid-column: 1 / -1;
    border: 0;
    background: linear-gradient(135deg, #4f46e5, #2563eb);
    box-shadow: 0 10px 22px rgba(79, 70, 229, 0.25);
}

.dtf-otp-actions .btn-outline-secondary,
.dtf-otp-actions .btn-link {
    grid-column: span 1;
}

.dtf-otp-actions .btn-link {
    color: #475569;
    text-decoration: none;
    background: #f1f5f9;
}

.dtf-otp-actions .btn-link:hover {
    color: #0f172a;
    background: #e2e8f0;
}

.dtf-otp-actions .btn-outline-secondary {
    border-color: #cbd5e1;
    color: #334155;
}

.dtf-otp-actions .btn-outline-secondary:hover {
    background: #eef2ff;
    border-color: #c7d2fe;
    color: #4338ca;
}

.dtf-otp-actions .btn:disabled {
    opacity: 0.65;
}

@keyframes dm-fade-up {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: none; }
}

@media (max-width: 380px) {
    .dtf-otp-actions {
        grid-template-columns: 1fr;
    }

    .dtf-otp-actions .btn-outline-secondary,
    .dtf-otp-actions .btn-link {
        grid-column: 1 / -1;
    }

    .dtf-otp-input {
        letter-spacing: 0.28em !important;
    }
}
