/* 2026-09-XX v11.1 advisor-chat-v1: 全局 注册 / 登录 modal 样式.
 *
 * 设计原则:
 * - 主蓝主题色 (#667eea 紫蓝渐变, #026eb7 强调蓝), 跟全站主色一致
 * - 复用 home-tinder-modal 的视觉语言 (已经在首页用), 保持品牌一致性
 * - modal 居中 + backdrop 模糊, 移动端友好
 * - tab 切换用底部 border 标识 active 态, 不依赖背景色 (减少视觉噪音)
 */

.auth-modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.auth-modal-backdrop {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(2px);
}

.auth-modal-content {
    position: relative;
    background: #fff;
    border-radius: 14px;
    padding: 28px 28px 22px;
    max-width: 400px;
    width: 100%;
    box-shadow: 0 24px 60px rgba(2, 6, 23, 0.22);
    animation: authModalIn 0.18s ease-out;
    max-height: calc(100vh - 32px);
    overflow-y: auto;
}

@keyframes authModalIn {
    from { opacity: 0; transform: translateY(-12px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.auth-modal-close {
    position: absolute;
    top: 10px;
    right: 14px;
    background: transparent;
    border: 0;
    font-size: 24px;
    color: #6b7280;
    cursor: pointer;
    line-height: 1;
    padding: 4px 8px;
    border-radius: 4px;
    transition: background 0.15s;
}
.auth-modal-close:hover {
    background: #f3f4f6;
    color: #1f2937;
}

.auth-modal h3 {
    margin: 0 0 8px;
    font-size: 18px;
    font-weight: 600;
    color: #1f2937;
    padding-right: 28px;
}

.auth-modal-intro {
    margin: 0 0 18px;
    font-size: 13px;
    color: #6b7280;
    line-height: 1.55;
}

.auth-modal-tabs {
    display: flex;
    border-bottom: 1px solid #e5e7eb;
    margin-bottom: 16px;
}

.auth-modal-tab {
    flex: 1;
    padding: 8px 12px;
    background: transparent;
    border: 0;
    border-bottom: 2px solid transparent;
    font-size: 14px;
    font-weight: 500;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.15s;
}
.auth-modal-tab:hover { color: #026eb7; }
.auth-modal-tab.active {
    color: #026eb7;
    border-bottom-color: #026eb7;
    font-weight: 600;
}

.auth-modal-field {
    margin-bottom: 12px;
}
.auth-modal-field label {
    display: block;
    font-size: 12px;
    color: #4b5563;
    margin-bottom: 6px;
    font-weight: 500;
}
.auth-modal-field input {
    width: 100%;
    box-sizing: border-box;
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    background: #fff;
    color: #1f2937;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.auth-modal-field input:focus {
    border-color: #026eb7;
    box-shadow: 0 0 0 3px rgba(2, 110, 183, 0.12);
}

.auth-modal-code-row {
    display: flex;
    gap: 8px;
    align-items: stretch;
}
.auth-modal-code-row input {
    flex: 1;
}
.auth-modal-sendcode {
    flex-shrink: 0;
    padding: 0 14px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border: 0;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: opacity 0.15s;
}
.auth-modal-sendcode:hover { opacity: 0.92; }
.auth-modal-sendcode:disabled {
    background: #cbd5e1;
    cursor: not-allowed;
    opacity: 0.7;
}

.auth-modal-hint {
    min-height: 18px;
    margin: 4px 0 8px;
    font-size: 12px;
    line-height: 1.5;
    color: #ef4444;
}
.auth-modal-hint.ok { color: #10b981; }
.auth-modal-hint.info { color: #026eb7; }

.auth-modal-footer {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

.auth-modal-btn-cancel,
.auth-modal-btn-submit {
    flex: 1;
    padding: 10px 16px;
    border: 0;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
}
.auth-modal-btn-cancel {
    background: #f3f4f6;
    color: #4b5563;
}
.auth-modal-btn-cancel:hover { background: #e5e7eb; }

.auth-modal-btn-submit {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
}
.auth-modal-btn-submit:hover { opacity: 0.92; }
.auth-modal-btn-submit:disabled {
    background: #cbd5e1;
    cursor: not-allowed;
    opacity: 0.6;
}

/* 移动端适配 */
@media (max-width: 480px) {
    .auth-modal-content {
        padding: 22px 20px 18px;
        max-width: 100%;
    }
    .auth-modal h3 { font-size: 16px; }
}
