/* ================================================================
   auth.css — 會員系統專用樣式
   包含：登入 / 註冊 / 會員中心
================================================================ */

/* ─── Auth 頁面背景 ──────────────────────────────────────────── */
.auth-body {
    background:
        radial-gradient(ellipse at 20% 30%, rgba(90,106,255,.12) 0%, transparent 60%),
        radial-gradient(ellipse at 80% 70%, rgba(52,211,153,.07) 0%, transparent 60%),
        var(--bg-base);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
}

/* ─── Auth 包覆層 ────────────────────────────────────────────── */
.auth-wrap {
    width: 100%;
    max-width: 440px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.25rem;
}

/* ─── Logo ───────────────────────────────────────────────────── */
.auth-logo {
    display: flex;
    align-items: center;
    gap: .5rem;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
    text-decoration: none;
    margin-bottom: .25rem;
}

.auth-logo:hover { color: var(--accent); }

.auth-alert { width: 100%; }

/* ─── Auth 卡片 ──────────────────────────────────────────────── */
.auth-card {
    width: 100%;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 8px 40px rgba(0,0,0,.4);
}

.auth-card-header {
    margin-bottom: 1.75rem;
    text-align: center;
}

.auth-title {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: .35rem;
}

.auth-subtitle {
    font-size: .875rem;
    color: var(--text-secondary);
}

.auth-subtitle a {
    color: var(--accent);
    font-weight: 600;
}

/* ─── 眼睛切換密碼顯示 ───────────────────────────────────────── */
.input-eye-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.input-eye-wrap .input {
    padding-right: 2.75rem;
}

.eye-btn {
    position: absolute;
    right: .6rem;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    opacity: .5;
    transition: opacity .15s;
    padding: .25rem;
    line-height: 1;
    color: var(--text-secondary);
}

.eye-btn:hover { opacity: 1; }

/* ─── 欄位錯誤訊息 ───────────────────────────────────────────── */
.field-error {
    display: block;
    font-size: .78rem;
    color: var(--danger);
    margin-top: .25rem;
}

.form-group.has-error .input {
    border-color: var(--danger);
}

.form-group.has-error .input:focus {
    border-color: var(--danger);
    box-shadow: 0 0 0 2px rgba(248,113,113,.2);
}

/* ─── 密碼強度條 ─────────────────────────────────────────────── */
.pwd-strength {
    height: 3px;
    background: var(--border);
    border-radius: 99px;
    margin-top: .4rem;
    overflow: hidden;
}

.pwd-bar {
    height: 100%;
    width: 0%;
    border-radius: 99px;
    transition: width .3s ease, background .3s ease;
}

/* ─── 全寬按鈕 ───────────────────────────────────────────────── */
.btn-full {
    width: 100%;
    justify-content: center;
    margin-top: .5rem;
    padding: .7rem 1rem;
    font-size: 1rem;
}

/* ─── 分隔線 ─────────────────────────────────────────────────── */
.auth-divider {
    border: none;
    border-top: 1px solid var(--border);
    margin: 1.25rem 0 .75rem;
}

.auth-hint {
    font-size: .8rem;
    color: var(--text-muted);
    text-align: center;
}

/* ─── 會員中心（auth layout 內） ────────────────────────────── */

/* 會員中心使用 auth layout 但需要更寬的容器 */
.auth-body.member-body {
    justify-content: flex-start;
    padding-top: 2rem;
}

.auth-body .auth-wrap.member-wrap {
    max-width: 900px;
    align-items: stretch;
}

/* ─── 歡迎橫幅 ───────────────────────────────────────────────── */
.member-banner {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem 2rem;
    display: flex;
    align-items: center;
    gap: 1.25rem;
    margin-bottom: 1.5rem;
}

.member-avatar {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), var(--success));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    font-weight: 800;
    color: #fff;
    flex-shrink: 0;
}

.member-banner-info { flex: 1; }

.member-name {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: .2rem;
}

.member-meta {
    font-size: .85rem;
    color: var(--text-secondary);
}

/* ─── 會員統計卡片 ───────────────────────────────────────────── */
.member-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    margin-bottom: 1.75rem;
}

.member-stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.1rem 1.4rem;
    transition: border-color var(--transition);
}

.member-stat-card:hover { border-color: var(--border-focus); }
.member-stat-card.accent { border-color: rgba(90,106,255,.4); }

.ms-label {
    font-size: .75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: .06em;
    margin-bottom: .4rem;
}

.ms-value {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1;
}

.member-stat-card.accent .ms-value { color: var(--accent); }

/* ─── 在 auth layout 中顯示 section ──────────────────────────── */
.auth-body .section { width: 100%; margin-bottom: 1.5rem; }
.auth-body .section-title { font-size: 1rem; }
.auth-body .card { margin-bottom: 0; }
.auth-body .table-wrapper { border-radius: var(--radius); }

/* ─── RWD ────────────────────────────────────────────────────── */
@media (max-width: 600px) {
    .auth-card { padding: 1.5rem 1.25rem; }
    .member-banner { flex-wrap: wrap; gap: 1rem; }
    .member-stats { grid-template-columns: 1fr 1fr; }
}
