/* ---------- Backdrop ---------- */
.dh-login-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2147483640;
    animation: dh-login-fadein 0.15s ease-out;
}

.dh-login-backdrop.dh-login-closing {
    animation: dh-login-fadeout 0.12s ease-in forwards;
}

/* ---------- Box ---------- */
.dh-login-box {
    background: #fff;
    border-radius: 12px;
    max-width: 460px;
    width: 90%;
    padding: 32px 32px 28px;
    position: relative;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18);
    animation: dh-login-fadein 0.15s ease-out;
}

/* ---------- Close button ---------- */
.dh-login-close {
    position: absolute;
    top: 12px;
    right: 14px;
    width: 32px;
    height: 32px;
    border: 1px solid #ccc;
    border-radius: 9px;
    background: #f0f0f0;
    color: #D11D8D;
    font-size: 20px;
    line-height: 30px;
    text-align: center;
    cursor: pointer;
    padding: 0;
    transition: background 0.15s, color 0.15s;
}

.dh-login-close:hover {
    background: #e0e0e0;
    color: #a0156e;
}

/* ---------- Header ---------- */
.dh-login-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-bottom: 16px;
    border-bottom: 2px solid #811DD1;
    margin-bottom: 20px;
}

.dh-login-dexy {
    width: 48px;
    height: auto;
    border-radius: 50%;
    cursor: pointer;
    transition: transform 0.15s;
}

.dh-login-dexy:hover {
    transform: scale(1.1);
}

.dh-login-title {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 600;
    color: #811DD1;
}

.dh-login-subtitle {
    margin: 0 0 16px;
    font-size: 0.9rem;
    color: #666;
}

/* ---------- Form ---------- */
.dh-login-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.dh-login-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.dh-login-field label {
    font-size: 0.85rem;
    font-weight: 600;
    color: #333;
}

.dh-login-field input[type="text"],
.dh-login-field input[type="password"],
.dh-login-field input[type="tel"] {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid #ddd;
    border-radius: 9px;
    font-size: 0.95rem;
    transition: border-color 0.15s, box-shadow 0.15s;
    box-sizing: border-box;
}

.dh-login-field input:focus {
    outline: none;
    border-color: #811DD1;
    box-shadow: 0 0 0 3px rgba(129, 29, 209, 0.15);
}

/* ---------- Password wrapper ---------- */
.dh-login-pw-wrap {
    position: relative;
}

.dh-login-pw-wrap input {
    padding-right: 42px;
}

.dh-login-pw-toggle {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: #999;
    font-size: 18px;
    padding: 4px;
    line-height: 1;
}

.dh-login-pw-toggle:hover {
    color: #811DD1;
}

/* ---------- Remember me ---------- */
.dh-login-remember {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: #555;
}

.dh-login-remember input[type="checkbox"] {
    accent-color: #811DD1;
}

/* ---------- Submit button ---------- */
.dh-login-submit {
    background: #811DD1;
    color: #fff;
    border: none;
    border-radius: 9px;
    padding: 12px 24px;
    font-size: 0.95rem;
    font-weight: 600;
    text-transform: lowercase;
    cursor: pointer;
    transition: background 0.15s;
    position: relative;
}

.dh-login-submit:hover:not(:disabled) {
    background: #D11D8D;
}

.dh-login-submit:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.dh-login-submit .dh-spinner-inline {
    display: inline-block;
    width: 18px;
    height: 18px;
    margin-left: 8px;
    vertical-align: middle;
}

/* ---------- Error message ---------- */
.dh-login-error {
    background: #fef2f2;
    border: 1px solid #fca5a5;
    border-radius: 9px;
    padding: 10px 14px;
    font-size: 0.85rem;
    color: #991b1b;
    display: none;
}

.dh-login-error.visible {
    display: block;
    animation: dh-login-fadein 0.15s ease-out;
}

/* ---------- Footer links ---------- */
.dh-login-links {
    margin-top: 4px;
    font-size: 0.85rem;
    text-align: center;
}

.dh-login-links a {
    color: #811DD1;
    text-decoration: none;
}

.dh-login-links a:hover {
    color: #D11D8D;
    text-decoration: underline;
}

/* ---------- 2FA code input ---------- */
.dh-login-code-input {
    text-align: center;
    font-family: monospace;
    font-size: 1.4rem;
    letter-spacing: 0.3em;
    padding: 12px !important;
}

/* ---------- Form transitions ---------- */
.dh-login-form-enter {
    animation: dh-login-slidein 0.2s ease-out;
}

/* ---------- Animations ---------- */
@keyframes dh-login-fadein {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

@keyframes dh-login-fadeout {
    from { opacity: 1; transform: scale(1); }
    to { opacity: 0; transform: scale(0.95); }
}

@keyframes dh-login-slidein {
    from { opacity: 0; transform: translateX(12px); }
    to { opacity: 1; transform: translateX(0); }
}

/* ---------- Responsive ---------- */
@media (max-width: 480px) {
    .dh-login-box {
        width: 95%;
        padding: 20px 16px 16px;
    }

    .dh-login-dexy {
        width: 36px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .dh-login-backdrop,
    .dh-login-box,
    .dh-login-error.visible,
    .dh-login-form-enter,
    .dh-login-backdrop.dh-login-closing {
        animation: none !important;
    }
}
