*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0
}

:root {
    --red: #c0392b;
    --red-dark: #96281b;
    --red-light: #fdf3f2;
    --red-mid: #f5c6c2;
    --white: #fff;
    --gray-50: #fafaf9;
    --gray-100: #f5f4f0;
    --gray-200: #e8e6e0;
    --gray-300: #d4d0c8;
    --gray-400: #a0998c;
    --gray-600: #6b6560;
    --gray-700: #4a4740;
    --text: #1a1917;
    --serif: 'DM Serif Display', Georgia, serif;
    --sans: 'DM Sans', system-ui, sans-serif;
    --radius: 10px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --step-active: #c0392b;
    --step-done: #1a1917;
    --step-todo: #d4d0c8;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, .06), 0 1px 2px rgba(0, 0, 0, .04);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, .08), 0 2px 6px rgba(0, 0, 0, .04);
    --shadow-lg: 0 12px 40px rgba(0, 0, 0, .10), 0 4px 12px rgba(0, 0, 0, .05);
}

html {
    scroll-behavior: smooth
}

body {
    font-family: var(--sans);
    color: var(--text);
    background: var(--gray-100);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    font-size: 15px;
    line-height: 1.6
}

/* ── HEADER ── */
.site-header {
    background: var(--white);
    border-bottom: 1px solid var(--gray-200);
    padding: 14px 28px;
    display: flex;
    align-items: center;
    justify-content: space-between
}

.header-logo {
    font-family: var(--serif);
    font-size: 22px;
    color: var(--text);
    text-decoration: none;
    letter-spacing: -.5px
}

.header-logo em {
    color: var(--red);
    font-style: normal
}

.header-note {
    font-size: 13px;
    color: var(--gray-400)
}

.header-note a {
    color: var(--red);
    text-decoration: none;
    font-weight: 500
}

.header-note a:hover {
    text-decoration: underline
}

/* ── MAIN LAYOUT ── */
.form-shell {
    flex: 1;
    display: flex;
    gap: 0;
    max-width: 1100px;
    width: 100%;
    margin: 40px auto;
    padding: 0 20px
}

@media (max-width: 767px) {
    .form-shell {
        margin: 20px auto;
        padding: 0 12px
    }
}

/* ── PROGRESS SIDEBAR ── */
.progress-sidebar {
    width: 220px;
    flex-shrink: 0;
    margin-right: 32px
}

@media (max-width: 900px) {
    .progress-sidebar {
        display: none
    }
}

.progress-card {
    background: var(--white);
    border-radius: var(--radius-xl);
    border: 1px solid var(--gray-200);
    padding: 28px 20px;
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 28px
}

.progress-brand {
    font-family: var(--serif);
    font-size: 18px;
    margin-bottom: 6px
}

.progress-brand em {
    color: var(--red);
    font-style: normal
}

.progress-subtitle {
    font-size: 12px;
    color: var(--gray-400);
    margin-bottom: 28px;
    line-height: 1.5
}

.step-list {
    display: flex;
    flex-direction: column;
    gap: 0
}

.step-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 10px 0;
    position: relative
}

.step-item:not(:last-child)::after {
    content: '';
    position: absolute;
    left: 14px;
    top: 36px;
    bottom: -4px;
    width: 1px;
    background: var(--gray-200)
}

.step-icon {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 12px;
    font-weight: 600;
    transition: all .3s;
    border: 2px solid transparent;
    margin-top: 1px
}

.step-icon.todo {
    background: var(--gray-100);
    color: var(--gray-400);
    border-color: var(--gray-200)
}

.step-icon.active {
    background: var(--red);
    color: var(--white);
    border-color: var(--red);
    box-shadow: 0 0 0 3px rgba(192, 57, 43, .15)
}

.step-icon.done {
    background: var(--text);
    color: var(--white);
    border-color: var(--text)
}

.step-icon.done::after {
    content: '✓'
}

.step-meta {
    flex: 1
}

.step-num {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--gray-400);
    font-weight: 500
}

.step-name {
    font-size: 13px;
    font-weight: 500;
    color: var(--gray-600);
    transition: color .3s;
    line-height: 1.3
}

