/* 註冊頁：與 login.css 同款設計語言（深空底 + 玻璃擬態卡片 + 靛紫輝光），
   在其上擴展：輸入框內嵌左側圖標 / 右側密碼可見性切換、驗證碼發送按鈕。 */
:root {
    --bg-page: #0b0d12;
    --bg-card: rgba(22, 25, 34, 0.72);
    --bg-input: rgba(12, 14, 20, 0.68);
    --border-faint: rgba(255, 255, 255, 0.08);
    --border-accent: rgba(99, 102, 241, 0.45);
    --text-main: #d5d9e1;
    --text-secondary: #9aa0ac;
    --text-muted: #6e7480;
    --accent-indigo: #6366f1;
    --shadow-1: 0 8px 32px rgba(0, 0, 0, 0.36);
    --shadow-2: 0 12px 48px rgba(0, 0, 0, 0.44);
    --glow-indigo: 0 0 24px rgba(99, 102, 241, 0.18);
}
* { box-sizing: border-box; }
html { color-scheme: dark; }
::selection { background: rgba(99, 102, 241, 0.38); color: #f5f5ff; }
:focus-visible { outline: 2px solid rgba(99, 102, 241, 0.55); outline-offset: 2px; }
body {
    margin: 0; min-height: 100vh;
    display: grid; grid-template-rows: 1fr auto; grid-template-columns: minmax(0, 1fr);
    padding: 20px;
    background:
        radial-gradient(1200px 600px at 10% -10%, rgba(99, 102, 241, 0.12), transparent 60%),
        radial-gradient(1000px 520px at 90% -8%, rgba(34, 211, 238, 0.08), transparent 55%),
        radial-gradient(800px 400px at 50% 110%, rgba(139, 92, 246, 0.08), transparent 55%),
        var(--bg-page);
    color: var(--text-main);
    font: 14px/1.5 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    -webkit-font-smoothing: antialiased;
}
main { width: min(100%, 380px); place-self: center; transform: translateY(-2em); }
/* ---- 品牌標識：LOGO + TVADD.COM（與登入頁同一套：電光信號流） ---- */
.brand { display: flex; align-items: center; justify-content: center; gap: 13px; margin: 0 0 22px; }
.brand-logo {
    width: 40px; height: 44px; display: block; flex: none;
    filter: drop-shadow(0 0 10px rgba(34, 211, 238, 0.32));
    animation: logo-rise 0.7s cubic-bezier(0.22, 1, 0.36, 1) both;
}
@keyframes logo-rise {
    from { opacity: 0; transform: translateY(14px) scale(0.94); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}
/* 天線信號球：電光青呼吸發光（機器人「在線」狀態燈） */
.bot-antenna {
    fill: #22d3ee;
    filter: drop-shadow(0 0 5px rgba(34, 211, 238, 0.75));
    animation: antenna-pulse 2.2s ease-in-out 1s infinite;
}
@keyframes antenna-pulse {
    0%, 100% { opacity: 0.55; filter: drop-shadow(0 0 3px rgba(34, 211, 238, 0.35)); }
    50% { opacity: 1; filter: drop-shadow(0 0 9px rgba(34, 211, 238, 0.95)); }
}
.brand-name { margin: 0; display: flex; gap: 3px; font-size: 24px; font-weight: 700; }
.brand-name span {
    background: linear-gradient(115deg, #eaf7ff 0%, #22d3ee 28%, #818cf8 62%, #eaf7ff 100%);
    background-size: 200% 100%;
    -webkit-background-clip: text; background-clip: text;
    color: transparent;
    filter: drop-shadow(0 0 12px rgba(34, 211, 238, 0.22));
    animation:
        ch-rise 0.5s cubic-bezier(0.22, 1, 0.36, 1) both,
        ch-flow 5.5s linear 0.55s infinite;
}
@keyframes ch-rise {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes ch-flow { to { background-position: -200% 50%; } }
/* 逐字入場節奏（CSP style-src 'self' 禁內聯 style，故用 nth-child） */
.brand-name span:nth-child(1) { animation-delay: 0.05s, 0.55s; }
.brand-name span:nth-child(2) { animation-delay: 0.10s, 0.55s; }
.brand-name span:nth-child(3) { animation-delay: 0.15s, 0.55s; }
.brand-name span:nth-child(4) { animation-delay: 0.20s, 0.55s; }
.brand-name span:nth-child(5) { animation-delay: 0.25s, 0.55s; }
.brand-name span:nth-child(6) { animation-delay: 0.30s, 0.55s; }
.brand-name span:nth-child(7) { animation-delay: 0.35s, 0.55s; }
.brand-name span:nth-child(8) { animation-delay: 0.40s, 0.55s; }
.brand-name span:nth-child(9) { animation-delay: 0.45s, 0.55s; }
/* 信號點呼吸：域名中的「.」如機器人狀態燈 */
.brand-name .dot { animation:
    ch-rise 0.5s cubic-bezier(0.22, 1, 0.36, 1) 0.30s both,
    dot-pulse 2.4s ease-in-out 0.8s infinite,
    ch-flow 5.5s linear 0.55s infinite; }
@keyframes dot-pulse {
    0%, 100% { filter: drop-shadow(0 0 6px rgba(34, 211, 238, 0.15)); }
    50% { filter: drop-shadow(0 0 16px rgba(34, 211, 238, 0.65)); }
}
@media (prefers-reduced-motion: reduce) {
    .brand-logo, .brand-name span { animation: none; opacity: 1; transform: none; }
    .bot-antenna { animation: none; opacity: 1; }
}
form {
    padding: 24px;
    background: var(--bg-card);
    border: 1px solid var(--border-faint);
    border-radius: 20px;
    box-shadow: var(--shadow-1), inset 0 1px 0 rgba(255, 255, 255, 0.04);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}
h2 { margin: 0 0 18px; font-size: 18px; font-weight: 600; text-align: center; color: var(--text-main); }
label { display: block; margin-bottom: 14px; color: var(--text-secondary); }
/* 圖標輸入框：左內邊距給 icon 讓位（icon 絕對定位覆在 field 上） */
.field { position: relative; display: block; }
.field input {
    width: 100%; margin-top: 6px; padding: 10px 40px 10px 38px;
    border: 1px solid var(--border-faint); border-radius: 10px;
    outline: none; background: var(--bg-input); color: var(--text-main);
    font: inherit;
    transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}
.field input:focus {
    border-color: var(--accent-indigo);
    background: rgba(12, 14, 20, 0.85);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
}
.field-icon {
    position: absolute; left: 10px; bottom: 9px;
    width: 18px; height: 18px; fill: var(--text-muted);
    pointer-events: none;
}
.toggle-btn {
    position: absolute; right: 6px; bottom: 5px;
    width: 28px; height: 28px; padding: 0;
    border: none; border-radius: 6px; background: transparent; cursor: pointer;
    box-shadow: none;
}
.toggle-btn svg { width: 18px; height: 18px; fill: var(--text-muted); }
.toggle-btn:hover svg { fill: var(--text-secondary); }
/* 驗證碼發送按鈕：緊貼郵箱框下沿的次級動作按鈕（窄高度右對齊） */
.code-btn {
    width: auto; height: 32px; margin: -6px 0 14px; padding: 0 14px;
    float: right;
    border: 1px solid var(--border-accent); border-radius: 8px;
    background: rgba(99, 102, 241, 0.14);
    color: var(--text-main); font: 500 13px inherit; cursor: pointer;
    box-shadow: none;
    transition: all 0.18s ease;
}
.code-btn:hover { background: rgba(99, 102, 241, 0.26); }
.code-btn:disabled { opacity: .55; cursor: wait; }
form::after { content: ""; display: block; clear: both; }
button[type="submit"] {
    width: 100%; height: 42px; margin-top: 6px;
    border: 1px solid var(--border-accent);
    border-radius: 21px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.28), rgba(139, 92, 246, 0.2));
    color: var(--text-main);
    font: 500 14px inherit;
    letter-spacing: 0.3px;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.16), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    transition: all 0.18s ease;
}
button[type="submit"]:hover {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.4), rgba(139, 92, 246, 0.3));
    box-shadow: 0 6px 18px rgba(99, 102, 241, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.14);
}
button[type="submit"]:active { transform: translateY(1px); filter: brightness(0.92); }
button[type="submit"]:disabled { opacity: .6; cursor: wait; }
#error { min-height: 21px; margin: 0 0 12px; color: #ff6b6b; text-align: center; }
.alt-link { margin: 14px 0 0; text-align: center; color: var(--text-secondary); }
.alt-link a { color: #818cf8; text-decoration: none; transition: color .15s; }
.alt-link a:hover { color: #c7d2fe; }
/* autofill 深色適配（與 login.css 同款） */
input:-webkit-autofill, input:-webkit-autofill:hover, input:-webkit-autofill:focus, input:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 1000px #0e1017 inset !important;
    -webkit-text-fill-color: var(--text-main) !important;
    color: var(--text-main) !important;
    caret-color: var(--text-main);
    transition: background-color 9999s ease-out infinite;
}
.site-footer { width: 100%; min-width: 0; display: flex; justify-content: center; text-align: center; color: var(--text-muted); font-size: 12.5px; padding: 2px 0 0; margin-bottom: 40px; user-select: none; }
.site-footer a { color: #818cf8; text-decoration: none; transition: color .15s; }
.site-footer .footer-tvadd { font-weight: 600; }
.site-footer a:hover { color: #c7d2fe; }
.site-footer .footer-cn { font-size: 1em; }
.site-footer .footer-domain { font-size: 1em; }

/* [S2] 註冊成功後的一次性 webhook secret 展示面板 */
#secret-panel { text-align: center; }
#secret-panel h2 { margin: 0 0 12px; }
#secret-panel p { color: var(--text-secondary); font-size: 13px; line-height: 1.65; }
#secret-panel b { color: #fbbf24; font-weight: 600; }
#webhook-secret-value {
    display: block; margin: 16px auto; padding: 11px 16px; max-width: 100%;
    border: 1px solid var(--border-accent); border-radius: 10px;
    background: rgba(99, 102, 241, 0.12); color: var(--text-main);
    font: 600 14px/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    letter-spacing: .5px; word-break: break-all; user-select: all;
}
#secret-panel .secret-warning { color: #fbbf24; }
#enter-center-btn {
    width: 100%; height: 42px; margin-top: 14px;
    border: 1px solid var(--border-accent); border-radius: 21px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.28), rgba(139, 92, 246, 0.2));
    color: var(--text-main); font: 500 14px inherit; letter-spacing: 0.3px;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.16), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    transition: all 0.18s ease;
}
#enter-center-btn:hover {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.4), rgba(139, 92, 246, 0.3));
    box-shadow: 0 6px 18px rgba(99, 102, 241, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.14);
}
#enter-center-btn:active { transform: translateY(1px); filter: brightness(0.92); }
