/* ==========================================================================
   登录页 — 全局样式
   ========================================================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Roboto, sans-serif;
}

body {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f0faf0;
    padding: 20px;
}

/* ==========================================================================
   Auth Card
   ========================================================================== */

.auth-card {
    background: #ffffff;
    border-radius: 40px;
    padding: 40px 36px;
    width: 100%;
    max-width: 460px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.08), 0 0 0 1px rgba(0, 0, 0, 0.04);
}

/* ==========================================================================
   品牌 Logo
   ========================================================================== */

.brand {
    text-align: center;
    margin-bottom: 28px;
}

.brand i {
    font-size: 42px;
    color: #7c3aed;
    background: rgba(124, 58, 237, 0.08);
    padding: 14px;
    border-radius: 24px;
    margin-bottom: 8px;
}

.brand h1 {
    font-size: 26px;
    font-weight: 700;
    color: #0f172a;
}

.brand p {
    color: #475569;
    font-size: 14px;
}

/* ==========================================================================
   Tabs（保留原有样式，供扩展使用）
   ========================================================================== */

.tabs {
    display: flex;
    gap: 6px;
    background: #f1f5f9;
    border-radius: 60px;
    padding: 6px;
    margin-bottom: 30px;
    border: 1px solid #e2e8f0;
}

.tab-btn {
    flex: 1;
    padding: 10px 0;
    border: none;
    background: transparent;
    border-radius: 40px;
    font-size: 15px;
    font-weight: 600;
    color: #64748b;
    cursor: pointer;
    transition: all 0.3s;
}

.tab-btn i {
    margin-right: 6px;
}

.tab-btn.active {
    background: #7c3aed;
    color: #fff;
    box-shadow: 0 8px 20px rgba(124, 58, 237, 0.3);
}

.tab-btn:hover:not(.active) {
    color: #0f172a;
}

/* ==========================================================================
   表单容器
   ========================================================================== */

.form-container {
    display: block;
}

.form-container.hidden {
    display: none;
}

/* ==========================================================================
   Form Group
   ========================================================================== */

.form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #334155;
    margin-bottom: 5px;
}

.input-wrapper {
    display: flex;
    align-items: center;
    background: #f8fafc;
    border-radius: 16px;
    border: 1.5px solid #d1d5db;
}

.input-wrapper:focus-within {
    border-color: #7c3aed;
    box-shadow: 0 0 0 4px rgba(124, 58, 237, 0.12);
}

.input-wrapper i {
    color: #94a3b8;
    padding: 0 14px;
    font-size: 16px;
}

.input-wrapper input {
    width: 100%;
    padding: 14px 16px 14px 4px;
    background: transparent;
    border: none;
    outline: none;
    font-size: 15px;
    color: #0f172a;
}

.input-wrapper input::placeholder {
    color: #94a3b8;
}

/* ==========================================================================
   验证码行
   ========================================================================== */

.code-row {
    display: flex;
    gap: 10px;
}

.code-row .input-wrapper {
    flex: 1;
}

.code-row .get-code-btn {
    flex-shrink: 0;
    padding: 0 18px;
    background: rgba(124, 58, 237, 0.06);
    color: #7c3aed;
    border: 1.5px solid rgba(124, 58, 237, 0.2);
    border-radius: 16px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    height: 52px;
    white-space: nowrap;
}

.code-row .get-code-btn:hover:not(:disabled) {
    background: rgba(124, 58, 237, 0.12);
    border-color: #7c3aed;
}

.code-row .get-code-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* 验证码显示区 */
.captcha-display {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 104px;
    height: 52px;
    background: repeating-linear-gradient(45deg, #f8fafc, #f8fafc 6px, #eef2ff 6px, #eef2ff 12px);
    border: 1.5px solid #d1d5db;
    border-radius: 16px;
    font-size: 22px;
    font-weight: 800;
    letter-spacing: 4px;
    color: #4c1d95;
    font-family: 'Courier New', monospace;
    font-style: italic;
    cursor: pointer;
    user-select: none;
}

.captcha-display:hover {
    border-color: #7c3aed;
}

/* ==========================================================================
   主按钮
   ========================================================================== */

.btn-primary {
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: 16px;
    background: linear-gradient(135deg, #7c3aed, #6d28d9);
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 6px 20px rgba(124, 58, 237, 0.25);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 28px rgba(124, 58, 237, 0.35);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* ==========================================================================
   消息提示
   ========================================================================== */

.message {
    margin-top: 16px;
    padding: 12px 16px;
    border-radius: 14px;
    font-size: 14px;
    font-weight: 500;
    display: none;
    align-items: center;
    gap: 10px;
}

.message.success {
    display: flex;
    background: #ecfdf5;
    color: #065f46;
    border: 1px solid #d1fae5;
}

.message.error {
    display: flex;
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.message.info {
    display: flex;
    background: #eff6ff;
    color: #1e40af;
    border: 1px solid #bfdbfe;
}

/* ==========================================================================
   工具类
   ========================================================================== */

.text-center {
    text-align: center;
}

.mt-2 {
    margin-top: 8px;
}

.text-sm {
    font-size: 13px;
    color: #475569;
}

.text-sm a {
    color: #7c3aed;
    text-decoration: none;
    font-weight: 600;
    cursor: pointer;
}

.text-sm a:hover {
    text-decoration: underline;
}

/* ==========================================================================
   Spinner
   ========================================================================== */

.spinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2.5px solid rgba(0, 0, 0, 0.1);
    border-top-color: #7c3aed;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    vertical-align: middle;
    margin-right: 6px;
}

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

/* ==========================================================================
   下线弹窗
   ========================================================================== */

.offline-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 999;
}

.offline-overlay.show {
    display: flex;
}

.offline-box {
    background: #fff;
    padding: 28px 28px 22px;
    border-radius: 22px;
    max-width: 360px;
    width: 90%;
    text-align: center;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
    animation: pop 0.2s ease-out;
}

@keyframes pop {
    from { transform: scale(0.92); opacity: 0; }
    to   { transform: scale(1);    opacity: 1; }
}

.offline-box .offline-icon {
    font-size: 36px;
    color: #ef4444;
    margin-bottom: 10px;
}

.offline-box .offline-title {
    font-size: 17px;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 8px;
}

.offline-box .offline-message {
    font-size: 14px;
    color: #475569;
    line-height: 1.5;
    margin-bottom: 22px;
    word-break: break-word;
}

.offline-box .offline-btn {
    padding: 10px 28px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    border: none;
    background: linear-gradient(135deg, #7c3aed, #6d28d9);
    color: #fff;
    box-shadow: 0 6px 18px rgba(124, 58, 237, 0.3);
}

.offline-box .offline-btn:hover {
    opacity: 0.9;
}

/* ==========================================================================
   响应式
   ========================================================================== */

@media (max-width: 500px) {
    .auth-card {
        padding: 28px 18px;
        border-radius: 28px;
    }
    .code-row {
        flex-wrap: wrap;
    }
    .code-row .get-code-btn {
        width: 100%;
        height: 46px;
    }
    .captcha-display {
        width: 100%;
    }
}