﻿/* ===================================
   澎湖縣政府機位登記 - 現代海洋藍配色系統
   Bootstrap 5 + 無障礙 AA 等級 + 響應式字級
   =================================== */

/* === 全域變數與三段字級 === */
:root {
    --base-font-size: 16px;
    --title-font-size: 0.95rem;
    --content-font-size: 1rem;
    --hint-font-size: 0.875rem;
    
    /* 海洋主題調色盤 */
    --ocean-navy: #0e3d74;
    --ocean-blue: #1d4ed8;
    --ocean-cyan: #0284c7;
    --sky-light: #f0f6fc;
    --border-light: #dbe4ee;
    --text-main: #1e293b;
    --text-muted: #64748b;
}

body.font-size-sm {
    --base-font-size: 14px;
    --title-font-size: 0.875rem;
    --content-font-size: 0.92rem;
    --hint-font-size: 0.82rem;
}
body.font-size-md {
    --base-font-size: 16px;
    --title-font-size: 0.95rem;
    --content-font-size: 1rem;
    --hint-font-size: 0.875rem;
}
body.font-size-lg {
    --base-font-size: 18px;
    --title-font-size: 1.15rem;
    --content-font-size: 1.15rem;
    --hint-font-size: 0.95rem;
}

html {
    font-size: var(--base-font-size);
    height: 100%;
}

