:root {
    --berry: #9b1f62;
    --plum: #682161;
    --indigo: #3e3764;
    --slate: #283043;
    --paper: #f6f3f8;
    --white: #ffffff;
    --line: rgba(40, 48, 67, 0.14);
    --text: #1e2430;
    --shadow: 0 18px 48px rgba(40, 48, 67, 0.14);
}

* { box-sizing: border-box; }

body {
    margin: 0;
    min-height: 100vh;
    font-family: "Trebuchet MS", "Segoe UI", sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at top left, rgba(155, 31, 98, 0.18), transparent 30%),
        radial-gradient(circle at bottom right, rgba(62, 55, 100, 0.18), transparent 30%),
        linear-gradient(135deg, #f8f6fb 0%, #eef0f5 100%);
}

img {
    max-width: 100%;
    height: auto;
}

.page-shell { display: grid; grid-template-columns: 320px minmax(0, 1fr); min-height: 100vh; }
.page-sidebar { padding: 48px 32px; color: var(--white); background: linear-gradient(180deg, var(--berry), var(--plum) 45%, var(--slate)); }
.sidebar-logo { width: 180px; margin: 0 0 20px; }
.mobile-brand {
    display: none;
    align-items: center;
    gap: 12px;
    padding: 18px 20px 0;
    color: var(--slate);
}
.mobile-brand img { width: 140px; }
.mobile-brand span { font-size: 1.05rem; font-weight: 700; }
.eyebrow, .section-kicker { margin: 0 0 12px; text-transform: uppercase; letter-spacing: 0.18em; font-size: 0.78rem; font-weight: 700; }
.page-sidebar h1 { margin: 0 0 16px; font-size: clamp(2rem, 4vw, 3rem); line-height: 0.95; }
.sidebar-copy { margin: 0 0 36px; color: rgba(255, 255, 255, 0.82); line-height: 1.6; }

.step-list { margin: 0; padding: 0; list-style: none; display: grid; gap: 12px; }
.step-link {
    width: 100%;
    display: grid;
    grid-template-columns: 24px 1fr;
    gap: 12px;
    align-items: center;
    padding: 14px 16px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 16px;
    color: rgba(255, 255, 255, 0.72);
    background: rgba(255, 255, 255, 0.06);
    font: inherit;
    text-align: left;
    cursor: pointer;
}
.step-index {
    width: 24px;
    height: 24px;
    border-radius: 999px;
    display: grid;
    place-items: center;
    font-size: 0.8rem;
    font-weight: 700;
    background: rgba(255, 255, 255, 0.14);
}
.step-link.is-active, .step-link.is-complete { color: var(--white); border-color: rgba(255, 255, 255, 0.28); background: rgba(255, 255, 255, 0.12); }
.step-link.is-complete .step-index, .step-link.is-active .step-index { background: var(--white); color: var(--berry); }

.page-content { padding: 40px; min-width: 0; }
form {
    width: 100%;
    margin: 0 auto;
    padding: 32px;
    border: 1px solid var(--line);
    border-radius: 28px;
    background: rgba(255, 255, 255, 0.88);
    box-shadow: var(--shadow);
    backdrop-filter: blur(10px);
}

.form-step { display: none; }
.form-step.is-active { display: block; animation: fadeUp 220ms ease; }
.section-heading { margin-bottom: 28px; }
.section-heading h2 { margin: 0; font-size: clamp(1.6rem, 2vw, 2.2rem); }
.section-kicker { color: var(--berry); }

.form-grid { display: grid; gap: 18px; min-width: 0; }
.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.section-row-gap { margin-top: 18px; }

.field, .check-field { display: grid; gap: 8px; min-width: 0; }
.field span { font-weight: 700; color: var(--slate); }
.field input, .field select, .field textarea {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    padding: 14px 16px;
    border: 1px solid var(--line);
    border-radius: 14px;
    font: inherit;
    color: var(--text);
    background: #fff;
    transition: border-color 140ms ease, box-shadow 140ms ease;
}
.field input:focus, .field select:focus, .field textarea:focus {
    outline: none;
    border-color: var(--berry);
    box-shadow: 0 0 0 4px rgba(155, 31, 98, 0.12);
}

.field-full { grid-column: 1 / -1; }
.split-card, .conditional-block, .status-block {
    margin-top: 20px;
    padding: 24px;
    border: 1px solid var(--line);
    border-radius: 22px;
    background: linear-gradient(180deg, rgba(246, 243, 248, 0.9), rgba(255, 255, 255, 0.95));
}
.split-card h3 { margin: 0 0 18px; font-size: 1.1rem; }

.check-field {
    grid-template-columns: 20px 1fr;
    align-items: start;
    margin-top: 24px;
    padding: 18px;
    border-radius: 18px;
    background: var(--paper);
}
.check-field input { margin-top: 3px; }

.form-actions { display: flex; justify-content: space-between; gap: 16px; margin-top: 32px; }
.mobile-stepper {
    display: none;
    gap: 10px;
    margin-top: 22px;
    padding-bottom: 4px;
    overflow-x: auto;
}
.mobile-step-link {
    min-width: 44px;
    height: 44px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #fff;
    color: var(--slate);
    font: inherit;
    font-weight: 700;
    cursor: pointer;
    flex: 0 0 auto;
}
.mobile-step-link.is-active, .mobile-step-link.is-complete {
    color: var(--white);
    border-color: var(--berry);
    background: linear-gradient(135deg, var(--berry), var(--indigo));
}

.button {
    border: 0;
    border-radius: 999px;
    padding: 14px 24px;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}
.button:disabled { cursor: not-allowed; opacity: 0.55; }
.button-secondary { color: var(--slate); background: rgba(40, 48, 67, 0.08); }
.button-primary { color: var(--white); background: linear-gradient(135deg, var(--berry), var(--indigo)); box-shadow: 0 12px 30px rgba(104, 33, 97, 0.25); }
.is-hidden { display: none; }

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 980px) {
    .page-shell { grid-template-columns: 1fr; }
    .page-sidebar, .page-content { padding: 24px; }
}

@media (max-width: 760px) {
    body { overflow-x: hidden; }
    .mobile-brand { display: flex; }
    .page-sidebar { display: none; }
    .page-content { padding: 16px; min-width: 0; }
    form { max-width: 100%; padding: 18px; border-radius: 22px; overflow-x: hidden; }
    .cols-2, .cols-3, .cols-4 { grid-template-columns: 1fr; }
    .form-actions { flex-wrap: wrap; }
    .button { width: 100%; }
    .mobile-stepper { display: flex; }
}
/* --- Success Modal Styles --- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(40, 48, 67, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}
.modal-overlay.is-hidden {
    display: none;
}
.modal-content {
    background: var(--white);
    padding: 40px;
    border-radius: 28px;
    max-width: 420px;
    text-align: center;
    box-shadow: var(--shadow);
    animation: fadeUp 0.3s ease;
    margin: 20px;
}
.modal-icon {
    font-size: 54px;
    margin-bottom: 16px;
}
.modal-content h2 {
    margin: 0 0 12px;
    color: var(--berry);
}
.modal-content p {
    margin: 0 0 28px;
    color: var(--slate);
    line-height: 1.6;
}
.modal-content .button {
    width: 100%;
}