*, *::before, *::after { box-sizing: border-box; }
body { background: #f0f4f8; font-family: 'Segoe UI', Arial, sans-serif; margin: 0; padding: 0; color:#222; }

.page-wrap { max-width: 820px; margin: 0 auto; padding: 0 16px 60px; }

/* Sticky header w/ steps */
.top-header { background: #fff; box-shadow: 0 2px 12px rgba(0,0,0,.06); position: sticky; top: 0; z-index: 500; padding-bottom: 4px; }
.logo-bar { text-align: center; padding: 22px 0 4px; }
.logo-bar img { height: 46px; }

.page-title { text-align: center; color: #1a5fa8; font-size: 24px; font-weight: 700; margin: 0 0 4px; }
.page-subtitle { text-align: center; color: #666; font-size: 13px; margin: 0 0 14px; }

.offline-link-bar { text-align: center; margin-bottom: 20px; }
.btn-offline { display: inline-flex; align-items: center; gap: 6px; background: #eef5ff; color: #1a5fa8;
    border: 1px solid #a0bcd8; padding: 7px 16px; border-radius: 20px; text-decoration: none;
    font-size: 12px; font-weight: 600; transition: background .2s, border-color .2s; }
.btn-offline:hover { background: #dfeaff; border-color: #1a5fa8; color: #144d8a; text-decoration: none; }

/* Progress bar */
.progress-track { max-width: 820px; margin: 0 auto; padding: 0 16px 18px; }
.progress-bar-bg { height: 6px; background: #e3ecf7; border-radius: 4px; overflow: hidden; margin-bottom: 22px; }
.progress-bar-fill { height: 100%; background: linear-gradient(90deg,#1a5fa8,#2f7fd0); border-radius: 4px; transition: width .35s ease; width: 25%; }

.steps-bar { display: flex; align-items: flex-start; justify-content: center; gap: 0; }
.step-item { display: flex; flex-direction: column; align-items: center; flex: 1; max-width: 200px; position: relative; cursor: default; }
.step-item.clickable { cursor: pointer; }
.step-item:not(:last-child)::after {
    content: ''; position: absolute; top: 18px; left: calc(50% + 18px);
    right: calc(-50% + 18px); height: 2px; background: #c8d8ea; z-index: 0;
}
.step-item.completed:not(:last-child)::after { background: #1a5fa8; }
.step-circle { width: 36px; height: 36px; border-radius: 50%; background: #c8d8ea; color: #fff;
    display: flex; align-items: center; justify-content: center; font-size: 15px; font-weight: 700;
    z-index: 1; transition: background .2s, box-shadow .2s; }
.step-item.active .step-circle { background: #1a5fa8; box-shadow: 0 2px 8px rgba(26,95,168,.35); }
.step-item.completed .step-circle { background: #43a047; }
.step-label { font-size: 12px; color: #888; margin-top: 6px; text-align: center; font-weight: 600; }
.step-item.active .step-label, .step-item.completed .step-label { color: #333; }

/* Cards */
.card { background: #fff; border-radius: 12px; box-shadow: 0 2px 16px rgba(0,0,0,.07); padding: 28px 32px; margin: 24px 0; }
.section-title { font-size: 12px; font-weight: 700; color: #1a5fa8; text-transform: uppercase; letter-spacing: .6px;
    margin: 26px 0 16px; padding-bottom: 8px; border-bottom: 1px dashed #e2eaf5; }
.section-title:first-child { margin-top: 0; }
.section-hint { font-size: 12px; color: #888; margin: -10px 0 16px; }

/* Grid */
.row { display: flex; flex-wrap: wrap; gap: 16px; margin: 0 -8px; }
.col-6 { flex: 1 1 calc(50% - 16px); min-width: 220px; }
.col-4 { flex: 1 1 calc(33.333% - 16px); min-width: 180px; }
.col-12 { flex: 1 1 100%; }

/* Form fields */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 13px; font-weight: 600; color: #333; margin-bottom: 6px; }
.form-group label .req { color: #e53935; margin-left: 2px; }
.form-control { width: 100%; padding: 10px 12px; font-size: 14px; border: 1px solid #cfd8e3; border-radius: 6px;
    background: #fff; transition: border-color .15s, box-shadow .15s; font-family: inherit; }
.form-control:focus { outline: none; border-color: #1a5fa8; box-shadow: 0 0 0 3px rgba(26,95,168,.12); }
.form-control.error { border-color: #e53935; }
textarea.form-control { resize: vertical; min-height: 80px; }
.field-error { display: none; font-size: 12px; color: #e53935; margin-top: 5px; }
.form-group.has-error .field-error { display: block; }

/* Address autocomplete dropdown */
.addr-suggest-wrap { position: relative; }
.addr-suggest-list { position: absolute; left: 0; right: 0; top: 100%; z-index: 50;
    background: #fff; border: 1px solid #cfd8e3; border-radius: 6px; margin-top: 4px;
    box-shadow: 0 4px 16px rgba(0,0,0,.1); max-height: 220px; overflow-y: auto; }
.addr-suggest-list:empty { display: none; border: none; box-shadow: none; margin-top: 0; }
.addr-suggest-item { padding: 9px 12px; font-size: 13px; color: #333; cursor: pointer; }
.addr-suggest-item:hover { background: #eef5ff; color: #1a5fa8; }
.addr-suggest-item:not(:last-child) { border-bottom: 1px solid #f0f0f0; }

/* Toggle pills */
.toggle-group { display: inline-flex; border: 1px solid #cfd8e3; border-radius: 6px; overflow: hidden; }
.toggle-btn { padding: 9px 22px; font-size: 13px; font-weight: 600; color: #555; background: #fff; border: none;
    cursor: pointer; transition: background .15s, color .15s; }
.toggle-btn:not(:last-child) { border-right: 1px solid #cfd8e3; }
.toggle-btn.active { background: #1a5fa8; color: #fff; }

/* Repeatable mini-cards */
.mini-card { border: 1px solid #e3ecf7; border-radius: 8px; padding: 18px 20px; margin-bottom: 14px; background: #fafcff; position: relative; }
.mini-card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.mini-card-head h4 { margin: 0; font-size: 13px; font-weight: 700; color: #1a5fa8; }
.mini-remove { color: #e53935; font-size: 12px; font-weight: 600; cursor: pointer; background: none; border: none; }
.btn-add { display: inline-flex; align-items: center; gap: 6px; background: #eef5ff; color: #1a5fa8; border: 1px dashed #a0bcd8;
    padding: 9px 16px; border-radius: 6px; font-size: 13px; font-weight: 600; cursor: pointer; }
.btn-add:hover { background: #e0edff; }

/* Drop zone */
.drop-zone { border: 2px dashed #a0bcd8; border-radius: 10px; padding: 26px 20px; text-align: center;
    cursor: pointer; transition: border-color .2s, background .2s; background: #f7fbff; }
.drop-zone:hover, .drop-zone.drag-over { border-color: #1a5fa8; background: #eef5ff; }
.drop-zone .dz-icon { font-size: 30px; color: #a0bcd8; margin-bottom: 6px; }
.drop-zone .dz-label { font-size: 13px; font-weight: 600; color: #333; }
.drop-zone .dz-sub { font-size: 11px; color: #888; }
.drop-zone input[type=file] { display: none; }
.file-selected { margin-top: 12px; display: none; align-items: center; gap: 10px; padding: 9px 14px;
    background: #eef5ff; border-radius: 6px; border: 1px solid #b8d0ed; }
.file-selected .fs-name { font-size: 13px; color: #1a5fa8; font-weight: 600; flex: 1; }
.file-selected .fs-remove { color: #999; cursor: pointer; font-size: 16px; text-decoration: none; }

.note-box { background: #fffbea; border-left: 4px solid #f0b429; border-radius: 6px;
    padding: 12px 16px; font-size: 13px; color: #555; margin-top: 18px; }
.note-icon { display: inline-flex; align-items: center; justify-content: center; width: 16px; height: 16px;
    border-radius: 50%; background: #f0b429; color: #fff; font-size: 11px; font-weight: 700; margin-right: 4px; }

/* Review */
.review-block { margin-bottom: 18px; }
.review-block h4 { font-size: 12px; text-transform: uppercase; letter-spacing: .5px; color: #1a5fa8; margin: 0 0 8px; }
.review-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px 20px; font-size: 13px; }
.review-grid .rk { color: #888; }
.review-grid .rv { color: #222; font-weight: 600; word-break: break-word; }
.review-empty { font-size: 13px; color: #aaa; font-style: italic; }
.edit-link { font-size: 12px; color: #1a5fa8; cursor: pointer; font-weight: 600; }

/* Signature */
.sig-input { font-family: 'Brush Script MT', 'Segoe Script', cursive; font-size: 30px; border: none;
    border-bottom: 2px solid #1a5fa8; background: transparent; width: 100%; padding: 6px 4px; color: #1a5fa8; }
.sig-input:focus { outline: none; }
.captcha-box { display: flex; align-items: center; gap: 12px; border: 1px solid #cfd8e3; border-radius: 8px;
    padding: 14px 16px; background: #f7fbff; }
.captcha-box input[type=checkbox] { width: 20px; height: 20px; }
.captcha-box .cb-label { font-size: 13px; color: #444; }
.captcha-box .cb-sub { font-size: 11px; color: #999; margin-top: 2px; }

.certify-row { display: flex; align-items: flex-start; gap: 10px; margin-top: 16px; }
.certify-row input[type=checkbox] { margin-top: 3px; width: 16px; height: 16px; flex-shrink: 0; }
.certify-row label { font-size: 12px; color: #666; line-height: 1.5; }

/* Nav buttons */
.stage-nav { display: flex; justify-content: space-between; margin-top: 8px; }
.btn-back { padding: 12px 24px; background: #fff; color: #1a5fa8; border: 1px solid #1a5fa8;
    border-radius: 8px; font-size: 14px; font-weight: 700; cursor: pointer; transition: background .2s; }
.btn-back:hover { background: #eef5ff; }
.btn-back:disabled { opacity: .35; cursor: not-allowed; }
.btn-next, .btn-submit { padding: 12px 28px; background: #1a5fa8; color: #fff; border: none;
    border-radius: 8px; font-size: 14px; font-weight: 700; cursor: pointer; transition: background .2s; }
.btn-next:hover, .btn-submit:hover { background: #144d8a; }

/* Stage visibility */
.stage { display: none; }
.stage.active { display: block; }

/* Modal (spinner / success) */
.modal-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 9000;
    align-items: center; justify-content: center; }
.modal-overlay.active { display: flex; }
.modal-box { background: #fff; border-radius: 14px; padding: 36px 40px; max-width: 420px; width: 90%;
    text-align: center; box-shadow: 0 8px 40px rgba(0,0,0,.18); }
.modal-box.success-box { border-top: 5px solid #43a047; }
.spinner-steps { list-style: none; padding: 0; margin: 24px 0 0; text-align: left; }
.spinner-steps li { display: flex; align-items: center; gap: 14px; padding: 10px 0;
    border-bottom: 1px solid #f0f0f0; font-size: 14px; color: #aaa; }
.spinner-steps li:last-child { border-bottom: none; }
.spinner-steps li.active { color: #1a5fa8; font-weight: 600; }
.spinner-steps li.done { color: #43a047; }
.spinner-steps li .s-icon { width: 26px; height: 26px; border-radius: 50%; display: flex;
    align-items: center; justify-content: center; font-size: 13px; flex-shrink: 0; background: #eee; }
.spinner-steps li.active .s-icon { background: #1a5fa8; color:#fff; }
.spinner-steps li.done .s-icon { background: #43a047; color:#fff; }
.modal-title { font-size: 20px; font-weight: 700; margin: 0 0 6px; }
.modal-sub { font-size: 13px; color: #777; margin: 0; }
.modal-btn { margin-top: 24px; padding: 10px 28px; border: none; border-radius: 6px; cursor: pointer;
    font-size: 14px; font-weight: 600; background:#43a047; color:#fff; }
.modal-btn:hover { background:#2e7d32; }
.success-icon { font-size: 52px; color: #43a047; }

@media (max-width: 640px) {
    .col-6, .col-4 { flex: 1 1 100%; }
    .review-grid { grid-template-columns: 1fr; }
    .step-label { display: none; }
}
