:root {
    --primary: #1a4d7c;
    --primary-dark: #143d63;
    --primary-light: #e8f1f8;
    --accent: #2e6da4;
    --bg: #f0f4f8;
    --panel: #ffffff;
    --text: #1e293b;
    --muted: #64748b;
    --border: #cbd5e1;
    --border-focus: #1a4d7c;
    --err: #b91c1c;
    --err-bg: #fef2f2;
    --ok: #166534;
    --ok-bg: #f0fdf4;
    --font: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    min-height: 100vh;
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

.page-header {
    background: var(--primary);
    color: #fff;
    padding: 1.25rem 1rem 1rem;
    text-align: center;
    border-bottom: 4px solid #0f3558;
}

.header-logo-wrap {
    margin-bottom: 0.75rem;
}

.header-logo {
    max-height: 56px;
    max-width: 200px;
    object-fit: contain;
    background: #fff;
    padding: 6px 10px;
    border-radius: 4px;
}

.header-badges {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.header-badge {
    height: 36px;
    max-width: 100px;
    object-fit: contain;
    background: rgba(255, 255, 255, 0.95);
    padding: 4px 8px;
    border-radius: 4px;
}

.turnstile-wrap {
    margin: 1rem 0 0.5rem;
    display: flex;
    justify-content: center;
}

.page-header__title {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    line-height: 1.35;
}

.page-header__sub {
    margin: 0.35rem 0 0;
    font-size: 0.8rem;
    opacity: 0.9;
    font-weight: 400;
}

.wrap {
    max-width: 620px;
    margin: 0 auto;
    padding: 1.5rem 1rem 2.5rem;
}

.card {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 1.5rem 1.25rem;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
}

.card h2 {
    margin: 0 0 0.35rem;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--primary);
}

.card .lead {
    color: var(--muted);
    font-size: 0.875rem;
    margin: 0 0 1.25rem;
    line-height: 1.55;
}

label {
    display: block;
    font-size: 0.8rem;
    color: var(--text);
    margin-bottom: 0.35rem;
    font-weight: 600;
}

label .req {
    color: var(--err);
    margin-left: 2px;
}

.field { margin-bottom: 1.1rem; }

input, textarea {
    width: 100%;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 0.65rem 0.75rem;
    color: var(--text);
    font-size: 0.95rem;
    font-family: inherit;
    transition: border-color 0.15s, box-shadow 0.15s;
}

input::placeholder, textarea::placeholder {
    color: #94a3b8;
    font-size: 0.875rem;
}

input:focus, textarea:focus {
    outline: none;
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgba(26, 77, 124, 0.12);
}

textarea { resize: vertical; min-height: 80px; }

.pdpa-box {
    background: var(--primary-light);
    border: 1px solid #b8d4ea;
    border-radius: 4px;
    padding: 1rem;
    margin: 1.25rem 0 1rem;
    font-size: 0.8rem;
    color: #334155;
    line-height: 1.6;
}

.pdpa-box h3 {
    margin: 0 0 0.5rem;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--primary);
}

.pdpa-box ul {
    margin: 0.5rem 0 0;
    padding-left: 1.15rem;
}

.pdpa-box li { margin-bottom: 0.35rem; }

.pdpa-consent {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    margin-top: 1rem;
    cursor: pointer;
    font-size: 0.8rem;
    color: var(--text);
    line-height: 1.5;
}

.pdpa-consent input[type="checkbox"] {
    width: 1.1rem;
    height: 1.1rem;
    margin-top: 0.15rem;
    flex-shrink: 0;
    accent-color: var(--primary);
    cursor: pointer;
}

.btn {
    width: 100%;
    margin-top: 0.75rem;
    padding: 0.85rem 1rem;
    border: none;
    border-radius: 4px;
    background: var(--primary);
    color: #fff;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: background 0.15s;
    letter-spacing: 0.02em;
}

.btn:hover:not(:disabled) { background: var(--primary-dark); }

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn--ghost {
    background: #fff;
    border: 1px solid var(--border);
    color: var(--primary);
    margin-top: 0.75rem;
}

.btn--ghost:hover:not(:disabled) {
    background: var(--primary-light);
}

.hidden { display: none !important; }

.state-msg {
    text-align: center;
    padding: 2.5rem 1rem;
    color: var(--muted);
    font-size: 0.9rem;
}

.state-msg--err { color: var(--err); }

.success-panel {
    text-align: center;
    padding: 0.5rem 0;
}

.success-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 1rem;
    border-radius: 50%;
    background: var(--ok-bg);
    border: 2px solid #86efac;
    color: var(--ok);
    font-size: 1.75rem;
    line-height: 52px;
    font-weight: 700;
}

.success-panel h2 {
    margin: 0 0 0.5rem;
    color: var(--ok);
    font-size: 1.1rem;
}

