/* ==========================================================================
   Harvest Nex — Business Demand Panel styles
   Loaded only on the demand-panel pages.
   ========================================================================== */

.dp-shell {
    background: #fff;
    border: 1px solid rgba(17, 17, 17, 0.07);
    box-shadow: 0 50px 90px -60px rgba(7, 51, 26, 0.45);
}

/* ---------- Progress ---------- */
.dp-progress-wrap {
    position: sticky;
    top: var(--header-h-solid);
    z-index: 20;
    background: rgba(255, 255, 255, 0.97);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(17, 17, 17, 0.07);
}
.dp-bar { height: 3px; background: var(--surface); }
.dp-bar span { display: block; height: 100%; background: var(--gold); transition: width 0.5s var(--ease); }

.dp-progress { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); }
.dp-step {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.2rem;
    padding: 0.9rem 0.75rem 0.95rem;
    text-align: left;
    color: rgba(17, 17, 17, 0.35);
    transition: color 0.3s ease, background-color 0.3s ease;
}
.dp-step-n { font-family: 'Playfair Display', serif; font-weight: 700; font-size: 1.05rem; line-height: 1; }
.dp-step-name { font-size: 0.66rem; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; }
.dp-step.is-done { color: var(--forest); cursor: pointer; }
.dp-step.is-done .dp-step-n { color: var(--gold); }
.dp-step.is-done:hover { background: var(--surface); }
.dp-step[aria-current="step"] { color: var(--forest); background: rgba(197, 160, 89, 0.08); }
.dp-step[aria-current="step"] .dp-step-n { color: var(--forest); }
.dp-step:disabled { cursor: default; }
.dp-progress-current { display: none; }

@media (max-width: 767px) {
    .dp-step { align-items: center; padding: 0.75rem 0.25rem 0.5rem; }
    .dp-step-name { display: none; }
    .dp-progress-current {
        display: block;
        padding: 0 1rem 0.7rem;
        text-align: center;
        font-size: 0.68rem;
        font-weight: 600;
        letter-spacing: 0.16em;
        text-transform: uppercase;
        color: var(--forest);
    }
}

/* ---------- Stages ---------- */
.dp-stage { display: none; padding: 2.25rem 1.25rem 2.5rem; }
.dp-stage.is-active { display: grid; gap: 2.25rem; animation: dpIn 0.5s var(--ease); }
@keyframes dpIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

@media (min-width: 640px) { .dp-stage { padding: 3rem 2.5rem; } }
@media (min-width: 1024px) {
    .dp-stage.is-active { grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); gap: 4rem; }
    .dp-stage { padding: 4rem 3.5rem; }
    .dp-stage-head { position: sticky; top: calc(var(--header-h-solid) + 96px); align-self: start; }
}

.dp-num {
    display: block;
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    font-size: clamp(3.2rem, 7vw, 5rem);
    line-height: 0.9;
    color: var(--gold);
}
.dp-kicker {
    display: block;
    margin-top: 1rem;
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--terra-ink);
}
.dp-stage-head h2 {
    margin-top: 0.75rem;
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    font-size: clamp(1.75rem, 3vw, 2.4rem);
    line-height: 1.15;
    color: var(--forest);
}
.dp-stage-head h2:focus { outline: none; }
.dp-stage-head p { margin-top: 1rem; font-size: 1rem; line-height: 1.7; color: rgba(17, 17, 17, 0.62); }

/* Signature stage — MONEY */
.dp-stage--signature .dp-stage-head {
    background-color: var(--deep);
    background-image: radial-gradient(rgba(255, 255, 255, 0.08) 1px, transparent 1px);
    background-size: 22px 22px;
    padding: 2rem 1.75rem;
    margin: -0.25rem 0 0;
}
.dp-stage--signature .dp-kicker { color: var(--gold); }
.dp-stage--signature .dp-stage-head h2 {
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 0.01em;
    font-size: clamp(1.6rem, 2.8vw, 2.2rem);
}
.dp-stage--signature .dp-stage-head p { color: rgba(255, 255, 255, 0.72); }

