:root {
    --brand-red: #c8102e;
    --brand-red-dark: #9d0c24;
    --ink: #17212b;
    --muted: #536273;
    --line: #d8dee6;
    --canvas: #f3f6f9;
    --surface: #ffffff;
    --danger: #a51d2d;
    --focus: #005fcc;
}

* { box-sizing: border-box; }

html { min-width: 320px; color-scheme: light; }

body.customer-page {
    margin: 0;
    color: var(--ink);
    background: var(--canvas);
    font-family: "Noto Sans TC", "Microsoft JhengHei", Arial, sans-serif;
    font-size: 16px;
    line-height: 1.6;
}

.page-shell { width: min(1120px, calc(100% - 40px)); margin: 0 auto; }

.skip-link {
    position: fixed;
    z-index: 100;
    top: 8px;
    left: 8px;
    padding: 10px 14px;
    color: #ffffff;
    background: var(--focus);
    transform: translateY(-160%);
}

.skip-link:focus { transform: translateY(0); }

.customer-header {
    color: #ffffff;
    background: linear-gradient(120deg, #171b22 0%, #29313b 68%, #43131c 100%);
    border-bottom: 4px solid var(--brand-red);
}

.brand-row { display: flex; align-items: center; gap: 24px; min-height: 116px; }
.brand-logo { width: 190px; height: auto; /*background: #ffffff;*/ padding: 10px 14px; }
.service-eyebrow { margin: 0 0 2px; color: #f6b7c2; font-size: .86rem; letter-spacing: .12em; 
  font-size: 2rem;}
.customer-header h1 { margin: 0; font-size: clamp(1.55rem, 3vw, 2.25rem); line-height: 1.25; }

.main-content { display: grid; gap: 24px; padding-top: 32px; padding-bottom: 48px; }
.customer-detail-page .panel { margin-bottom: 0; }
.customer-detail-page .alert { margin-bottom: 0; }
.surface {
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--surface);
    box-shadow: 0 8px 24px rgba(28, 42, 55, .07);
}
.surface { padding: clamp(22px, 4vw, 38px); }
.verify-card { max-width: 780px; width: 100%; margin: 16px auto; }

.section-heading { margin-bottom: 24px; }
.section-heading h2 { margin: 0; font-size: 1.45rem; }
.section-heading p:not(.step-label) { margin: 6px 0 0; color: var(--muted); }
.section-heading-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.step-label { margin: 0 0 3px; color: var(--brand-red-dark); font-size: .8rem; font-weight: 700; letter-spacing: .12em; }