.success-panel .lead {
    margin-bottom: 0;
}

.trust-footer {
    text-align: center;
    margin-top: 1.5rem;
    font-size: 0.75rem;
    color: var(--muted);
    line-height: 1.5;
}

.trust-footer .secure {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    color: #475569;
    font-weight: 500;
}

.toast {
    position: fixed;
    bottom: 1.25rem;
    left: 50%;
    transform: translateX(-50%);
    max-width: 92%;
    padding: 0.75rem 1rem;
    border-radius: 4px;
    font-size: 0.85rem;
    z-index: 100;
    box-shadow: 0 4px 16px rgba(15, 23, 42, 0.12);
}

.toast--ok {
    background: var(--ok-bg);
    border: 1px solid #86efac;
    color: var(--ok);
}

.toast--err {
    background: var(--err-bg);
    border: 1px solid #fca5a5;
    color: var(--err);
}

@media (min-width: 480px) {
    .page-header__title { font-size: 1.25rem; }
    .wrap { padding: 2rem 1.25rem 3rem; }
    .card { padding: 1.75rem 1.5rem; }
}

/* ── Wizard borang penuh ── */
.form-intro { margin-bottom: 1rem; }
.form-intro .lead { margin-bottom: 0; }

.wizard-progress { margin-bottom: 1.25rem; }
.wizard-progress__bar {
    height: 6px;
    background: #e2e8f0;
    border-radius: 99px;
    overflow: hidden;
}
.wizard-progress__bar span {
    display: block;
    height: 100%;
    width: 0;
    background: var(--primary);
    border-radius: 99px;
    transition: width 0.25s ease;
}
.wizard-progress__text {
    margin: 0.4rem 0 0;
    font-size: 0.75rem;
    color: var(--muted);
    font-weight: 600;
}

.step-title {
    margin: 0 0 0.75rem;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--primary);
}
.step-sub {
    margin: 0 0 0.35rem;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text);
}
.step-hint {
    margin: 0 0 0.75rem;
    font-size: 0.8rem;
    color: var(--muted);
    line-height: 1.5;
}

.field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}
.field-row--tight { gap: 0.5rem; }
@media (max-width: 420px) {
    .field-row { grid-template-columns: 1fr; }
}

.choice-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}
.choice-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    background: #fff;
    margin: 0;
}
.choice-chip:has(input:checked) {
    border-color: var(--primary);
    background: var(--primary-light);
    color: var(--primary);
}
.choice-chip input { accent-color: var(--primary); }

.komitmen-list { display: flex; flex-direction: column; gap: 0.75rem; margin-bottom: 0.5rem; }
.komitmen-row {
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: #fafbfc;
}
.komitmen-row__head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.komitmen-remove {
    border: none;
    background: transparent;
    color: var(--err);
    font-size: 1.25rem;
    line-height: 1;
    cursor: pointer;
    padding: 0 0.25rem;
}
.komitmen-row input {
    margin-bottom: 0.45rem;
}
.komitmen-row input:last-child { margin-bottom: 0; }

.doc-checklist {
    background: var(--primary-light);
    border: 1px solid #b8d4ea;
    border-radius: 6px;
    padding: 0.85rem 1rem;
    margin-bottom: 1rem;
    font-size: 0.8rem;
}
.doc-checklist ul {
    margin: 0.5rem 0 0;
    padding-left: 1.1rem;
}
.doc-checklist li { margin-bottom: 0.25rem; }

.file-field .field-note {
    margin: 0.35rem 0 0;
    font-size: 0.75rem;
    color: var(--muted);
}
.optional { font-weight: 400; color: var(--muted); font-size: 0.75rem; }
.file-input { font-size: 0.85rem; padding: 0.5rem; }

.wizard-nav {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.65rem;
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}
.wizard-nav .btn { margin-top: 0; }
.wizard-nav #btn-submit { grid-column: 1 / -1; }

.btn--sm {
    width: auto;
    display: inline-block;
    padding: 0.45rem 0.85rem;
    font-size: 0.8rem;
    margin-top: 0.25rem;
}
.btn--inline {
    display: inline-block;
    width: auto;
    max-width: 200px;
    margin: 1rem auto 0;
    text-align: center;
    text-decoration: none;
}

.upload-progress {
    margin-top: 1rem;
    padding: 0.75rem;
    background: var(--primary-light);
    border-radius: 6px;
    font-size: 0.8rem;
}
.upload-progress__bar {
    height: 5px;
    background: #cbd5e1;
    border-radius: 99px;
    margin-top: 0.5rem;
    overflow: hidden;
}
.upload-progress__bar span {
    display: block;
    height: 100%;
    width: 0;
    background: var(--primary);
    transition: width 0.2s;
}
