/* ==========================================================================
   RBGN PDW China 2026 — Submission form
   Self-contained stylesheet. No external imports, no Google Fonts.
   ========================================================================== */

:root {
    --color-bg:        #f5f6f8;
    --color-surface:   #ffffff;
    --color-text:      #1d2433;
    --color-muted:     #5b6478;
    --color-line:      #e1e5ec;
    --color-line-soft: #eef0f5;
    --color-primary:   #0a3d62;
    --color-primary-2: #1c5d89;
    --color-accent:    #c79a3a;
    --color-success:   #1e7f4a;
    --color-warning:   #b46b1d;
    --color-danger:    #b3261e;
    --color-danger-bg: #fdecea;
    --color-warn-bg:   #fdf3e3;
    --color-success-bg:#e7f5ec;

    --radius-sm: 4px;
    --radius:    8px;
    --radius-lg: 12px;

    --shadow-card: 0 1px 2px rgba(20, 25, 40, 0.04),
                   0 4px 16px rgba(20, 25, 40, 0.06);

    --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
                 "Microsoft YaHei", "Hiragino Sans GB", "Helvetica Neue",
                 Arial, sans-serif;
    --font-serif: Georgia, "Times New Roman", serif;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    background: var(--color-bg);
    color: var(--color-text);
    font-family: var(--font-sans);
    font-size: 16px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--color-primary); }
a:hover { color: var(--color-primary-2); }

.skip-link {
    position: absolute;
    left: -1000px;
    top: 0;
    background: var(--color-primary);
    color: #fff;
    padding: 8px 12px;
    z-index: 100;
}
.skip-link:focus { left: 8px; top: 8px; }

