.mall-login-modal {
    position: fixed;
    inset: 0;
    z-index: 10200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.mall-login-modal[hidden] {
    display: none;
}

.mall-login-modal__mask {
    position: absolute;
    inset: 0;
    z-index: 0;
    background: rgba(15, 23, 42, 0.48);
    backdrop-filter: blur(2px);
}

.mall-login-modal__panel {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 400px;
    padding: 28px 24px 24px;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 20px 48px rgba(15, 23, 42, 0.18);
}

html[data-theme="dark"] .mall-login-modal__panel {
    background: #262626;
    box-shadow: 0 20px 48px rgba(0, 0, 0, 0.45);
}

.mall-login-modal__close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--mall-text-secondary);
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
}

.mall-login-modal__close:hover {
    background: rgba(148, 163, 184, 0.16);
    color: var(--mall-text);
}

.mall-login-modal__title {
    margin: 0 0 20px;
    font-size: 22px;
    color: var(--mall-text);
    text-align: center;
}

.mall-login-modal__desc {
    margin: 0 0 20px;
    color: var(--mall-text-secondary);
    font-size: 14px;
}

.mall-login-modal__error {
    margin-bottom: 16px;
    padding: 10px 12px;
    border-radius: 8px;
    background: #fef2f2;
    color: #b91c1c;
    font-size: 13px;
}

html[data-theme="dark"] .mall-login-modal__error {
    background: rgba(185, 28, 28, 0.18);
    color: #fca5a5;
}

.mall-login-modal__error[hidden] {
    display: none;
}

.mall-login-modal .mall-login-field label {
    color: var(--mall-text-secondary);
}

.mall-login-modal .mall-login-field input {
    background: var(--mall-bg-soft, #fff);
    color: var(--mall-text);
    border-color: var(--mall-border, #e5e7eb);
}

.mall-login-modal .mall-login-field input::placeholder {
    color: var(--mall-text-muted);
}

body.mall-login-modal-open {
    overflow: hidden;
}

.mall-auth-mode-tabs,
.mall-auth-method-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.mall-auth-mode-tabs {
    padding: 4px;
    border-radius: 10px;
    background: rgba(148, 163, 184, 0.12);
}

.mall-auth-mode-tabs__btn {
    flex: 1;
    height: 36px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--mall-text-secondary);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

.mall-auth-mode-tabs__btn.is-active {
    background: #fff;
    color: var(--mall-text);
    box-shadow: 0 1px 4px rgba(15, 23, 42, 0.08);
}

html[data-theme="dark"] .mall-auth-mode-tabs__btn.is-active {
    background: #333;
    color: #f5f5f5;
}

.mall-auth-method-tabs {
    flex-wrap: wrap;
}

.mall-auth-method-tabs__btn {
    flex: 1;
    min-width: 88px;
    height: 34px;
    padding: 0 8px;
    border: 1px solid var(--mall-border, #e5e7eb);
    border-radius: 8px;
    background: transparent;
    color: var(--mall-text-secondary);
    font-size: 12px;
    cursor: pointer;
}

.mall-auth-method-tabs__btn.is-active {
    border-color: #ef4444;
    color: #ef4444;
    background: rgba(239, 68, 68, 0.06);
}

.mall-auth-panel[hidden],
.mall-auth-panel:not(.is-active) {
    display: none;
}

.mall-auth-panel.is-active {
    display: block;
}

.mall-auth-code-row {
    display: flex;
    gap: 8px;
}

.mall-auth-code-row input {
    flex: 1;
    min-width: 0;
}

.mall-auth-code-btn {
    flex-shrink: 0;
    height: 44px;
    padding: 0 12px;
    border: 1px solid var(--mall-border, #e5e7eb);
    border-radius: 10px;
    background: var(--mall-bg-soft, #fff);
    color: var(--mall-text);
    font-size: 13px;
    white-space: nowrap;
    cursor: pointer;
}

.mall-auth-code-btn:hover:not(:disabled) {
    border-color: #ef4444;
    color: #ef4444;
}

.mall-auth-code-btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.mall-auth-hint {
    margin: 12px 0 0;
    color: var(--mall-text-secondary);
    font-size: 12px;
    text-align: center;
}

.mall-auth-hint strong {
    color: #ef4444;
    font-weight: 600;
}

.mall-login-modal__panel {
    max-width: 420px;
}

.mall-login-card .mall-auth-mode-tabs,
.mall-login-card .mall-auth-method-tabs,
.mall-login-card .mall-auth-hint {
    /* shared with login page */
}

.mall-login-card .mall-login-field input {
    width: 100%;
    height: 44px;
    padding: 0 12px;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    font-size: 14px;
    box-sizing: border-box;
}

.mall-login-card .mall-auth-code-row input {
    width: auto;
}

html[data-theme="dark"] .mall-login-card .mall-login-field input,
html[data-theme="dark"] .mall-login-modal .mall-login-field input,
html[data-theme="dark"] .mall-auth-code-btn {
    background: #1f1f1f;
    border-color: #404040;
    color: #f5f5f5;
}

html[data-theme="dark"] .mall-login-modal .mall-login-field input::placeholder {
    color: #737373;
}

html[data-theme="dark"] .mall-login-modal .mall-login-field label {
    color: #d4d4d4;
}

html[data-theme="dark"] .mall-auth-method-tabs__btn {
    color: #d4d4d4;
    border-color: #404040;
}

html[data-theme="dark"] .mall-auth-method-tabs__btn.is-active {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.12);
}
