:root {
    --ink: #102a3a;
    --muted: #5b7180;
    --primary: #0877b1;
    --primary-dark: #065780;
    --primary-soft: #eaf5fb;
    --accent: #1283bd;
    --surface: #ffffff;
    --canvas: #f1f7fa;
    --border: #c9deea;
    --danger: #b42318;
    --shadow: 0 24px 70px rgba(6, 87, 128, .12);
    --radius-xl: 28px;
    --radius-lg: 18px;
}

* { box-sizing: border-box; }

html { color-scheme: light; }

body {
    min-width: 320px;
    margin: 0;
    background:
        radial-gradient(circle at 5% 0%, rgba(18, 131, 189, .14), transparent 32rem),
        var(--canvas);
    color: var(--ink);
    font-family: "Segoe UI", "Microsoft JhengHei", "PingFang TC", Arial, sans-serif;
    font-size: 16px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

.skip-link {
    position: fixed;
    top: 12px;
    left: 12px;
    z-index: 1000;
    padding: 10px 14px;
    border-radius: 10px;
    background: var(--ink);
    color: #fff;
    transform: translateY(-150%);
}

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

.page-shell { min-height: 100vh; padding: 24px 0 28px; }

.site-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 32px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    color: var(--ink);
    text-decoration: none;
}

.brand img { width: min(302px, 58vw); height: auto; }

.language-pill,
.preview-badge,
.step-badge {
    border: 1px solid var(--border);
    border-radius: 999px;
    background: rgba(255, 255, 255, .8);
    color: var(--primary-dark);
    font-size: .76rem;
    font-weight: 700;
    letter-spacing: .04em;
}

.language-pill { padding: 8px 13px; }

.product-panel {
    position: sticky;
    top: 24px;
    overflow: hidden;
    border: 1px solid rgba(201, 222, 234, .9);
    border-radius: var(--radius-xl);
    background: var(--surface);
    box-shadow: var(--shadow);
}

.product-image-wrap { position: relative; aspect-ratio: 4 / 3; overflow: hidden; }
.product-image { width: 100%; height: 100%; object-fit: cover; display: block; }

.preview-badge {
    position: absolute;
    left: 18px;
    bottom: 18px;
    padding: 7px 11px;
    border-color: rgba(255, 255, 255, .65);
    background: rgba(255, 255, 255, .9);
    backdrop-filter: blur(12px);
}

.product-copy { padding: 28px 30px 30px; }

.eyebrow {
    margin: 0 0 10px;
    color: var(--primary);
    font-size: .72rem;
    font-weight: 800;
    letter-spacing: .16em;
}

.product-copy h1 {
    max-width: 470px;
    margin: 0;
    font-size: clamp(1.8rem, 3vw, 2.55rem);
    font-weight: 750;
    letter-spacing: -.035em;
    line-height: 1.18;
}

.lead-copy { margin: 12px 0 24px; color: var(--muted); }
.feature-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.feature-item { display: flex; align-items: center; gap: 10px; }
.feature-item > span:last-child { display: grid; }
.feature-item strong { font-size: .88rem; }
.feature-item small { color: var(--muted); font-size: .75rem; }

.feature-icon {
    display: grid;
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    place-items: center;
    border-radius: 11px;
    background: var(--primary-soft);
}

.feature-icon svg,
.privacy-note svg {
    width: 20px;
    fill: none;
    stroke: var(--primary);
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
}

.form-card {
    min-height: 650px;
    padding: clamp(26px, 5vw, 52px);
    border: 1px solid rgba(201, 222, 234, .9);
    border-radius: var(--radius-xl);
    background: var(--surface);
    box-shadow: var(--shadow);
}

.form-heading { display: flex; justify-content: space-between; gap: 20px; margin-bottom: 28px; }
.form-heading h2 { margin: 0; font-size: clamp(1.75rem, 3vw, 2.3rem); font-weight: 750; letter-spacing: -.035em; }
.form-heading > div > p:last-child { margin: 3px 0 0; color: var(--muted); }

.step-badge {
    display: grid;
    width: 56px;
    height: 42px;
    flex: 0 0 56px;
    place-content: center;
    color: var(--ink);
}

.step-badge small { color: var(--muted); font-weight: 500; }
.bilingual-label { display: grid; margin-bottom: 8px; font-weight: 700; line-height: 1.25; }
.bilingual-label small { margin-top: 2px; color: var(--muted); font-size: .74rem; font-weight: 500; }
.bilingual-label em { color: var(--muted); font-size: .72rem; font-style: normal; font-weight: 500; }

.form-control,
.form-select {
    min-height: 51px;
    border: 1px solid var(--border);
    border-radius: 13px;
    background-color: #fbfdfd;
    color: var(--ink);
    font-size: .95rem;
}

textarea.form-control { min-height: 100px; resize: vertical; }
.form-control::placeholder { color: #879a98; }

.form-control:focus,
.form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(8, 119, 177, .14);
}

.size-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.size-option { cursor: pointer; }
.size-option input { position: absolute; opacity: 0; pointer-events: none; }

.size-option > span {
    position: relative;
    display: grid;
    min-height: 78px;
    align-content: center;
    padding: 13px 36px 13px 15px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: #fbfdfd;
    transition: border-color .2s ease, background-color .2s ease, transform .2s ease;
}