body {
    min-height: 100%;
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans TC", "Microsoft JhengHei", sans-serif;
    font-size: var(--content-font-size);
    line-height: 1.6;
    color: var(--text-main);
    background: linear-gradient(180deg, #f0f5fa 0%, #e3edf7 100%);
    background-attachment: fixed;
    -webkit-text-size-adjust: 100%;
}

/* === 無障礙：修正跳到主要內容 (平常完全隱藏，鍵盤 Focus 才浮現) === */
.skip-link {
    position: absolute;
    top: -100px;
    left: 15px;
    background: var(--ocean-navy);
    color: #ffffff;
    padding: 0.6rem 1.2rem;
    text-decoration: none;
    z-index: 10000;
    font-weight: 600;
    border-radius: 0 0 8px 8px;
    transition: top 0.2s ease;
}
.skip-link:focus {
    top: 0;
    outline: 3px solid #f59e0b;
}

.page-wrapper {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* === 全站統一寬度容器 === */
.site-width-container {
    width: 100%;
    max-width: 880px;
    margin: 0 auto;
    padding: 0 16px;
    box-sizing: border-box;
}

/* === 頂部工具列 (字級切換) === */
.font-size-switcher {
    display: inline-flex;
    align-items: center;
    background: #ffffff;
    padding: 4px 10px;
    border-radius: 999px;
    border: 1px solid var(--border-light);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.04);
}

.font-btn {
    border: none;
    background: transparent;
    color: var(--text-muted);
    padding: 2px 10px;
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: 999px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.font-btn.active, .font-btn:hover {
    background-color: var(--ocean-blue);
    color: #ffffff;
}

/* === 頁首 Banner (海洋深藍漸層) === */
.site-header {
    margin-bottom: 1.5rem;
    width: 100%;
}

.banner-text-container {
    background: linear-gradient(135deg, #0e3d74 0%, #1a569b 60%, #1e6bb8 100%);
    border-radius: 14px;
    box-shadow: 0 8px 24px -4px rgba(14, 61, 116, 0.25);
    overflow: hidden;
}

.banner-title-box {
    padding: 1.6rem 1rem;
    text-align: center;
}

.banner-main-title {
    margin: 0;
    line-height: 1.4;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.4rem 0.6rem;
}

.gov-title {
    color: #dbeafe;
    font-size: 1.35rem;
    font-weight: 500;
}

/* 核心：假期亮陽金標籤 */
.holiday-highlight {
    color: #92400e;
    background: linear-gradient(180deg, #fef9c3 0%, #fef08a 100%);
    font-size: 1.45rem;
    font-weight: 800;
    padding: 3px 14px;
    border-radius: 6px;
    border: 1px solid #facc15;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    letter-spacing: 0.5px;
}

.action-title {
    color: #ffffff;
    font-size: 1.35rem;
    font-weight: 600;
}

/* === 主卡片白底容器 === */
.main-form-card,
.form-card {
    background-color: #ffffff;
    border-radius: 14px;
    box-shadow: 0 4px 20px -2px rgba(15, 23, 42, 0.06);
    border: 1px solid #e2e8f0;
    padding: 2rem 1.75rem;
    width: 100%;
    margin-bottom: 2.5rem;
    box-sizing: border-box;
}

/* === 內部欄位卡片 (清爽冰藍標頭 + 藍色左指示條) === */
.form-block-card {
    border: 1px solid var(--border-light);
    border-radius: 8px;
    overflow: hidden;
    background-color: #ffffff;
    margin-bottom: 1.35rem !important;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-block-card:focus-within {
    border-color: var(--ocean-blue);
    box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.15);
}

.form-block-header {
    background-color: var(--sky-light);
    color: #1e3a8a;
    font-weight: 600;
    padding: 9px 14px;
    font-size: var(--title-font-size) !important;
    border-bottom: 1px solid var(--border-light);
    border-left: 4px solid var(--ocean-blue);
    display: flex;
    align-items: center;
}

.form-block-body {
    padding: 12px 14px;
    min-height: 48px;
    background-color: #ffffff;
    display: flex;
    align-items: center;
    font-size: var(--content-font-size) !important;
}

/* 輸入框元件通規 */
.form-block-body .form-control,
.form-block-body .form-select {
    border-radius: 6px;
    border: 1px solid #cbd5e1;
    min-height: 44px;
    padding: 6px 12px;
    font-size: var(--content-font-size) !important;
    color: var(--text-main);
    transition: all 0.2s ease;
}

.form-block-body .form-control:focus,
.form-block-body .form-select:focus {
    border-color: var(--ocean-blue);
    box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.15);
}

.form-block-body input:disabled {
    background-color: #f1f5f9 !important;
    border-color: #e2e8f0;
}

/* 提示與說明文字 */
.card-inner-hint {
    font-size: var(--hint-font-size) !important;
    color: var(--text-muted);
    margin-top: 4px;
}

.card-inner-warning {
    font-size: var(--hint-font-size) !important;
    color: #dc2626;
    margin-top: 4px;
}

/* === 注意事項方框 === */
.notice-box, .alert-info {
    background-color: #f0fdf4 !important;
    border: 1px solid #bbf7d0 !important;
    border-left: 4px solid #16a34a !important;
    border-radius: 8px;
    padding: 1.25rem 1.5rem;
    margin-bottom: 1.5rem;
    color: #14532d;
    font-size: var(--content-font-size) !important;
}

.notice-title {
    color: #15803d;
    font-weight: 700;
    font-size: var(--title-font-size) !important;
    margin-bottom: 0.5rem;
}

/* === 送出按鈕 (海洋湛藍漸層) === */
.btn-submit {
    background: linear-gradient(135deg, #1d4ed8 0%, #0284c7 100%);
    border: none;
    color: #ffffff;
    font-weight: 700;
    font-size: 1.15rem;
    padding: 0.85rem 4.5rem;
    border-radius: 8px;
    transition: all 0.2s ease;
    box-shadow: 0 4px 14px rgba(29, 78, 216, 0.35);
    cursor: pointer;
}

.btn-submit:hover {
    background: linear-gradient(135deg, #1e40af 0%, #0369a1 100%);
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(29, 78, 216, 0.45);
    color: #ffffff;
}

/* === 滿版深海藍 Footer === */
.site-footer {
    background-color: #0a192f;
    color: #94a3b8;
    padding: 1.6rem 0;
    margin-top: auto;
    width: 100%;
}

.site-footer strong {
    color: #f1f5f9;
}

.footer-link {
    color: #38bdf8;
    text-decoration: none;
    font-weight: 600;
}

.footer-link:hover {
    color: #7dd3fc;
    text-decoration: underline;
}

/* === 電腦版寬度精準固定 (>= 576px) === */
@media (min-width: 576px) {
    .name-input-last { width: 100px !important; max-width: 100px; }
    .name-input-first { width: 150px !important; max-width: 150px; }
    .birthday-select-year { width: 110px !important; max-width: 110px; }
    .birthday-select-month, .birthday-select-day { width: 85px !important; max-width: 85px; }
    .phone-input-area { width: 75px !important; max-width: 75px; }
    .phone-input-num { width: 140px !important; max-width: 140px; }
    .phone-input-ext { width: 85px !important; max-width: 85px; }
    .phone-main-group, .phone-ext-group,
    .birthday-year-group, .birthday-date-group,
    .name-group-item { width: auto !important; }
}

/* === 手機版響應式 (< 576px) === */
@media (max-width: 575.98px) {
    .site-width-container { padding: 0 8px; }
    .main-form-card, .form-card { padding: 1.25rem 0.85rem; }
    .banner-title-box { padding: 1.25rem 0.5rem; }
    .gov-title, .action-title { font-size: 1.15rem; }
    .holiday-highlight { font-size: 1.25rem; }
    .name-group-item,
    .name-input-last, .name-input-first,
    .birthday-year-group, .birthday-date-group,
    .birthday-select-year,
    .phone-main-group, .phone-ext-group,
    .phone-input-num {
        width: 100% !important;
    }
    .birthday-select-month, .birthday-select-day {
        flex: 1 1 auto;
        width: 100% !important;
    }
    .phone-input-ext { width: 100% !important; max-width: 140px; }
    .btn-submit { width: 100%; padding: 0.85rem 1.5rem; }
}

/* === Focus 與輔助樣式 === */
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible {
    outline: 3px solid #f59e0b;
    outline-offset: 2px;
}

.visually-hidden {
    position: absolute;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0, 0, 0, 0);
    white-space: nowrap; border-width: 0;
}


/* ===================================
   輸入框 Placeholder 佔位符文字淡化
   =================================== */

/* 通用現代標準 */
::placeholder {
    color: #a0aec0 !important; /* 清爽淡灰色 */
    opacity: 1 !important;     /* 避免 Firefox 預設降低透明度導致太淡 */
    font-weight: 400 !important;
}

/* Chrome / Safari / Edge / Opera */
::-webkit-input-placeholder {
    color: #a0aec0 !important;
    font-weight: 400 !important;
}

/* Firefox 19+ */
::-moz-placeholder {
    color: #a0aec0 !important;
    opacity: 1 !important;
    font-weight: 400 !important;
}

/* IE 10-11 */
:-ms-input-placeholder {
    color: #a0aec0 !important;
    font-weight: 400 !important;
}

/* Edge 舊版 */
::-ms-input-placeholder {
    color: #a0aec0 !important;
    font-weight: 400 !important;
}