.step-item.active .step-name {
    color: var(--text);
    font-weight: 600
}

.step-item.done .step-name {
    color: var(--gray-600)
}

/* ── FORM CARD ── */
.form-card {
    flex: 1;
    min-width: 0;
    background: var(--white);
    border-radius: var(--radius-xl);
    border: 1px solid var(--gray-200);
    box-shadow: var(--shadow-md);
    overflow: hidden
}

/* mobile progress bar */
.mobile-progress {
    display: none;
    padding: 16px 24px;
    border-bottom: 1px solid var(--gray-100);
    background: var(--gray-50)
}

@media (max-width: 900px) {
    .mobile-progress {
        display: block
    }
}

.mob-step-label {
    font-size: 12px;
    color: var(--gray-400);
    margin-bottom: 8px;
    display: flex;
    justify-content: space-between
}

.mob-step-label span {
    font-weight: 600;
    color: var(--red)
}

.mob-progress-track {
    height: 4px;
    background: var(--gray-200);
    border-radius: 999px;
    overflow: hidden
}

.mob-progress-fill {
    height: 100%;
    background: var(--red);
    border-radius: 999px;
    transition: width .5s cubic-bezier(.4, 0, .2, 1)
}

/* ── STEP PANELS ── */
.step-panel {
    display: none
}

.step-panel.active {
    display: block
}

.step-panel.anim-in {
    animation: slideDown .38s cubic-bezier(.22, .68, 0, 1.2) both
}

.step-panel.anim-back {
    animation: slideUp .38s cubic-bezier(.22, .68, 0, 1.2) both
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-22px)
    }
    to {
        opacity: 1;
        transform: translateY(0)
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(22px)
    }
    to {
        opacity: 1;
        transform: translateY(0)
    }
}

.panel-header {
    padding: 36px 36px 24px;
    border-bottom: 1px solid var(--gray-100)
}

@media (max-width: 600px) {
    .panel-header {
        padding: 24px 20px 18px
    }
}

.panel-step-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--red-light);
    color: var(--red);
    border-radius: 999px;
    padding: 4px 12px;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 14px;
    letter-spacing: .3px
}

.panel-step-badge svg {
    width: 14px;
    height: 14px
}

.panel-title {
    font-family: var(--serif);
    font-size: clamp(26px, 4vw, 36px);
    font-weight: 400;
    line-height: 1.1;
    margin-bottom: 8px
}

.panel-sub {
    font-size: 14px;
    color: var(--gray-600);
    line-height: 1.65;
    max-width: 480px
}

.panel-body {
    padding: 28px 36px 32px
}

@media (max-width: 600px) {
    .panel-body {
        padding: 20px 20px 24px
    }
}

/* ── FORM FIELDS ── */
.form-grid {
    display: grid;
    grid-template-columns:1fr 1fr;
    gap: 18px
}

@media (max-width: 580px) {
    .form-grid {
        grid-template-columns:1fr
    }
}

.form-grid .span-2 {
    grid-column: 1/-1
}

.field {
    display: flex;
    flex-direction: column;
    gap: 5px
}

.field label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text)
}

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

.field input, .field select, .field textarea {
    padding: 11px 14px;
    border: 1.5px solid var(--gray-200);
    border-radius: var(--radius);
    font-family: var(--sans);
    font-size: 14px;
    color: var(--text);
    background: var(--white);
    outline: none;
    transition: border-color .15s, box-shadow .15s;
    width: 100%
}

.field input::placeholder, .field textarea::placeholder {
    color: var(--gray-300)
}

.field input:focus, .field select:focus, .field textarea:focus {
    border-color: var(--red);
    box-shadow: 0 0 0 3px rgba(192, 57, 43, .10)
}

.field input.error, .field select.error, .field textarea.error {
    border-color: #e53e3e;
    background: #fff8f8
}

.field input.ok, .field select.ok, .field textarea.ok {
    border-color: #38a169
}

.field select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23a0998c' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 36px;
    cursor: pointer
}