.size-option:hover > span { border-color: #77b9b3; transform: translateY(-1px); }
.size-option strong { font-size: 1.1rem; }
.size-option small { color: var(--muted); font-size: .72rem; }

.size-option i {
    position: absolute;
    top: 50%;
    right: 14px;
    width: 18px;
    height: 18px;
    border: 1.5px solid #aac2bf;
    border-radius: 50%;
    transform: translateY(-50%);
}

.size-option input:checked + span { border-color: var(--primary); background: var(--primary-soft); }
.size-option input:checked + span i { border: 5px solid var(--primary); background: #fff; }
.size-option input:focus-visible + span { outline: 3px solid rgba(8, 119, 177, .3); outline-offset: 2px; }
.field-error { display: none; margin-top: 5px; color: var(--danger); font-size: .82rem; }
.has-error + .field-error,
.was-validated .size-grid:has(input:invalid) + .field-error { display: block; }
.textarea-meta { display: flex; justify-content: space-between; color: var(--muted); font-size: .75rem; }
.textarea-meta .invalid-feedback { margin-right: auto; }

.action-button {
    min-height: 52px;
    width: 100%;
    margin-top: 26px;
    border-color: var(--primary);
    border-radius: 13px;
    background: var(--primary);
    font-weight: 750;
    box-shadow: 0 12px 25px rgba(8, 119, 177, .22);
    transition: background-color .2s ease, border-color .2s ease, transform .2s ease;
}

.action-button:hover,
.action-button:focus { border-color: var(--primary-dark); background: var(--primary-dark); transform: translateY(-1px); }
.action-button:focus-visible { outline: 3px solid rgba(8, 119, 177, .3); outline-offset: 3px; }
.button-spinner { display: none; }
.action-button.is-loading .button-label { display: none; }
.action-button.is-loading .button-spinner { display: inline-block; }

.privacy-note {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    margin: 13px 0 0;
    color: var(--muted);
    font-size: .74rem;
    text-align: center;
}

.privacy-note svg { width: 16px; flex: 0 0 16px; }
.error-summary { outline: none; }
.alert { border: 0; border-radius: 13px; font-size: .88rem; }
.alert-danger { background: #fff0ee; color: #8c1d15; }
.alert-success { background: var(--primary-soft); color: var(--primary-dark); }

.success-state { display: grid; min-height: 540px; place-content: center; text-align: center; }
.success-icon { display: grid; width: 74px; height: 74px; margin: 0 auto 20px; place-items: center; border-radius: 50%; background: var(--primary-soft); }
.success-icon svg { width: 38px; fill: none; stroke: var(--primary); stroke-linecap: round; stroke-linejoin: round; stroke-width: 2; }
.success-state h2 { margin: 0; font-size: clamp(1.8rem, 4vw, 2.6rem); letter-spacing: -.04em; }
.success-state h2 span { color: var(--primary); }
.success-state > p:not(.eyebrow) { margin: 14px 0 22px; color: var(--muted); }
.order-code { display: grid; padding: 16px; border: 1px dashed #79aaa5; border-radius: 14px; background: #f8fcfb; }
.order-code small { color: var(--muted); }
.order-code strong { margin-top: 3px; font-size: 1.18rem; letter-spacing: .08em; }
.success-state .action-button { display: grid; align-items: center; color: #fff; text-decoration: none; }

footer { padding: 26px 0 0; color: var(--muted); font-size: .75rem; text-align: center; }

.installer-page { background: var(--canvas); }
.installer-shell { display: grid; min-height: 100vh; padding: 24px; place-items: center; }
.installer-card { width: min(100%, 520px); padding: clamp(28px, 7vw, 52px); border: 1px solid var(--border); border-radius: var(--radius-xl); background: #fff; box-shadow: var(--shadow); }
.installer-card > img { display: block; width: min(302px, 100%); height: auto; margin-bottom: 24px; }
.installer-card h1 { margin: 0; font-weight: 750; letter-spacing: -.04em; }
.installer-subtitle { margin: 2px 0 24px; color: var(--muted); }
.setup-summary { display: grid; gap: 1px; overflow: hidden; margin: 24px 0; border: 1px solid var(--border); border-radius: 14px; background: var(--border); }
.setup-summary div { display: flex; justify-content: space-between; gap: 20px; padding: 12px 14px; background: #fbfdfd; }
.setup-summary dt { font-size: .8rem; }
.setup-summary dd { margin: 0; color: var(--muted); font-size: .85rem; }
.setup-note { color: var(--muted); font-size: .85rem; }

@media (max-width: 991.98px) {
    .page-shell { padding-top: 18px; }
    .site-header { margin-bottom: 22px; }
    .product-panel { position: static; }
    .product-image-wrap { aspect-ratio: 16 / 8.5; }
    .product-copy { padding: 22px 24px 24px; }
    .form-card { min-height: 0; }
}

@media (max-width: 575.98px) {
    .container-xl { padding-right: 16px; padding-left: 16px; }
    .language-pill { display: none; }
    .brand img { width: min(250px, 66vw); }
    .product-panel,
    .form-card { border-radius: 20px; }
    .product-image-wrap { aspect-ratio: 4 / 3; }
    .product-copy { padding: 20px; }
    .product-copy h1 { font-size: 1.65rem; }
    .feature-list { grid-template-columns: 1fr; }
    .form-card { padding: 25px 20px; }
    .form-heading { margin-bottom: 24px; }
    .form-heading h2 { font-size: 1.65rem; }
    .step-badge { display: none; }
    .size-grid { gap: 7px; }
    .size-option > span { min-height: 72px; padding: 10px 28px 10px 11px; }
    .size-option i { right: 9px; width: 16px; height: 16px; }
    .size-option input:checked + span i { border-width: 4px; }
    .privacy-note { align-items: flex-start; text-align: left; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; }
}
