/* ============================================================
   ThemeBest Custom Login — tbl-login.css v2.0
   现代风格：渐变背景 + Glassmorphism 面板 + 精致交互
   ============================================================ */

/* ── Reset & Base ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --accent:       #6366f1;
    --accent-dark:  #4f46e5;
    --accent-light: #818cf8;
    --success:      #22c55e;
    --danger:       #ef4444;
    --danger-bg:    #fef2f2;
    --text-primary: #0f172a;
    --text-secondary: #64748b;
    --text-muted:   #94a3b8;
    --border:       rgba(255,255,255,0.18);
    --border-focus: #6366f1;
    --bg-glass:     rgba(255,255,255,0.75);
    --bg-input:     rgba(255,255,255,0.9);
    --shadow-sm:    0 1px 3px rgba(0,0,0,.08);
    --shadow-md:    0 4px 24px rgba(0,0,0,.10);
    --shadow-lg:    0 20px 60px rgba(0,0,0,.18);
    --radius:       14px;
    --radius-sm:    8px;
    --radius-xs:    6px;
    --transition:   0.2s ease;
}

html, body { height: 100%; }

body.tbl-body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC',
                 'Microsoft YaHei', sans-serif;
    font-size: 15px;
    line-height: 1.6;
    color: var(--text-primary);
    background: #0f172a;
    min-height: 100vh;
}

/* ── Layout ───────────────────────────────────────────────── */
.tbl-wrap {
    display: flex;
    min-height: 100vh;
}

/* ── Promo (Left) ─────────────────────────────────────────── */
.tbl-promo {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1e1b4b 0%, #312e81 40%, #4c1d95 100%);
    background-size: cover;
    background-position: center;
    overflow: hidden;
    padding: 60px 48px;
}

.tbl-promo-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg,
        rgba(99,102,241,.85) 0%,
        rgba(139,92,246,.75) 50%,
        rgba(79,70,229,.9) 100%);
}

/* 动态装饰圆 */
.tbl-promo::before,
.tbl-promo::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    opacity: .15;
    animation: float 6s ease-in-out infinite;
}
.tbl-promo::before {
    width: 400px; height: 400px;
    background: radial-gradient(circle, #fff 0%, transparent 70%);
    top: -100px; right: -100px;
}
.tbl-promo::after {
    width: 300px; height: 300px;
    background: radial-gradient(circle, #818cf8 0%, transparent 70%);
    bottom: -80px; left: -60px;
    animation-delay: -3s;
}

@keyframes float {
    0%, 100% { transform: translateY(0) scale(1); }
    50%       { transform: translateY(-20px) scale(1.05); }
}

.tbl-promo-content {
    position: relative;
    z-index: 1;
    color: #fff;
    max-width: 420px;
    width: 100%;
}

.tbl-promo-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 48px;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
    opacity: .85;
}

.tbl-brand-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(255,255,255,.3);
}

.tbl-promo-title {
    font-size: clamp(26px, 3vw, 36px);
    font-weight: 800;
    line-height: 1.25;
    margin-bottom: 20px;
    letter-spacing: -.02em;
}

.tbl-promo-desc {
    font-size: 15px;
    line-height: 1.75;
    opacity: .85;
    margin-bottom: 40px;
}

.tbl-qr-wrap {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 32px;
    font-size: 13px;
    opacity: .9;
}

.tbl-qr {
    width: 80px; height: 80px;
    border-radius: var(--radius-sm);
    background: #fff;
    padding: 6px;
    object-fit: contain;
}

.tbl-btn-ghost {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border: 1.5px solid rgba(255,255,255,.5);
    border-radius: 100px;
    color: #fff;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    backdrop-filter: blur(8px);
    background: rgba(255,255,255,.12);
    transition: all var(--transition);
}
.tbl-btn-ghost:hover {
    background: rgba(255,255,255,.22);
    border-color: rgba(255,255,255,.8);
    transform: translateY(-1px);
}
.tbl-btn-ghost svg { width: 16px; height: 16px; }

/* ── Panel (Right) ────────────────────────────────────────── */
.tbl-panel {
    width: 500px;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8faff;
    padding: 48px 24px;
}

