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

:root {
    --ink: #1a1614;
    --ink-2: #4a3f3a;
    --ink-3: #8a7a74;
    --cream: #faf7f2;
    --warm: #f3ede3;
    --border: #e0d8cc;
    --gold: #b08d57;
    --gold-light: #d4b47a;
    --gold-pale: #f5edd8;
    --red: #c0392b;
    --green: #2e7d55;
    --radius: 4px;
    --transition: 0.35s cubic-bezier(.4, 0, .2, 1);
}

html {
    font-size: 18px;
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    background: var(--cream);
    color: var(--ink);
    font-family: "DM Sans", sans-serif;
    font-weight: 400;
    line-height: 1.6;
}

img {
    display: block;
    max-width: 100%;
}

.shell {
    display: grid;
    grid-template-columns: 340px 1fr;
    min-height: 100vh;
}

.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 2rem;
    padding: 3rem 2.5rem;
    background: var(--ink);
    color: var(--cream);
}

.sidebar-ornament {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    opacity: 0.5;
}

.sidebar-ornament::before,
.sidebar-ornament::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--gold);
}

.sidebar-ornament svg {
    width: 18px;
    height: 18px;
    fill: var(--gold);
}

.sidebar-eyebrow,
.step-header-eyebrow,
.review-card-head span,
.review-row dt,
.declaration-box strong {
    font-size: 0.65rem;
    font-weight: 500;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

.sidebar-eyebrow {
    color: var(--gold-light);
}

.sidebar-title,
.step-header h2,
.gift-aid-section h3,
.amount-highlight,
.amount-wrap input,
.confirm-card h1 {
    font-family: "Cormorant Garamond", serif;
}

.sidebar-title {
    color: #fff;
    font-size: 1.7rem;
    font-weight: 500;
    line-height: 1.25;
}

.sidebar-body {
    color: rgba(250, 247, 242, 0.65);
    font-size: 0.875rem;
    line-height: 1.7;
}

.sidebar-meta {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(176, 141, 87, 0.25);
}

.sidebar-meta-item dt {
    margin-bottom: 0.2rem;
    color: var(--gold-light);
    font-size: 0.65rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.sidebar-meta-item dd {
    color: rgba(250, 247, 242, 0.75);
    font-size: 0.8rem;
}

.sidebar-img {
    width: 100%;
    height: 160px;
    border-radius: var(--radius);
    object-fit: cover;
    opacity: 0.7;
    filter: sepia(20%);
}

.step-nav {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.step-nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0;
    cursor: default;
    transition: var(--transition);
}

.step-num {
    width: 26px;
    height: 26px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(176, 141, 87, 0.4);
    border-radius: 50%;
    color: var(--gold-light);
    font-size: 0.7rem;
    font-weight: 500;
    transition: var(--transition);
}

.step-nav-item.is-active .step-num {
    background: var(--gold);
    border-color: var(--gold);
    color: var(--ink);
}

.step-nav-item.is-done .step-num {
    background: transparent;
    border-color: var(--gold);
    color: var(--gold);
}

.step-nav-item.is-done .step-num::after {
    content: "\2713";
    font-size: 0.75rem;
}

.step-nav-item.is-done .step-num span {
    display: none;
}

.step-label {
    color: rgba(250, 247, 242, 0.45);
    font-size: 0.8rem;
    transition: var(--transition);
}

.step-nav-item.is-active .step-label {
    color: #fff;
    font-weight: 500;
}

.step-nav-item.is-done .step-label {
    color: rgba(250, 247, 242, 0.65);
}

.main {
    max-width: 680px;
    padding: 3.5rem 3rem 5rem;
}

.progress-bar-wrap {
    height: 2px;
    margin-bottom: 3rem;
    overflow: hidden;
    border-radius: 99px;
    background: var(--border);
}

.progress-bar-fill {
    width: 0%;
    height: 100%;
    border-radius: 99px;
    background: var(--gold);
    transition: width 0.5s cubic-bezier(.4, 0, .2, 1);
}

.form-step {
    display: none;
    animation: fadeSlideIn 0.4s ease both;
}

.form-step.is-visible {
    display: block;
}

@keyframes fadeSlideIn {
    from {
        opacity: 0;
        transform: translateY(14px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.step-header {
    margin-bottom: 2.25rem;
}

.step-header-eyebrow {
    margin-bottom: 0.5rem;
    color: var(--gold);
}

.step-header h2 {
    margin-bottom: 0.6rem;
    color: var(--ink);
    font-size: 2rem;
    font-weight: 500;
    line-height: 1.2;
}

.step-header p,
.lede,
.microcopy {
    max-width: 480px;
    color: var(--ink-3);
    font-size: 0.875rem;
}

.field-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
}

.field {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.field.span-2 {
    grid-column: 1 / -1;
}

.field label,
.field > span {
    color: var(--ink-2);
    font-size: 0.78rem;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.field input,
.field select,
.ts-wrapper.single .ts-control {
    width: 100%;
    padding: 0.7rem 0.9rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    appearance: none;
    background: #fff;
    color: var(--ink);
    font-family: "DM Sans", sans-serif;
    font-size: 1rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.field input:focus,
.field select:focus,
.ts-wrapper.single.focus .ts-control {
    outline: none;
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(176, 141, 87, 0.12);
}

.field input.is-error,
.field select.is-error {
    border-color: var(--red);
}

.field-error {
    margin-top: -0.2rem;
    color: var(--red);
    font-size: 0.85rem;
}

.amount-wrap {
    display: flex;
    align-items: center;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: #fff;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.amount-wrap:focus-within {
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(176, 141, 87, 0.12);
}

.amount-wrap.is-error {
    border-color: var(--red);
}

.amount-wrap input {
    flex: 1;
    padding: 0.7rem 1rem;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    font-size: 1.55rem;
    font-weight: 500;
}

.currency-badge {
    height: 100%;
    display: flex;
    align-items: center;
    padding: 0 1rem;
    border-left: 1px solid var(--border);
    color: var(--gold);
    font-size: 0.85rem;
    font-weight: 500;
    letter-spacing: 0.08em;
}

.amount-note {
    margin-top: 0.4rem;
    color: var(--ink-3);
    font-size: 0.85rem;
}

.ts-wrapper.single .ts-control {
    min-height: 3rem;
    padding: 0.75rem 0.95rem;
    font-size: 1.05rem;
}

.ts-wrapper.single .ts-control input,
.ts-wrapper.single .ts-control .item {
    font-size: 1.05rem;
    line-height: 1.4;
}

.ts-dropdown {
    z-index: 1000;
    border-color: var(--border);
    border-radius: var(--radius);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

.ts-dropdown .option {
    padding: 0.7rem 0.95rem;
    font-size: 1rem;
    line-height: 1.45;
}

.ts-dropdown .option:hover,
.ts-dropdown .option.active {
    background: var(--gold-pale);
    color: var(--ink);
}

.ts-dropdown .optgroup-header {
    color: var(--gold);
    font-family: "DM Sans", sans-serif;
    font-size: 0.78rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.field-link {
    width: fit-content;
    margin-top: 0.25rem;
    padding: 0;
    border: none;
    background: none;
    color: var(--gold);
    cursor: pointer;
    font-family: "DM Sans", sans-serif;
    font-size: 0.9rem;
    text-align: left;
    text-decoration: underline;
}

.gift-aid-section {
    display: none;
    margin-top: 1.5rem;
    padding: 1.5rem;
    border: 1px solid rgba(176, 141, 87, 0.3);
    border-radius: var(--radius);
    background: var(--gold-pale);
}

.gift-aid-section.is-visible {
    display: block;
}

.gift-aid-section h3 {
    margin-bottom: 0.5rem;
    font-size: 1.25rem;
    font-weight: 600;
}

.gift-aid-section p {
    margin-bottom: 1rem;
    color: var(--ink-2);
    font-size: 0.95rem;
    line-height: 1.6;
}

.checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    margin-bottom: 0.75rem;
    cursor: pointer;
    font-size: 0.95rem;
    line-height: 1.55;
}

.checkbox-label input[type="checkbox"] {
    width: 15px;
    height: 15px;
    flex-shrink: 0;
    margin-top: 3px;
    accent-color: var(--gold);
}

.declaration-box {
    margin-top: 0.75rem;
    padding: 0.85rem 1rem;
    border-left: 3px solid var(--gold);
    border-radius: 0 var(--radius) var(--radius) 0;
    background: rgba(255, 255, 255, 0.6);
    color: var(--ink-2);
    font-size: 0.9rem;
    line-height: 1.6;
}

.declaration-box strong {
    display: block;
    margin-bottom: 0.4rem;
    color: var(--gold);
}

.step-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 2.5rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
}

.btn-primary,
.btn-back,
.button-secondary {
    border-radius: var(--radius);
    cursor: pointer;
    font-family: "DM Sans", sans-serif;
    font-size: 0.95rem;
    text-decoration: none;
}

.btn-primary {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.85rem 2rem;
    border: none;
    background: var(--ink);
    color: #fff;
    font-weight: 500;
    letter-spacing: 0.04em;
    transition: background 0.2s, transform 0.15s;
}

.btn-primary:hover {
    background: #2d2420;
    transform: translateY(-1px);
}

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

.btn-primary.gold {
    background: var(--gold);
    color: var(--ink);
}

.btn-primary.gold:hover {
    background: var(--gold-light);
}

.btn-back,
.button-secondary {
    padding: 0.85rem 1.5rem;
    border: 1px solid var(--border);
    background: none;
    color: var(--ink-3);
    transition: border-color 0.2s, color 0.2s;
}

.btn-back:hover,
.button-secondary:hover {
    border-color: var(--ink-3);
    color: var(--ink);
}

.review-card {
    margin-bottom: 1rem;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: #fff;
}

.review-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.85rem 1.25rem;
    border-bottom: 1px solid var(--border);
    background: var(--warm);
}

.review-card-head span {
    color: var(--ink-2);
}

.review-edit {
    border: none;
    background: none;
    color: var(--gold);
    cursor: pointer;
    font-family: "DM Sans", sans-serif;
    font-size: 0.85rem;
    text-decoration: underline;
}

.review-rows {
    display: grid;
    grid-template-columns: 1fr 1fr;
}

.review-row {
    padding: 0.75rem 1.25rem;
    border-bottom: 1px solid var(--border);
}

.review-row:nth-last-child(-n+2) {
    border-bottom: none;
}

.review-row:nth-child(odd) {
    border-right: 1px solid var(--border);
}

.review-row dt {
    margin-bottom: 0.15rem;
    color: var(--ink-3);
    letter-spacing: 0.1em;
}

.review-row dd {
    color: var(--ink);
    font-size: 1rem;
}

.amount-highlight {
    margin: 0.5rem 0 0.25rem;
    color: var(--gold);
    font-size: 2.25rem;
    font-weight: 500;
}

.amount-sublabel {
    color: var(--ink-3);
    font-size: 0.9rem;
}

.notice {
    display: none;
    margin-bottom: 1.5rem;
    padding: 0.85rem 1.1rem;
    border-radius: var(--radius);
    font-size: 0.95rem;
}

.notice.is-visible {
    display: block;
}

.notice.warning {
    border: 1px solid #f5c542;
    background: #fef3cd;
    color: #7d5a00;
}

.notice.error {
    border: 1px solid #e57373;
    background: #fde8e8;
    color: #8b0000;
}

.notice.pending {
    display: block;
    border: 1px solid rgba(176, 141, 87, 0.35);
    background: var(--gold-pale);
    color: var(--ink-2);
}

.hidden {
    display: none !important;
}

.confirm-shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 2rem;
    background: var(--cream);
}

.confirm-card {
    width: min(760px, 100%);
    padding: 2.25rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: #fff;
}

.confirm-card h1 {
    margin: 0.35rem 0 0.75rem;
    font-size: 2.25rem;
    font-weight: 500;
}

.eyebrow {
    color: var(--gold);
    font-size: 0.65rem;
    font-weight: 500;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

.summary-list {
    display: grid;
    gap: 0.75rem;
    margin: 1.5rem 0;
}

.summary-list div {
    padding: 0.85rem 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--warm);
}

.summary-list dt {
    color: var(--ink-3);
    font-size: 0.65rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.summary-list dd {
    margin-top: 0.15rem;
    color: var(--ink);
}

code {
    padding: 0.12em 0.3em;
    border-radius: 4px;
    background: rgba(176, 141, 87, 0.16);
    font-family: "SFMono-Regular", Menlo, Consolas, monospace;
    font-size: 0.92em;
}

@media (max-width: 900px) {
    .shell {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: static;
        height: auto;
        gap: 1rem;
        padding: 1.75rem 1.5rem;
    }

    .sidebar-title {
        font-size: 1.45rem;
    }

    .sidebar-body {
        font-size: 0.82rem;
    }

    .sidebar-ornament,
    .sidebar-img {
        display: none;
    }

    .sidebar-meta {
        gap: 0.55rem;
        padding-top: 1rem;
    }

    .main {
        max-width: 100%;
        padding: 2rem 1.5rem 4rem;
    }

    .step-nav {
        display: none;
    }
}

@media (max-width: 540px) {
    .field-grid,
    .review-rows {
        grid-template-columns: 1fr;
    }

    .field.span-2 {
        grid-column: 1;
    }

    .review-row:nth-child(odd) {
        border-right: none;
    }

    .review-row {
        border-bottom: 1px solid var(--border);
    }
}