.field textarea {
    resize: vertical;
    min-height: 96px;
    line-height: 1.6
}

.err-msg {
    font-size: 12px;
    color: #e53e3e;
    display: none;
    margin-top: 2px;
    align-items: center;
    gap: 4px
}

.err-msg.show {
    display: flex
}

.field-hint {
    font-size: 12px;
    color: var(--gray-400);
    margin-top: 2px
}

/* phone field */
.phone-wrap {
    position: relative
}

.phone-wrap input {
    padding-left: 48px
}

.phone-flag {
    position: absolute;
    left: 13px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 18px;
    pointer-events: none;
    line-height: 1
}

.phone-hint-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 3px
}

.phone-format-hint {
    font-size: 11px;
    color: var(--gray-400)
}

.phone-valid-tick {
    font-size: 13px;
    color: #38a169;
    display: none
}

.phone-valid-tick.show {
    display: inline
}

/* upload stack — full width, no grid clipping on mobile */
.upload-stack {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 8px
}

.upload-doc-card {
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    overflow: hidden
}

.upload-doc-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 18px;
    background: var(--gray-50);
    border-bottom: 1px solid var(--gray-200)
}

.upload-doc-header .doc-icon {
    font-size: 22px
}

.upload-doc-header h4 {
    font-size: 14px;
    font-weight: 600;
    margin: 0
}

.upload-doc-header p {
    font-size: 12px;
    color: var(--gray-400);
    margin: 0
}

.upload-doc-body {
    padding: 16px 18px
}

.emp-entry {
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    padding: 18px;
    margin-bottom: 14px;
    position: relative
}

.emp-entry-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 14px;
    display: flex;
    justify-content: space-between;
    align-items: center
}

.btn-remove {
    background: none;
    border: none;
    color: var(--gray-400);
    cursor: pointer;
    font-size: 13px;
    padding: 2px 6px;
    border-radius: 6px;
    transition: color .15s, background .15s
}

.btn-remove:hover {
    color: var(--red);
    background: var(--red-light)
}

.btn-add {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    border: 1.5px dashed var(--gray-300);
    border-radius: var(--radius);
    padding: 9px 18px;
    font-family: var(--sans);
    font-size: 13px;
    font-weight: 500;
    color: var(--gray-600);
    background: none;
    cursor: pointer;
    transition: all .15s;
    margin-top: 4px
}

.btn-add:hover {
    border-color: var(--red);
    color: var(--red);
    background: var(--red-light)
}

/* file upload */
.upload-zone {
    border: 2px dashed var(--gray-300);
    border-radius: var(--radius-lg);
    padding: 32px 24px;
    text-align: center;
    background: var(--gray-50);
    cursor: pointer;
    transition: border-color .2s, background .2s;
    position: relative
}

.upload-zone:hover, .upload-zone.dragover {
    border-color: var(--red);
    background: var(--red-light)
}

.upload-zone input[type=file] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
    width: 100%;
    height: 100%
}

.upload-icon {
    font-size: 36px;
    margin-bottom: 10px
}

.upload-zone h4 {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 4px;
    color: var(--text)
}

.upload-zone p {
    font-size: 13px;
    color: var(--gray-400)
}

.upload-zone p strong {
    color: var(--red)
}

.upload-preview {
    display: none;
    margin-top: 16px;
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 12px 14px;
    align-items: center;
    gap: 12px
}

.upload-preview.show {
    display: flex
}

.preview-icon {
    font-size: 22px
}

.preview-info {
    flex: 1;
    min-width: 0
}

.preview-name {
    font-size: 13px;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap
}

.preview-size {
    font-size: 11px;
    color: var(--gray-400)
}

.preview-remove {
    background: none;
    border: none;
    color: var(--gray-400);
    cursor: pointer;
    font-size: 16px;
    padding: 2px;
    flex-shrink: 0;
    transition: color .15s
}

.preview-remove:hover {
    color: var(--red)
}

.upload-type-note {
    margin-top: 8px;
    font-size: 12px;
    color: var(--gray-400)
}

