/* Deal Desk pages: /deal-desk, /deal-desk/start, /deal-desk/requests/:id and the negotiation guide
   (views/dealdesk). Built on lcd.css tokens and base classes. */

.desk-icon {
    width: 28px;
    height: 28px;
    flex: none;
}

.desk-icon--sm {
    width: 16px;
    height: 16px;
}

.desk-crumbs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
    color: var(--text-3);
    font-size: 0.8125rem;
}

.desk-crumbs a {
    color: var(--text-2);
    text-decoration: none;
}

.desk-crumbs a:hover {
    color: var(--text);
    text-decoration: underline;
}

/* Hero ------------------------------------------------------------------ */

.desk-hero {
    padding-block: clamp(24px, 2vw + 12px, 40px) clamp(36px, 3vw + 20px, 64px);
}

.desk-hero--compact {
    padding-bottom: clamp(16px, 2vw, 28px);
}

.desk-hero__grid {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
    gap: clamp(28px, 4vw, 64px);
    align-items: start;
}

.desk-hero__copy .lede {
    margin-top: 16px;
    max-width: 38em;
}

.desk-hero__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 24px;
}

.desk-hero__note {
    margin-top: 16px;
    color: var(--text-2);
    font-size: 0.9375rem;
}

.desk-hero__alert {
    margin-top: 16px;
}

.desk-title {
    overflow-wrap: anywhere;
}

/* Fee panel ------------------------------------------------------------- */

.desk-panel {
    padding: clamp(20px, 2vw + 8px, 28px);
    background: var(--ink);
    color: var(--on-ink);
    border-radius: var(--radius-lg);
}

.desk-panel__title {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--on-ink-3);
}

.desk-tiers {
    display: grid;
    gap: 0;
    margin-top: 14px;
    list-style: none;
}

.desk-tiers li {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 4px 16px;
    padding: 14px 0;
    border-top: 1px solid var(--ink-line);
}

.desk-tiers__range {
    color: var(--on-ink-2);
    font-size: 0.9375rem;
}

.desk-tiers__fee {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1;
    text-align: right;
}

.desk-tiers__room {
    grid-column: 1 / -1;
    color: var(--on-ink-3);
    font-size: 0.8125rem;
}

.desk-tiers__room strong {
    color: var(--good-on-ink);
    font-weight: 600;
}

.desk-panel__foot {
    margin-top: 8px;
    padding-top: 14px;
    border-top: 1px solid var(--ink-line);
    color: var(--on-ink-3);
    font-size: 0.8125rem;
    line-height: 1.5;
}

/* Steps, uses, guarantee ------------------------------------------------ */

.desk-steps {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    list-style: none;
}

.desk-step {
    display: grid;
    align-content: start;
    gap: 8px;
    padding: 20px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
}

.desk-step__n {
    display: inline-grid;
    place-items: center;
    width: 30px;
    height: 30px;
    background: var(--brand);
    color: var(--brand-ink);
    border-radius: 50%;
    font-weight: 700;
    font-size: 0.875rem;
}

.desk-step p {
    color: var(--text-2);
    font-size: 0.9375rem;
    line-height: 1.55;
}

.desk-split {
    display: grid;
    grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
    gap: clamp(24px, 4vw, 56px);
    align-items: start;
}

.desk-split .lede {
    margin-top: 10px;
}

.desk-checks {
    display: grid;
    gap: 12px;
    margin-top: 20px;
    list-style: none;
}

.desk-checks li {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    color: var(--text-2);
    line-height: 1.5;
}

.desk-checks .desk-icon {
    margin-top: 3px;
    color: var(--good);
}

.desk-guarantee {
    display: grid;
    gap: 10px;
    padding: clamp(20px, 2vw + 8px, 28px);
    background: var(--good-tint);
    border: 1px solid #BCE5CD;
    border-radius: var(--radius-lg);
    color: var(--text);
}

.desk-guarantee > .desk-icon {
    color: var(--good);
}

.desk-guarantee p {
    color: var(--text-2);
    line-height: 1.55;
}

.desk-guarantee__title {
    font-weight: 700;
    color: var(--text) !important;
}

.desk-guarantee__small {
    font-size: 0.8125rem;
}

.desk-guarantee--side {
    padding: 18px;
    font-size: 0.9375rem;
}

.desk-guarantee--side > .desk-icon {
    width: 22px;
    height: 22px;
}

.desk-footnote {
    margin-top: 14px;
    color: var(--text-3);
    font-size: 0.8125rem;
    line-height: 1.55;
}

