/* ====================================================
   auth.css  —  登入 / 註冊頁面樣式
   適用: register.html（獨立頁面，不繼承 base.html）
   ==================================================== */

*, *::before, *::after { box-sizing: border-box; }

:root {
    --bg:        #f7f4ef;
    --surface:   #fff;
    --text:      #3a3128;
    --muted:     #9b8e83;
    --border:    #e0d8cf;
    --accent:    #8b6f5e;
    --accent-lt: #f2ece6;
    --green:     #5c7a5f;
    --green-lt:  #edf3ee;
    --red:       #a05252;
    --red-lt:    #fbeaea;
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: 'Noto Sans TC', sans-serif;
    margin: 0;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.container { width: 100%; max-width: 520px; }

/* ── Logo 區 ── */
.logo-area { text-align: center; margin-bottom: 28px; }
.logo-area .icon {
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 10px;
    width: 56px; height: 56px;
    background: var(--accent-lt);
    border-radius: 50%;
    color: var(--accent);
}
.logo-area .icon svg { width: 28px; height: 28px; }
.logo-area h1 { font-family: 'Noto Serif TC', serif; font-size: 22px; color: var(--text); margin: 10px 0 6px; }
.logo-area p  { color: var(--muted); font-size: 14px; margin: 0; }

/* ── Card ── */
.card { background: var(--surface); border-radius: 12px; border: 1px solid var(--border); overflow: hidden; }
.card-section { padding: 24px 28px; }
.card-section + .card-section { border-top: 1px solid var(--border); }
.section-label { font-size: 12px; font-weight: 700; color: var(--muted); letter-spacing: 0.04em; margin-bottom: 14px; }

/* ── Form ── */
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 5px; font-weight: 600; }
.field input,
.field select,
.field textarea {
    width: 100%; padding: 9px 13px;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    outline: none;
    color: var(--text);
    background: var(--surface);
    transition: border-color .2s;
}
.field input:focus,
.field select:focus,
.field textarea:focus { border-color: var(--accent); }
.field input.input-error,
.field select.input-error,
.field textarea.input-error {
    border-color: var(--red);
    box-shadow: 0 0 0 3px rgba(160,82,82,.12);
}
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.required { color: var(--red); }
.error-msg {
    background: var(--red-lt); color: var(--red);
    border-radius: 8px; padding: 10px 14px;
    font-size: 13px; margin-bottom: 16px;
    border: 1px solid var(--red);
}

/* ── 公司選項卡 ── */
.type-cards { display: flex; flex-direction: column; gap: 10px; }
.type-option { display: flex; flex-direction: column; }
.type-card {
    position: relative;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    padding: 12px 14px;
    cursor: pointer;
    transition: border-color .2s, background .2s, box-shadow .2s, border-radius .2s;
}
.type-card:hover, .type-card.selected {
    border-color: var(--accent);
    background: var(--accent-lt);
    box-shadow: 0 0 0 2px rgba(139,111,94,.08);
}
.type-card.selected {
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
}
.type-card input[type=radio] { display: none; }
.type-card .card-title { font-weight: 700; font-size: 14px; color: var(--text); }
.type-card .card-desc  { font-size: 12px; color: var(--muted); margin-top: 3px; }

.sub-section {
    margin-top: -1px;
    padding: 14px;
    background: #fcf8f4;
    border-radius: 0 0 8px 8px;
    border: 1.5px solid var(--accent);
    border-top: none;
    display: none;
    box-shadow: 0 0 0 2px rgba(139,111,94,.08);
}
.sub-section.active { display: block; }
.inline-note {
    font-size: 13px;
    line-height: 1.7;
    color: var(--text);
}

.submit-btn {
    width: 100%; padding: 12px;
    background: var(--accent); color: white;
    border: none; border-radius: 8px;
    font-size: 15px; font-family: inherit;
    font-weight: 700; cursor: pointer;
    transition: opacity .2s;
}
.submit-btn:hover { opacity: .85; }

.login-link { text-align: center; padding: 16px; font-size: 13px; color: var(--muted); }
.login-link a { color: var(--accent); text-decoration: none; font-weight: 600; }
.login-link a:hover { text-decoration: underline; }

.toast-stack {
    position: fixed;
    top: 18px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 9999;
    pointer-events: none;
}
.toast-message {
    min-width: 220px;
    max-width: min(92vw, 420px);
    padding: 11px 14px;
    border-radius: 10px;
    background: rgba(58,49,40,.96);
    color: #fff;
    font-size: 13px;
    box-shadow: 0 10px 28px rgba(0,0,0,.18);
    opacity: 0;
    transform: translateY(-8px);
    transition: opacity .22s ease, transform .22s ease;
}
.toast-message.error {
    background: rgba(160,82,82,.97);
}
.toast-message.show {
    opacity: 1;
    transform: translateY(0);
}

@media (max-width: 900px) {
    body {
        display: block;
        padding: 20px 14px 32px;
    }

    .container {
        max-width: 100%;
    }

    .logo-area {
        margin-bottom: 18px;
    }

    .logo-area h1 {
        font-size: 20px;
    }

    .card {
        border-radius: 14px;
    }

    .card-section {
        padding: 18px 16px;
    }

    .field-row {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .type-card {
        padding: 12px;
    }

    .sub-section {
        padding: 12px;
    }

    .toast-stack {
        top: 12px;
        width: calc(100vw - 24px);
    }

    .toast-message {
        min-width: 0;
        width: 100%;
    }
}