.container {
    width: 100%;
    max-width: 880px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ---- Header / footer --------------------------------------------------- */
.site-header {
    background: linear-gradient(135deg, #0a3d62 0%, #1c5d89 100%);
    color: #fff;
    padding: 32px 0 28px;
    border-bottom: 4px solid var(--color-accent);
}
.site-header__inner {
    display: flex;
    align-items: center;
    gap: 24px;
}
.site-header__brand {
    flex: 0 0 auto;
    width: 140px;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.18);
}
.site-header__text { min-width: 0; flex: 1; }
@media (max-width: 640px) {
    .site-header__inner { flex-direction: column; align-items: flex-start; gap: 14px; }
    .site-header__brand { width: 110px; }
}
.site-header .kicker {
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-size: 0.75rem;
    margin: 0 0 4px;
    opacity: 0.85;
}
.site-header h1 {
    font-family: var(--font-serif);
    font-size: 1.85rem;
    margin: 0 0 6px;
    line-height: 1.2;
}
.site-header .lead {
    margin: 0 0 16px;
    opacity: 0.9;
}
.meta-row {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
}
.meta-row li {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: var(--radius);
    padding: 8px 14px;
    font-size: 0.9rem;
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}
.meta-row li span { opacity: 0.8; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em; }
.meta-row li strong { font-weight: 600; }

.site-footer {
    background: #0c2435;
    color: #cfd6e0;
    padding: 28px 0 32px;
    margin-top: 48px;
    font-size: 0.9rem;
}
.site-footer a { color: #ffd66c; }
.site-footer .muted { color: #8a93a3; font-size: 0.82rem; }
.site-footer p { margin: 0 0 6px; }

/* ---- Cards ------------------------------------------------------------- */
main { padding-top: 28px; padding-bottom: 28px; }

.card {
    background: var(--color-surface);
    border: 1px solid var(--color-line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    padding: 28px;
    margin-bottom: 24px;
}
.card--landing h2 { margin-top: 0; font-family: var(--font-serif); }
.card--success { border-left: 6px solid var(--color-success); }
.card--success h2 { color: var(--color-success); margin-top: 0; }

.callouts {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin: 16px 0 24px;
}
.callout {
    background: var(--color-line-soft);
    border-radius: var(--radius);
    padding: 16px 18px;
}
.callout h3 { margin: 0 0 8px; font-size: 1rem; }
.callout ul, .callout ol { margin: 0 0 0 18px; padding: 0; }
.callout li { margin-bottom: 4px; }

.cta { margin-top: 24px; }

/* ---- Progress bar ------------------------------------------------------ */
.progress {
    background: var(--color-surface);
    border: 1px solid var(--color-line);
    border-radius: var(--radius);
    padding: 14px 18px;
    margin-bottom: 18px;
    box-shadow: var(--shadow-card);
}
.progress ol {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: space-between;
    gap: 8px;
}
.progress .step {
    flex: 1;
    text-align: center;
    font-size: 0.78rem;
    color: var(--color-muted);
    padding: 4px 2px;
    position: relative;
}
.progress .step__number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--color-line);
    color: var(--color-muted);
    font-weight: 600;
    margin-bottom: 4px;
}
.progress .step__label { display: block; }
.progress .step--current .step__number {
    background: var(--color-primary);
    color: #fff;
}
.progress .step--current { color: var(--color-primary); font-weight: 600; }
.progress .step--done .step__number {
    background: var(--color-success);
    color: #fff;
}
.progress__bar {
    height: 4px;
    background: var(--color-line);
    border-radius: 4px;
    margin-top: 10px;
    overflow: hidden;
}
.progress__fill {
    height: 100%;
    background: linear-gradient(90deg, var(--color-primary), var(--color-accent));
    transition: width 200ms ease;
}

/* ---- Step header ------------------------------------------------------- */
.step-header h2 {
    font-family: var(--font-serif);
    margin: 0 0 4px;
    font-size: 1.35rem;
    color: var(--color-primary);
}
.step-header p { margin: 0 0 18px; color: var(--color-muted); }

/* ---- Forms ------------------------------------------------------------- */
.field { margin-bottom: 18px; }
.field label,
.field legend {
    display: block;
    font-weight: 600;
    margin-bottom: 6px;
    font-size: 0.92rem;
}
.field legend { padding: 0; }

.req {
    color: var(--color-danger);
    font-weight: 700;
    margin-left: 2px;
}
.muted { color: var(--color-muted); }

input[type="text"],
input[type="email"],
input[type="file"],
select,
textarea {
    width: 100%;
    padding: 10px 12px;
    font-size: 1rem;
    font-family: inherit;
    color: var(--color-text);
    background: #fff;
    border: 1px solid var(--color-line);
    border-radius: var(--radius-sm);
    transition: border-color 120ms ease, box-shadow 120ms ease;
}
textarea { resize: vertical; min-height: 110px; }

input:focus,
select:focus,
textarea:focus {
    outline: 0;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(10, 61, 98, 0.15);
}
input[aria-invalid="true"],
select[aria-invalid="true"],
textarea[aria-invalid="true"],
fieldset[aria-invalid="true"] {
    border-color: var(--color-danger);
}
input[aria-invalid="true"]:focus,
select[aria-invalid="true"]:focus,
textarea[aria-invalid="true"]:focus {
    box-shadow: 0 0 0 3px rgba(179, 38, 30, 0.18);
}

fieldset {
    border: 1px solid var(--color-line);
    padding: 12px 16px;
    border-radius: var(--radius);
}
fieldset.field { margin-bottom: 18px; }

.hint {
    color: var(--color-muted);
    font-size: 0.85rem;
    margin: 4px 0 8px;
}
.hint--counter { font-variant-numeric: tabular-nums; }
.hint--counter.over { color: var(--color-danger); font-weight: 600; }

.error {
    color: var(--color-danger);
    font-size: 0.86rem;
    margin: 4px 0 0;
}

/* Two-column layouts */
.grid { display: grid; gap: 16px; }
.grid--2 { grid-template-columns: 1fr 1fr; }

@media (max-width: 640px) {
    .grid--2, .callouts { grid-template-columns: 1fr; }
    .meta-row { gap: 8px; }
    .meta-row li { flex: 1; min-width: 130px; }
    .site-header h1 { font-size: 1.5rem; }
    .card { padding: 20px; }
}

/* Checkboxes / radios */
.check, .radio {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 8px 4px;
    cursor: pointer;
}
.check input, .radio input { margin-top: 4px; }
.check span, .radio span { flex: 1; line-height: 1.5; }

/* Step actions */
.actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--color-line-soft);
    gap: 12px;
}
.actions--review { flex-wrap: wrap; }