.desk-footnote a {
    color: var(--text-2);
}

.desk-cta__inner {
    display: flex;
    flex-wrap: wrap;
    gap: 20px 40px;
    align-items: center;
    justify-content: space-between;
}

.desk-cta .on-ink {
    margin-top: 8px;
    color: var(--on-ink-2);
}

.desk-cta .desk-hero__actions {
    margin-top: 0;
}

.desk-cta .btn-ghost {
    color: var(--on-ink);
    border-color: var(--ink-line);
}

/* Form ------------------------------------------------------------------ */

.desk-start__grid {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
    gap: clamp(20px, 3vw, 40px);
    align-items: start;
}

.desk-start__main,
.desk-start__side {
    display: grid;
    gap: 16px;
    min-width: 0;
}

.desk-form {
    display: grid;
    gap: 24px;
}

.desk-form__group {
    display: grid;
    gap: 16px;
    min-width: 0;
    border: 0;
    padding: 0;
    margin: 0;
}

.desk-form__group + .desk-form__group {
    padding-top: 24px;
    border-top: 1px solid var(--line);
}

.desk-form__row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.desk-form__short {
    min-height: 76px;
}

.desk-form__error {
    color: var(--bad);
    font-size: 0.8125rem;
    font-weight: 500;
}

.desk-form [aria-invalid="true"] {
    border-color: var(--bad);
}

.desk-form__fine {
    margin-top: -12px;
    text-align: center;
}

.desk-optional {
    color: var(--text-3);
    font-weight: 400;
}

.desk-choices {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.desk-choice {
    position: relative;
    cursor: pointer;
}

.desk-choice input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.desk-choice span {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 0 16px;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-pill);
    background: var(--surface);
    font-size: 0.9375rem;
    font-weight: 500;
}

.desk-choice input:checked + span {
    background: var(--ink);
    border-color: var(--ink);
    color: var(--on-ink);
}

.desk-choice input:focus-visible + span {
    box-shadow: 0 0 0 3px rgba(11, 11, 12, 0.18);
}

.desk-agree {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    color: var(--text-2);
    font-size: 0.875rem;
    line-height: 1.5;
}

.desk-agree input {
    width: 18px;
    height: 18px;
    margin-top: 2px;
    flex: none;
    accent-color: var(--ink);
}

.desk-agree.is-invalid span {
    color: var(--bad);
}

.desk-signin {
    display: grid;
    gap: 12px;
    justify-items: start;
}

/* Car summary ----------------------------------------------------------- */

.desk-car {
    overflow: hidden;
}

.desk-car__photo {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 10;
    object-fit: cover;
    background: var(--surface-2);
}

.desk-car__body {
    display: grid;
    gap: 6px;
    padding: 16px 18px 18px;
}

.desk-car__title {
    font-weight: 700;
    font-size: 1.0625rem;
    line-height: 1.3;
}

.desk-car__meta {
    color: var(--text-3);
    font-size: 0.8125rem;
}

.desk-car__numbers {
    display: grid;
    gap: 6px;
    margin-top: 8px;
    padding-top: 10px;
    border-top: 1px solid var(--line);
}

.desk-car__numbers div {
    display: flex;
    justify-content: space-between;
    gap: 12px;
}

.desk-car__numbers dt {
    color: var(--text-2);
}

.desk-car__numbers dd {
    font-weight: 600;
    text-align: right;
}

.desk-credit {
    display: block;
    color: var(--good);
    font-size: 0.8125rem;
    font-weight: 500;
}

.desk-car__note {
    margin-top: 6px;
    color: var(--text-2);
    font-size: 0.875rem;
    line-height: 1.5;
}

.desk-next {
    display: grid;
    gap: 10px;
    padding-left: 20px;
    color: var(--text-2);
    font-size: 0.875rem;
    line-height: 1.5;
}

.desk-next strong {
    color: var(--text);
}

/* Request page ---------------------------------------------------------- */

.desk-status {
    display: inline-flex;
    margin-top: 12px;
    padding: 6px 12px;
    border-radius: var(--radius-pill);
    background: var(--surface-2);
    font-size: 0.8125rem;
    font-weight: 600;
}

.desk-status.is-good {
    background: var(--good-tint);
    color: var(--good-strong);
}

.desk-status.is-active {
    background: var(--ink);
    color: var(--on-ink);
}

.desk-status.is-wait {
    background: var(--warn-tint);
    color: var(--warn);
}