/* ── NAVIGATION BUTTONS ── */
.panel-footer {
    padding: 20px 36px 28px;
    border-top: 1px solid var(--gray-100);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px
}

@media (max-width: 600px) {
    .panel-footer {
        padding: 16px 20px 20px;
        flex-wrap: wrap
    }
}

.btn-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: none;
    background: none;
    font-family: var(--sans);
    font-size: 14px;
    font-weight: 500;
    color: var(--gray-600);
    cursor: pointer;
    padding: 10px 4px;
    transition: color .15s
}

.btn-back:hover {
    color: var(--text)
}

.btn-back svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0
}

.btn-next {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--red);
    color: var(--white);
    border: none;
    border-radius: var(--radius);
    padding: 12px 28px;
    font-family: var(--sans);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s, transform .1s;
    letter-spacing: .2px
}

.btn-next:hover {
    background: var(--red-dark);
    transform: translateY(-1px)
}

.btn-next:active {
    transform: translateY(0)
}

.btn-next svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0
}

/* ── CONFIRMATION PANEL ── */
.confirm-summary {
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    padding: 20px;
    margin-bottom: 24px
}

.confirm-section {
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--gray-200)
}

.confirm-section:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none
}

.confirm-section-title {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    font-weight: 600;
    color: var(--gray-400);
    margin-bottom: 12px
}

.confirm-grid {
    display: grid;
    grid-template-columns:1fr 1fr;
    gap: 8px 16px
}

@media (max-width: 500px) {
    .confirm-grid {
        grid-template-columns:1fr
    }
}

.confirm-item label {
    font-size: 11px;
    color: var(--gray-400);
    display: block;
    margin-bottom: 2px;
    text-transform: uppercase;
    letter-spacing: .8px
}

.confirm-item span {
    font-size: 14px;
    color: var(--text);
    font-weight: 500
}

.terms-check {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 20px;
    padding: 16px;
    background: var(--gray-50);
    border-radius: var(--radius);
    border: 1px solid var(--gray-200)
}

.terms-check input[type=checkbox] {
    width: 16px;
    height: 16px;
    accent-color: var(--red);
    flex-shrink: 0;
    margin-top: 2px;
    cursor: pointer
}

.terms-check label {
    font-size: 13px;
    color: var(--gray-700);
    line-height: 1.55;
    cursor: pointer
}

.terms-check label a {
    color: var(--red);
    text-decoration: none;
    font-weight: 500
}

.terms-check label a:hover {
    text-decoration: underline
}

.btn-submit {
    width: 100%;
    background: var(--red);
    color: var(--white);
    border: none;
    border-radius: var(--radius);
    padding: 14px;
    font-family: var(--sans);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s, transform .1s;
    letter-spacing: .3px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px
}

.btn-submit:hover {
    background: var(--red-dark);
    transform: translateY(-1px)
}

.btn-submit:active {
    transform: translateY(0)
}

/* ── SUCCESS ── */
.success-panel {
    display: none;
    padding: 56px 36px;
    text-align: center
}

.success-panel.show {
    display: block;
    animation: fadeSlide .5s ease both
}

.success-icon {
    font-size: 52px;
    margin-bottom: 16px
}

.success-panel h2 {
    font-family: var(--serif);
    font-size: 32px;
    font-weight: 400;
    margin-bottom: 12px
}

.success-panel p {
    font-size: 15px;
    color: var(--gray-600);
    max-width: 380px;
    margin: 0 auto 28px;
    line-height: 1.7
}

.btn-home {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--red);
    color: var(--white);
    border: none;
    border-radius: var(--radius);
    padding: 12px 28px;
    font-family: var(--sans);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: background .15s
}

.btn-home:hover {
    background: var(--red-dark)
}

/* ── DECORATION ── */
.deco-ring {
    position: fixed;
    pointer-events: none;
    opacity: .04;
    border-radius: 50%;
    border: 1.5px solid var(--red)
}

.deco-ring-1 {
    width: 400px;
    height: 400px;
    top: -100px;
    right: -80px
}

.deco-ring-2 {
    width: 260px;
    height: 260px;
    bottom: 60px;
    left: -80px
}