.btn {
    display: inline-block;
    padding: 10px 20px;
    border-radius: var(--radius);
    border: 1px solid transparent;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: background 120ms ease, transform 60ms ease;
    background: #e3e7ef;
    color: var(--color-text);
}
.btn:hover { background: #d6dbe5; }
.btn:active { transform: translateY(1px); }
.btn:disabled, .btn[disabled] { opacity: 0.6; cursor: not-allowed; }

.btn--primary {
    background: var(--color-primary);
    color: #fff;
    border-color: var(--color-primary);
}
.btn--primary:hover { background: var(--color-primary-2); color: #fff; }

.btn--secondary {
    background: #fff;
    color: var(--color-primary);
    border-color: var(--color-primary);
}
.btn--secondary:hover { background: rgba(10, 61, 98, 0.06); }

.btn--large { padding: 12px 26px; font-size: 1.02rem; }

.inline { display: inline; }

/* Autosave pill */
.autosave-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--color-success-bg);
    color: var(--color-success);
    border: 1px solid #b6dfc6;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 0.85rem;
    margin-bottom: 12px;
}
.autosave-dot {
    width: 8px;
    height: 8px;
    background: var(--color-success);
    border-radius: 50%;
    display: inline-block;
}

/* Alerts */
.alert {
    padding: 12px 14px;
    border-radius: var(--radius);
    margin: 12px 0;
    border: 1px solid var(--color-line);
}
.alert ul { margin: 6px 0 0 18px; padding: 0; }
.alert--warning { background: var(--color-warn-bg); border-color: #f0d6a3; color: #7a4d12; }
.alert--error   { background: var(--color-danger-bg); border-color: #f5b8b3; color: #7a1a14; }

/* File / formatting cards */
.formatting-card {
    background: var(--color-line-soft);
    padding: 14px 18px;
    border-radius: var(--radius);
    margin-bottom: 16px;
}
.formatting-card strong { display: block; margin-bottom: 4px; }
.formatting-card ul { margin: 0; padding-left: 18px; }

.upload-form { margin-bottom: 20px; }

.file-card {
    background: var(--color-success-bg);
    border: 1px solid #b6dfc6;
    border-radius: var(--radius);
    padding: 12px 16px;
    margin-bottom: 16px;
}
.file-card .hint { margin: 4px 0 0; }

/* Declarations */
.declarations { padding-left: 0; list-style: none; }
.declaration {
    padding: 10px 12px;
    border: 1px solid var(--color-line);
    border-radius: var(--radius);
    margin-bottom: 8px;
    background: #fbfbfd;
}
.declaration--error { border-color: var(--color-danger); background: var(--color-danger-bg); }

/* Review page */
.review {
    margin: 0;
    padding: 0;
    display: grid;
    gap: 12px;
}
.review h3 {
    grid-column: 1 / -1;
    margin: 16px 0 4px;
    font-family: var(--font-serif);
    color: var(--color-primary);
    border-bottom: 1px solid var(--color-line);
    padding-bottom: 4px;
    font-size: 1.05rem;
}
.review > div {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 12px;
    padding: 4px 0;
}
.review dt {
    color: var(--color-muted);
    font-weight: 600;
    font-size: 0.9rem;
}
.review dd { margin: 0; word-break: break-word; }

@media (max-width: 640px) {
    .review > div { grid-template-columns: 1fr; gap: 2px; }
}

/* Receipt on success page */
.receipt {
    margin: 16px 0;
    display: grid;
    gap: 8px;
}
.receipt > div {
    display: grid;
    grid-template-columns: 160px 1fr;
    gap: 12px;
    padding: 4px 0;
    border-bottom: 1px solid var(--color-line-soft);
}
.receipt dt { color: var(--color-muted); }
.receipt dd { margin: 0; }
.receipt code {
    background: var(--color-line-soft);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: ui-monospace, "SF Mono", Consolas, monospace;
}

/* Print-friendly review */
@media print {
    .site-header, .site-footer, .progress, .actions, .skip-link { display: none; }
    .card { box-shadow: none; border: 0; padding: 0; }
}