.desk-status.is-muted {
    color: var(--text-2);
}

.desk-pay {
    display: grid;
    gap: 12px;
    justify-items: start;
    border-color: var(--ink);
}

.desk-result {
    border-color: #BCE5CD;
}

.desk-result__eyebrow {
    color: var(--good);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.desk-result__price {
    margin-top: 6px;
    font-family: var(--font-display);
    font-size: clamp(2rem, 3vw + 1rem, 2.75rem);
    font-weight: 700;
    line-height: 1.05;
}

.desk-result__saved {
    margin-top: 6px;
    color: var(--good-strong);
    font-weight: 600;
}

.desk-checklist {
    display: grid;
    gap: 8px;
    margin-top: 10px;
    padding-left: 20px;
    color: var(--text-2);
    line-height: 1.5;
}

.desk-dl {
    display: grid;
    gap: 0;
    margin-top: 8px;
}

.desk-dl div {
    display: grid;
    grid-template-columns: minmax(110px, 0.6fr) minmax(0, 1.4fr);
    gap: 12px;
    padding: 9px 0;
    border-top: 1px solid var(--line);
}

.desk-dl dt {
    color: var(--text-3);
    font-size: 0.875rem;
}

.desk-dl dd {
    font-weight: 500;
    overflow-wrap: anywhere;
}

.desk-dl a {
    display: inline-flex;
    gap: 6px;
    align-items: center;
}

.desk-pre {
    white-space: pre-line;
}

.desk-timeline {
    display: grid;
    gap: 12px;
    margin-top: 10px;
    list-style: none;
}

.desk-timeline li {
    display: grid;
    gap: 2px;
    padding-left: 14px;
    border-left: 2px solid var(--line-strong);
}

.desk-timeline time {
    color: var(--text-3);
    font-size: 0.75rem;
}

.desk-timeline span {
    font-weight: 500;
    font-size: 0.9375rem;
}

.desk-timeline__note {
    color: var(--text-2);
    font-size: 0.875rem;
    white-space: pre-line;
}

.desk-side-help {
    padding: 0 4px;
}

/* Guide ----------------------------------------------------------------- */

.desk-prose {
    padding-bottom: 8px;
}

.desk-prose h2 {
    margin-top: 40px;
}

.desk-prose .table-wrap {
    margin: 18px 0 0;
}

.desk-pre-block {
    margin: 16px 0;
    padding: 16px 18px;
    background: var(--surface-2);
    border-radius: var(--radius-md);
    overflow-x: auto;
    white-space: pre-wrap;
    font-size: 0.875rem;
    line-height: 1.6;
}

.desk-guide-cta {
    display: flex;
    flex-wrap: wrap;
    gap: 16px 32px;
    align-items: center;
    justify-content: space-between;
    padding: clamp(20px, 2vw + 8px, 32px);
    background: var(--ink);
    color: var(--on-ink);
    border-radius: var(--radius-lg);
}

.desk-guide-cta p {
    margin-top: 8px;
    color: var(--on-ink-2);
    max-width: 34em;
}

.desk-guide-cta .h3 {
    color: var(--on-ink);
}

.desk-guide-cta__eyebrow {
    margin-top: 0 !important;
    color: var(--brand-on-ink) !important;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

/* Small screens --------------------------------------------------------- */

@media (max-width: 960px) {
    .desk-steps {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 860px) {
    .desk-hero__grid,
    .desk-split,
    .desk-start__grid {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (max-width: 560px) {
    .desk-steps,
    .desk-form__row {
        grid-template-columns: minmax(0, 1fr);
    }

    .desk-hero__actions .btn {
        width: 100%;
    }

    .desk-dl div {
        grid-template-columns: minmax(0, 1fr);
        gap: 2px;
    }
}

/* Next steps partners on an agreed request (lib/partners) */
.desk-steps__list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 10px;
    margin: 12px 0;
    padding: 0;
    list-style: none;
}
.desk-steps__list a {
    display: grid;
    gap: 2px;
    height: 100%;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    color: var(--text);
    text-decoration: none;
}
.desk-steps__list a:hover,
.desk-steps__list a:focus-visible {
    border-color: var(--line-strong);
    background: var(--paper);
}
.desk-steps__label {
    color: var(--text-3);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}
.desk-steps__name {
    font-weight: 700;
}
.desk-steps__blurb {
    color: var(--text-2);
    font-size: 0.875rem;
    line-height: 1.45;
}