.tbl-panel-inner {
    width: 100%;
    max-width: 400px;
}

/* ── Heading ──────────────────────────────────────────────── */
.tbl-heading {
    margin-bottom: 36px;
}

.tbl-heading-title {
    font-size: 28px;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -.03em;
    line-height: 1.2;
    margin-bottom: 8px;
}

.tbl-heading-desc {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* ── Alerts ───────────────────────────────────────────────── */
.tbl-alert {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-size: 13.5px;
    line-height: 1.5;
    margin-bottom: 20px;
}
.tbl-alert svg { width: 16px; height: 16px; flex-shrink: 0; margin-top: 1px; }

.tbl-alert-error {
    background: var(--danger-bg);
    color: #b91c1c;
    border: 1px solid #fecaca;
}
.tbl-alert-success {
    background: #f0fdf4;
    color: #15803d;
    border: 1px solid #bbf7d0;
}

/* ── Form Fields ──────────────────────────────────────────── */
.tbl-field {
    margin-bottom: 18px;
}

.tbl-label {
    display: block;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 7px;
    letter-spacing: .01em;
}

.tbl-label-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 7px;
}
.tbl-label-row .tbl-label { margin-bottom: 0; }

.tbl-forgot-link {
    font-size: 12.5px;
    color: var(--accent);
    text-decoration: none;
    font-weight: 500;
    transition: color var(--transition);
}
.tbl-forgot-link:hover { color: var(--accent-dark); }

.tbl-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.tbl-input-icon {
    position: absolute;
    left: 14px;
    width: 17px; height: 17px;
    color: var(--text-muted);
    pointer-events: none;
    flex-shrink: 0;
}

.tbl-input {
    width: 100%;
    height: 46px;
    padding: 0 14px 0 42px;
    background: #fff;
    border: 1.5px solid #e2e8f0;
    border-radius: var(--radius-sm);
    font-size: 14px;
    color: var(--text-primary);
    outline: none;
    transition: border-color var(--transition), box-shadow var(--transition);
    -webkit-appearance: none;
}
.tbl-input::placeholder { color: var(--text-muted); }
.tbl-input:hover { border-color: #cbd5e1; }
.tbl-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(99,102,241,.14);
}

/* field without icon */
.tbl-input.no-icon { padding-left: 14px; }

/* error state */
.tbl-field-has-error .tbl-input {
    border-color: var(--danger) !important;
    box-shadow: 0 0 0 3px rgba(239,68,68,.12) !important;
}
.tbl-field-has-error .tbl-input-icon { color: var(--danger); }

.tbl-field-error {
    margin-top: 5px;
    font-size: 12.5px;
    color: var(--danger);
    line-height: 1.4;
}

/* ── Eye Toggle ───────────────────────────────────────────── */
.tbl-eye-btn {
    position: absolute;
    right: 12px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    transition: color var(--transition);
}
.tbl-eye-btn:hover { color: var(--text-secondary); }
.tbl-eye-icon { width: 18px; height: 18px; }

/* ── Captcha Row ──────────────────────────────────────────── */
.tbl-captcha-row {
    display: flex;
    gap: 10px;
    align-items: stretch;
}

.tbl-captcha-input-wrap {
    flex: 1;
}