.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.field-span-two { grid-column: 1 / -1; }
.field-group { min-width: 0; }
.field-group label { display: block; margin-bottom: 7px; font-weight: 700; }
.field-group input, .field-group select {
    width: 100%;
    min-height: 46px;
    padding: 9px 12px;
    color: var(--ink);
    border: 1px solid #8b98a6;
    border-radius: 5px;
    background: #ffffff;
    font: inherit;
}
.field-group input[readonly] { color: #364453; background: #edf1f4; }
.field-help { margin: 5px 0 0; color: var(--muted); font-size: .9rem; }
.customer-detail-page .form-group label {
    display: block;
    margin-bottom: 7px;
    font-weight: 700;
}
.customer-detail-page .form-group .form-control {
    width: 100%;
    min-height: 46px;
    padding: 9px 12px;
    color: var(--ink);
    border: 1px solid #8b98a6;
    border-radius: 5px;
    background: #ffffff;
    font: inherit;
}
.customer-detail-page .form-group input[readonly] { color: #364453; background: #edf1f4; }
.customer-detail-page .bootstrap-select { width: 100% !important; }
.customer-detail-page .bootstrap-select > .dropdown-toggle { min-height: 46px; }

.captcha-row { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.captcha-image { width: 220px; height: 72px; border: 1px solid var(--line); border-radius: 5px; background: #f7f9fc; }
.consent-row { display: flex; align-items: flex-start; gap: 10px; margin: 24px 0; }
.consent-row input { width: 20px; height: 20px; margin-top: 3px; flex: 0 0 auto; }

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 9px 18px;
    border: 1px solid transparent;
    border-radius: 5px;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}
.button-primary { color: #ffffff; background: var(--brand-red); }
.button-primary:hover { background: var(--brand-red-dark); }
.button-secondary { color: #24384b; border-color: #728196; background: #ffffff; }
.button-small { min-height: 36px; padding: 6px 12px; font-size: .9rem; }
.button:disabled { color: #647282; border-color: #c6cdd5; background: #e7ebef; cursor: not-allowed; }

.message { margin: 0 0 20px; padding: 12px 15px; border-radius: 5px; }
.message-error { color: #721c24; border: 1px solid #e1a8ae; background: #f9e3e6; }

#operationModal .modal-dialog {
    width: auto;
    max-width: 440px;
    margin: 30px auto;
}
.operation-modal-panel {
    border-radius: 8px;
    text-align: center;
}
.operation-modal-panel .modal-body { padding: 30px 24px 8px; }
.operation-modal-panel .modal-footer {
    padding: 0 24px 24px;
    border-top: 0;
    text-align: center;
}
.operation-modal-panel h2 { margin: 14px 0 8px; }
.operation-modal-panel p { margin: 0 0 22px; color: var(--muted); }
.operation-modal-icon {
    display: inline-flex;
    width: 54px;
    height: 54px;
    align-items: center;
    justify-content: center;
    border: 4px solid currentColor;
    border-radius: 50%;
    font-size: 2rem;
    font-weight: 700;
    line-height: 1;
}
.operation-modal-icon-loading {
    color: var(--focus);
    border-color: #c8d8e8;
    border-top-color: var(--focus);
    animation: customer-operation-spin .8s linear infinite;
}
.operation-modal-icon-success { color: #18723b; }
.operation-modal-icon-success::before { content: "✓"; }
.operation-modal-icon-error { color: var(--danger); }
.operation-modal-icon-error::before { content: "!"; }

@keyframes customer-operation-spin {
    to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
    .operation-modal-icon-loading { animation-duration: 1.8s; }
}

.status-readonly { color: #314151; background: #e7edf2; }
.status-pending { color: #6b4700; background: #fff0c2; }

.attachment-table { width: 100%; min-width: 720px; border-collapse: collapse; }
.attachment-table th, .attachment-table td { padding: 11px 13px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
.attachment-table th { color: #ffffff; background: #303b46; white-space: nowrap; }
.attachment-actions { min-width: 360px; }
.attachment-actions .attachment-file { display: block; max-width: 100%; margin-bottom: 8px; }
.attachment-file {
    display: block;
    width: 100%;
    max-width: 100%;
    min-height: 44px; /* 符合行動版無障礙觸控高度標準 44px */
    padding: 4px;
    font: inherit;
    font-size: 0.95rem;
    color: var(--ink);
    background-color: #ffffff;
    border: 1px solid #8b98a6;
    border-radius: 6px;
    cursor: pointer;
    box-sizing: border-box;
}
.attachment-name { display: block; overflow-wrap: anywhere; color: var(--muted); }
.form-actions { display: flex; justify-content: flex-end; gap: 12px; }
/* Radio Button 橫向並排容器 */
.radio-group {
    display: flex;
    gap: 24px;
    min-height: 46px;
    align-items: center;
    justify-content: flex-start;
}

/* 單個 Radio 選項容器 */
.radio-label {
    display: inline-flex !important;
    align-items: center;
    margin-bottom: 0 !important;
    font-weight: normal !important;
    cursor: pointer;
    user-select: none;
    line-height: 1;
}
.field-group input[type="radio"] {
    width: 20px !important;
    min-height: 20px !important;
    height: 20px !important;
    margin: 0 !important;
    padding: 0 !important;
    flex-shrink: 0;
    cursor: pointer;
}

.customer-footer { color: #dfe5eb; background: #222a32; }
.footer-grid { display: flex; justify-content: space-between; gap: 20px; padding-top: 20px; padding-bottom: 20px; }
.footer-grid p { margin: 0; }

a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible,
[tabindex]:focus-visible {
    outline: 3px solid var(--focus);
    outline-offset: 3px;
}

@media (max-width: 720px) {
    .page-shell { width: min(100% - 28px, 720px); }
    .brand-row { min-height: 100px; gap: 15px; font-size: 1.45rem;}
    .brand-logo { width: 145px; }
    .form-grid { grid-template-columns: 1fr; }
    .field-span-two { grid-column: auto; }
    .section-heading-row, .footer-grid { flex-direction: column; }
    .form-actions { align-items: stretch; flex-direction: column; }
    .captcha-row { align-items: flex-start; flex-direction: column; }
}

@media (max-width: 360px) {
    .page-shell { width: calc(100% - 20px); }
    .brand-row { align-items: flex-start; flex-direction: column; padding-top: 18px; padding-bottom: 18px; font-size: 1.45rem;}
    .surface { padding: 18px 14px; }
    .captcha-image { width: 100%; max-width: 220px; }
}