/* ---------- Fields ---------- */
.dp-fields { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2.25rem 2rem; }
@media (min-width: 768px) { .dp-fields { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
.dp-field { grid-column: 1 / -1; min-width: 0; border: 0; padding: 0; margin: 0; }
@media (min-width: 768px) { .dp-field--half { grid-column: auto; } }

.dp-label {
    display: block;
    margin-bottom: 0.35rem;
    padding: 0;
    font-size: 1.03rem;
    font-weight: 600;
    line-height: 1.45;
    color: var(--dark);
}
.dp-opt { font-weight: 400; font-size: 0.85em; color: rgba(17, 17, 17, 0.45); }
.dp-help { margin-bottom: 0.75rem; font-size: 0.88rem; line-height: 1.55; color: rgba(17, 17, 17, 0.55); }
.dp-sublabel {
    display: block;
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: rgba(17, 17, 17, 0.5);
}
.dp-field textarea.premium-input { min-height: 0; line-height: 1.6; }
.dp-counter { margin-top: 0.4rem; font-size: 0.75rem; color: rgba(17, 17, 17, 0.45); }

.dp-error { display: none; margin-top: 0.6rem; gap: 0.5rem; align-items: flex-start; font-size: 0.87rem; font-weight: 500; line-height: 1.5; color: #A3261B; }
.dp-error span {
    flex: none;
    width: 18px;
    height: 18px;
    display: grid;
    place-items: center;
    border-radius: 999px;
    background: #A3261B;
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    margin-top: 1px;
}
.dp-field.is-invalid .dp-error { display: flex; }
.dp-field.is-invalid .premium-input { border-bottom-color: #A3261B; }
.dp-field.is-invalid .dp-card-body { border-color: rgba(163, 38, 27, 0.45); }

.dp-alert {
    margin-bottom: 1.75rem;
    padding: 0.9rem 1.1rem;
    border-left: 3px solid #A3261B;
    background: rgba(163, 38, 27, 0.06);
    color: #A3261B;
    font-size: 0.92rem;
    font-weight: 500;
}

/* Selectable cards (radio) */
.dp-cards { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0.6rem; }
@media (min-width: 560px) {
    .dp-cards--2, .dp-cards--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 1100px) { .dp-cards--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

.dp-card { position: relative; display: block; cursor: pointer; }
.dp-card-input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; }
.dp-card-body {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    min-height: 54px;
    height: 100%;
    padding: 0.8rem 1rem;
    border: 1px solid rgba(17, 17, 17, 0.14);
    background: #fff;
    font-size: 0.95rem;
    line-height: 1.4;
    color: rgba(17, 17, 17, 0.8);
    transition: border-color 0.25s ease, background-color 0.25s ease, color 0.25s ease;
}
.dp-card-body::before {
    content: "";
    flex: none;
    width: 18px;
    height: 18px;
    border-radius: 999px;
    border: 1.5px solid rgba(17, 17, 17, 0.3);
    transition: border 0.25s ease;
}
.dp-card:hover .dp-card-body { border-color: var(--forest); }
.dp-card-input:checked + .dp-card-body {
    border-color: var(--forest);
    background: rgba(11, 74, 34, 0.05);
    color: var(--forest);
    font-weight: 600;
}
.dp-card-input:checked + .dp-card-body::before { border: 5.5px solid var(--forest); }
.dp-card-input:focus-visible + .dp-card-body { outline: 2px solid var(--gold); outline-offset: 2px; }

/* Chips (multi-select) */
.dp-chips { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.dp-chip .dp-card-body {
    min-height: 44px;
    padding: 0.55rem 1rem;
    border-radius: 999px;
    font-size: 0.88rem;
}
.dp-chip .dp-card-body::before { display: none; }
.dp-chip .dp-card-input:checked + .dp-card-body { background: var(--forest); border-color: var(--forest); color: #fff; }
.dp-chip .dp-card-input:checked + .dp-card-body::after { content: "✓"; margin-left: -0.3rem; color: var(--gold); font-weight: 700; }

/* Money */
.dp-seg { display: inline-grid; grid-template-columns: 1fr 1fr; gap: 0.4rem; margin-bottom: 1.25rem; }
.dp-seg .dp-card-body { min-height: 42px; padding: 0.5rem 0.9rem; font-size: 0.85rem; }
.dp-money-row { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 1.25rem; align-items: end; }

/* Sub-headings and notes */
.dp-subhead { padding-top: 1.5rem; border-top: 1px solid rgba(17, 17, 17, 0.08); }
.dp-subhead h3 {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    font-size: 1.45rem;
    color: var(--forest);
    text-transform: uppercase;
    letter-spacing: 0.01em;
    margin-bottom: 0.4rem;
}
.dp-stage--signature .dp-subhead h3 { color: var(--forest); }

.dp-security {
    padding: 1rem 1.2rem;
    background: rgba(197, 160, 89, 0.1);
    border-left: 3px solid var(--gold);
    font-size: 0.9rem;
    line-height: 1.6;
    color: rgba(17, 17, 17, 0.75);
}
.dp-security strong { color: var(--dark); }

.dp-later { padding: 1.4rem 1.5rem; background: var(--surface); }
.dp-later-title { font-size: 0.7rem; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; color: rgba(17, 17, 17, 0.55); margin-bottom: 0.9rem; }
.dp-later ul { display: grid; gap: 0.45rem; }
.dp-later li { position: relative; padding-left: 1.2rem; font-size: 0.92rem; color: rgba(17, 17, 17, 0.7); }
.dp-later li::before { content: ""; position: absolute; left: 0; top: 0.7em; width: 0.55rem; height: 1px; background: var(--gold); }

/* Files */
.dp-drop {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.9rem 1.25rem;
    padding: 1.1rem 1.2rem;
    border: 1px dashed rgba(11, 74, 34, 0.35);
    background: var(--cream);
}
.dp-file-input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.dp-file-btn {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 0.6rem 1.2rem;
    background: #fff;
    border: 1px solid var(--forest);
    color: var(--forest);
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.25s ease, color 0.25s ease;
}
.dp-file-btn:hover { background: var(--forest); color: #fff; }
.dp-file-input:focus-visible + .dp-file-btn { outline: 2px solid var(--gold); outline-offset: 2px; }
.dp-file-hint { font-size: 0.8rem; color: rgba(17, 17, 17, 0.55); }
.dp-file-list { margin-top: 0.6rem; display: grid; gap: 0.4rem; }
.dp-file-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 0.55rem 0.8rem;
    background: var(--surface);
    font-size: 0.88rem;
    word-break: break-all;
}
.dp-file-list li.is-bad { background: rgba(163, 38, 27, 0.07); color: #A3261B; }
.dp-file-list small { color: rgba(17, 17, 17, 0.45); margin-left: 0.4rem; }
.dp-file-list button { flex: none; font-size: 0.8rem; font-weight: 600; color: var(--terra-ink); text-decoration: underline; text-underline-offset: 3px; }

/* Confirmations */
.dp-confirm { padding-top: 1.75rem; border-top: 1px solid rgba(17, 17, 17, 0.08); }
.dp-confirm > .dp-label {
    font-family: 'Playfair Display', serif;
    font-size: 1.45rem;
    color: var(--forest);
    margin-bottom: 1rem;
}
.dp-checks { display: grid; gap: 0.5rem; }
.dp-check {
    display: flex;
    gap: 0.85rem;
    align-items: flex-start;
    padding: 0.75rem 0.9rem;
    border: 1px solid rgba(17, 17, 17, 0.08);
    font-size: 0.92rem;
    line-height: 1.55;
    color: rgba(17, 17, 17, 0.78);
    cursor: pointer;
    transition: border-color 0.25s ease, background-color 0.25s ease;
}
.dp-check:hover { border-color: rgba(11, 74, 34, 0.4); }
.dp-check input { flex: none; width: 18px; height: 18px; margin-top: 2px; accent-color: var(--forest); cursor: pointer; }
.dp-check.is-missing { border-color: rgba(163, 38, 27, 0.45); background: rgba(163, 38, 27, 0.04); }
.dp-check--optional { margin-top: 1rem; border-style: dashed; }
.dp-privacy { margin-top: 1.1rem; font-size: 0.82rem; line-height: 1.6; color: rgba(17, 17, 17, 0.55); }
.dp-privacy a { color: var(--forest); text-decoration: underline; text-underline-offset: 3px; }

/* Honeypot */
.dp-hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* ---------- Navigation ---------- */
.dp-nav {
    position: sticky;
    bottom: 0;
    z-index: 15;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem 1.5rem;
    padding: 1rem 1.25rem;
    background: rgba(249, 249, 246, 0.97);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    border-top: 1px solid rgba(17, 17, 17, 0.08);
}
@media (min-width: 1024px) { .dp-nav { padding: 1.25rem 3.5rem; } }
.dp-back {
    min-height: 48px;
    padding: 0 0.5rem;
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--forest);
}
.dp-back:hover { color: var(--terra-ink); }
.dp-kept { order: 3; flex-basis: 100%; font-size: 0.75rem; line-height: 1.5; color: rgba(17, 17, 17, 0.45); }
.dp-next { margin-left: auto; }
.dp-next.dp-submit { letter-spacing: 0.06em; text-transform: uppercase; font-size: 0.85rem; }
@media (max-width: 639px) {
    .dp-next { flex: 1 1 auto; padding-left: 1rem; padding-right: 1rem; font-size: 0.88rem; }
    .dp-kept { display: none; }
}
@media (min-width: 1024px) { .dp-kept { order: 0; flex-basis: auto; flex: 1; max-width: 26rem; } }

/* ---------- Confirmation ---------- */
.dp-done { padding: 3.5rem 1.5rem 4rem; text-align: center; }
.dp-done:focus { outline: none; }
@media (min-width: 768px) { .dp-done { padding: 5rem 4rem; } }
.dp-done-mark {
    display: inline-grid;
    place-items: center;
    width: 64px;
    height: 64px;
    border-radius: 999px;
    background: var(--forest);
    color: var(--gold);
    font-size: 1.6rem;
}
.dp-done h2 {
    margin: 1.5rem auto 0;
    max-width: 40rem;
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    font-size: clamp(1.8rem, 4vw, 2.8rem);
    line-height: 1.15;
    color: var(--forest);
    text-transform: uppercase;
}
.dp-ref {
    display: inline-flex;
    flex-direction: column;
    gap: 0.35rem;
    margin: 2rem auto 0;
    padding: 1.1rem 1.75rem;
    border: 1px solid rgba(197, 160, 89, 0.6);
    background: rgba(197, 160, 89, 0.08);
}
.dp-ref span { font-size: 0.68rem; font-weight: 600; letter-spacing: 0.18em; text-transform: uppercase; color: rgba(17, 17, 17, 0.55); }
.dp-ref strong { font-size: clamp(1.2rem, 3vw, 1.6rem); letter-spacing: 0.08em; color: var(--forest); font-variant-numeric: tabular-nums; }
.dp-done-text { max-width: 38rem; margin: 1.5rem auto 0; font-size: 1.05rem; line-height: 1.75; color: rgba(17, 17, 17, 0.7); }
.dp-done-text a { color: var(--forest); text-decoration: underline; }
.dp-done-note { max-width: 36rem; margin: 2rem auto 0; font-size: 0.8rem; color: rgba(17, 17, 17, 0.45); }
.dp-done-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.75rem; margin-top: 2rem; }
.dp-ghost {
    min-height: 52px;
    padding: 0 1.5rem;
    border: 1px solid rgba(11, 74, 34, 0.3);
    color: var(--forest);
    font-weight: 600;
    font-size: 0.92rem;
}
.dp-ghost:hover { border-color: var(--forest); }
.dp-summary {
    max-width: 44rem;
    max-height: 22rem;
    overflow: auto;
    margin: 2rem auto 0;
    padding: 1.25rem 1.4rem;
    background: var(--surface);
    text-align: left;
    white-space: pre-wrap;
    font-size: 0.8rem;
    line-height: 1.6;
    color: rgba(17, 17, 17, 0.75);
}

@media (prefers-reduced-motion: reduce) {
    .dp-stage.is-active { animation: none; }
    .dp-bar span { transition: none; }
}