.tbl-captcha-display {
    flex-shrink: 0;
    width: 120px;
    height: 46px;
    background: linear-gradient(135deg, #f1f5fe, #e8eeff);
    border: 1.5px solid #c7d2fe;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    cursor: pointer;
    user-select: none;
    transition: all var(--transition);
    font-family: 'Courier New', monospace;
    font-size: 18px;
    font-weight: 700;
    letter-spacing: .12em;
    color: var(--accent-dark);
}
.tbl-captcha-display:hover {
    background: linear-gradient(135deg, #e0e7ff, #dbeafe);
    border-color: var(--accent);
}
.tbl-captcha-refresh {
    width: 14px; height: 14px;
    color: var(--accent-light);
    flex-shrink: 0;
    transition: transform var(--transition);
}
.tbl-captcha-display:hover .tbl-captcha-refresh { transform: rotate(180deg); }

/* ── Email Code Row ───────────────────────────────────────── */
.tbl-code-row {
    display: flex;
    gap: 10px;
    align-items: stretch;
}
.tbl-code-input-wrap { flex: 1; }

.tbl-btn-code {
    flex-shrink: 0;
    height: 46px;
    padding: 0 16px;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: all var(--transition);
}
.tbl-btn-code:hover:not(:disabled) { background: var(--accent-dark); }
.tbl-btn-code:disabled {
    background: #cbd5e1;
    cursor: not-allowed;
}

/* ── Submit Button ────────────────────────────────────────── */
.tbl-btn-submit {
    width: 100%;
    height: 50px;
    margin-top: 8px;
    background: linear-gradient(135deg, var(--accent), var(--accent-dark));
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 15.5px;
    font-weight: 700;
    letter-spacing: .04em;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: all var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 4px 14px rgba(99,102,241,.38);
}
.tbl-btn-submit::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(255,255,255,0);
    transition: background var(--transition);
}
.tbl-btn-submit:hover::before { background: rgba(255,255,255,.08); }
.tbl-btn-submit:active { transform: scale(.98); }
.tbl-btn-submit:disabled {
    opacity: .7;
    cursor: not-allowed;
    transform: none;
}

.tbl-btn-loading {
    display: none;
    width: 16px; height: 16px;
    border: 2px solid rgba(255,255,255,.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin .7s linear infinite;
}
.tbl-btn-submit.tbl-is-loading .tbl-btn-text { opacity: 0; }
.tbl-btn-submit.tbl-is-loading .tbl-btn-loading { display: block; }

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

/* ── Footer / Links ───────────────────────────────────────── */
.tbl-footer-text {
    margin-top: 20px;
    text-align: center;
    font-size: 13.5px;
    color: var(--text-secondary);
}

.tbl-link {
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
    transition: color var(--transition);
}
.tbl-link:hover { color: var(--accent-dark); text-decoration: underline; }

.tbl-copyright {
    margin-top: 32px;
    text-align: center;
    font-size: 12px;
    color: var(--text-muted);
}

/* ── Form hint ────────────────────────────────────────────── */
.tbl-form-hint {
    font-size: 13.5px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 20px;
    padding: 12px 14px;
    background: #f1f5f9;
    border-radius: var(--radius-xs);
    border-left: 3px solid var(--accent-light);
}

/* ── Info Box (checkemail) ────────────────────────────────── */
.tbl-info-box {
    background: #fff;
    border: 1.5px solid #e2e8f0;
    border-radius: var(--radius);
    padding: 36px 28px;
    text-align: center;
    margin-bottom: 20px;
}

.tbl-info-icon {
    width: 64px; height: 64px;
    background: #eef2ff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
}
.tbl-info-icon svg {
    width: 30px; height: 30px;
    color: var(--accent);
    stroke-width: 1.5;
}

.tbl-info-box h2 {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 12px;
}
.tbl-info-box p {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 8px;
}
.tbl-info-note {
    font-size: 12.5px !important;
    color: var(--text-muted) !important;
    font-style: italic;
}

/* ── Notice (registration closed) ────────────────────────── */
.tbl-notice {
    padding: 16px;
    background: #fefce8;
    border: 1px solid #fef08a;
    border-radius: var(--radius-xs);
    font-size: 14px;
    color: #854d0e;
    margin-bottom: 20px;
}

/* ── Native Validation Styling ────────────────────────────── */
/* 让浏览器原生 :invalid 提示更美观 */
.tbl-input:not(:placeholder-shown):invalid {
    border-color: var(--danger);
}

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 900px) {
    .tbl-promo { display: none; }
    .tbl-panel {
        width: 100%;
        background: linear-gradient(160deg, #ede9fe 0%, #f8faff 60%);
    }
}

@media (max-width: 480px) {
    .tbl-panel { padding: 32px 20px; }
    .tbl-panel-inner { max-width: 100%; }
    .tbl-heading-title { font-size: 24px; }
    .tbl-captcha-display { width: 100px; font-size: 16px; }
}
