/*
 * 登入相關頁面共用樣式（登入、註冊、忘記密碼、重設密碼）
 * 版面：左側品牌區 + 右側表單區；980px 以下改為上下排列。
 * 各頁專屬樣式（例如登入頁的特刊卡片）留在各自的 view 裡。
 */

:root {
    --color-primary: #1a3a5c;
    --color-primary-light: #2c5282;
    --color-accent: #c8a45e;
    --color-accent-light: #e2c389;
    --color-bg: #f6f4ee;
    --color-surface: #ffffff;
    --color-text: #2d3748;
    --color-text-light: #4a5568;
    --color-text-muted: #718096;
    --color-border: #e6e1d6;
    --color-error: #c53030;
    --color-warning: #b7791f;
    --color-success: #276749;
    --shadow-sm: 0 1px 2px rgba(26, 58, 92, 0.04);
    --shadow-md: 0 4px 16px rgba(26, 58, 92, 0.06);
    --shadow-lg: 0 12px 32px rgba(26, 58, 92, 0.08);
}

* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    min-height: 100vh;
}

body {
    font-family: 'Noto Sans TC', -apple-system, BlinkMacSystemFont, "PingFang TC", "Microsoft JhengHei", sans-serif;
    color: var(--color-text);
    background: var(--color-bg);
    line-height: 1.7;
    font-size: 15px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.login-page {
    display: grid;
    grid-template-columns: 1.05fr 1fr;
    min-height: 100vh;
}

/* ---------- Brand panel (left) ---------- */
.brand-panel {
    position: relative;
    padding: 64px 56px;
    background: linear-gradient(135deg, #15314f 0%, #1a3a5c 50%, #234a78 100%);
    color: #fff;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    isolation: isolate;
}

.brand-panel::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at 18% 25%, rgba(200, 164, 94, 0.22) 0%, transparent 55%),
        radial-gradient(ellipse at 82% 80%, rgba(255, 255, 255, 0.06) 0%, transparent 55%);
    z-index: -1;
}

.brand-panel::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
    background-size: 48px 48px;
    mask-image: radial-gradient(ellipse at center, black 30%, transparent 75%);
    -webkit-mask-image: radial-gradient(ellipse at center, black 30%, transparent 75%);
    z-index: -1;
}

.brand-content {
    max-width: 460px;
}

.brand-home-link,
.brand-home-link:hover {
    color: inherit;
    text-decoration: none;
}

.brand-ornament {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 28px;
}

.brand-ornament-line {
    width: 36px;
    height: 1px;
    background: var(--color-accent-light);
    opacity: 0.7;
}

.brand-ornament-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--color-accent);
    box-shadow: 0 0 0 4px rgba(200, 164, 94, 0.18);
}

.form-title {
    font-family: 'Noto Serif TC', "PingFang TC", serif;
    font-size: clamp(1.6rem, 2.6vw, 2.1rem);
    font-weight: 600;
    line-height: 1.45;
    margin: 0;
    letter-spacing: 0.02em;
    color: #fff;
}

.form-title .zh {
    display: block;
}

.form-title .en {
    display: block;
    margin-top: 10px;
    font-family: 'Noto Sans TC', sans-serif;
    font-size: 0.7em;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.7);
    letter-spacing: 0.08em;
}

.brand-meta {
    position: relative;
    z-index: 1;
    max-width: 460px;
}

.award-badge {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 20px;
    background: rgba(200, 164, 94, 0.1);
    border: 1px solid rgba(200, 164, 94, 0.32);
    border-radius: 12px;
    font-size: 13.5px;
    line-height: 1.65;
    color: rgba(255, 255, 255, 0.92);
}

.award-badge-icon {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--color-accent) 0%, var(--color-accent-light) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #15314f;
    font-weight: 700;
    box-shadow: 0 4px 12px rgba(200, 164, 94, 0.25);
}

/* ---------- Form panel (right) ---------- */
.form-panel {
    background: var(--color-bg);
    padding: 56px 48px;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    overflow-y: auto;
    max-height: 100vh;
}

/* 垂直置中：用 auto margin 而不是 align-items:center，
   內容比視窗高時才不會把上方裁掉、仍可正常捲動 */
.form-panel > .signup {
    margin-top: auto;
    margin-bottom: auto;
    /* 固定寬度，不隨內容長短變動（460px 內容 + Bootstrap .container 左右各 15px） */
    width: 100%;
    max-width: 490px;
}

.form-panel-inner {
    width: 100%;
    max-width: 460px;
}

/* 表單標題 */
.form-heading {
    margin-bottom: 24px;
}

.form-heading-title {
    font-family: 'Noto Serif TC', "PingFang TC", serif;
    font-size: 1.6rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    color: var(--color-primary);
    margin: 0 0 6px;
    line-height: 1.4;
}

.form-heading-sub {
    display: block;
    font-size: 14px;
    color: var(--color-text-muted);
    letter-spacing: 0.02em;
}

/* Alerts (CodeIgniter validation outputs) */
.alert,
.text-danger {
    padding: 12px 16px;
    border-radius: 10px;
    margin-bottom: 16px;
    font-size: 14px;
    line-height: 1.6;
    border: 1px solid transparent;
}

.alert-danger,
.text-danger {
    background: #fef2f2;
    border-color: #fecaca;
    color: var(--color-error);
}

.alert-warning {
    background: #fffaf0;
    border-color: #fde68a;
    color: var(--color-warning);
}

/* Form */
.form-group {
    margin-bottom: 14px;
}

.form-input {
    width: 100%;
    padding: 13px 16px;
    border: 1px solid var(--color-border);
    background: var(--color-surface);
    border-radius: 10px;
    font-size: 15px;
    color: var(--color-text);
    font-family: inherit;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
    appearance: none;
}

.form-input:focus {
    outline: none;
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px rgba(200, 164, 94, 0.18);
    background: #fff;
}

.form-input::placeholder {
    color: var(--color-text-muted);
}

.form-submit {
    width: 100%;
    padding: 14px 20px;
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-light) 100%);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 0.18em;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    font-family: inherit;
    margin-top: 6px;
}

.form-submit:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 24px rgba(26, 58, 92, 0.22);
}

.form-submit:active {
    transform: translateY(0);
}

/* Aux links */
.form-panel-inner > p {
    margin: 0 0 8px;
    font-size: 14px;
    color: var(--color-text-light);
}

.form-panel-inner a,
.loginhere-link {
    color: var(--color-primary);
    text-decoration: none;
    font-weight: 500;
    border-bottom: 1px dashed transparent;
    transition: color 0.2s ease, border-color 0.2s ease;
}

.form-panel-inner a:hover,
.loginhere-link:hover {
    color: var(--color-accent);
    border-bottom-color: var(--color-accent);
}

/* 表單下方的連結區（註冊、忘記密碼、重設密碼頁） */
.form-links {
    margin-top: 20px;
    padding-top: 18px;
    border-top: 1px solid var(--color-border);
    font-size: 14px;
    color: var(--color-text-light);
}

.form-links p {
    margin: 0 0 8px;
}

/* Responsive */
@media (max-width: 980px) {
    .login-page {
        grid-template-columns: 1fr;
    }

    .brand-panel {
        padding: 48px 32px;
        min-height: auto;
        gap: 32px;
    }

    .form-panel {
        padding: 40px 24px;
        max-height: none;
    }
}

@media (max-width: 540px) {
    .brand-panel {
        padding: 36px 24px;
    }

    .form-panel {
        padding: 32px 20px;
    }

    .form-title {
        font-size: 1.4rem;
    }
}
