/* The dealer site (dealer.html, dealer-sign-in.html), on top of style.css. */

.linklike { padding: 0; font: inherit; color: var(--accent); text-decoration: underline; background: none; border: 0; cursor: pointer; }
.linklike:hover { color: var(--accent-hover); }

/* A label's "(optional)" stays on the line of the label, the field goes under it. */
.signin-form label:not(.inline), .dealer-form label, .dealer-save label { display: block; }
.signin-form label:not(.inline) > input, .dealer-form label > input, .dealer-form label > select, .dealer-save label > input { display: block; margin-top: 4px; }

/* --- Sign in --- */
.signin-body { min-height: 100vh; border-top: 4px solid var(--accent); }
.signin {
  display: grid;
  grid-template-columns: minmax(0, 420px) minmax(0, 340px);
  gap: 48px;
  align-items: center;
  justify-content: center;
  max-width: 900px;
  min-height: calc(100vh - 4px);
  padding: 32px 24px;
}
.signin-card { padding: 32px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 8px 30px rgb(43 33 29 / 0.07); }
.signin-logo { display: block; height: auto; margin: 0 0 24px; }
.signin-form { display: flex; flex-direction: column; gap: 14px; }
.signin-form h1 { margin: 0; font-size: 20px; }
.signin-form p { margin: 0; line-height: 1.5; }
.signin-form input:not([type="checkbox"]) { padding: 9px 10px; font-size: 15px; }
.signin-form .button { padding: 10px 14px; font-size: 15px; }
.signin-code { font-size: 24px !important; font-variant-numeric: tabular-nums; letter-spacing: 0.3em; text-align: center; }
.signin-links { display: flex; flex-wrap: wrap; gap: 8px; font-size: 13px; color: var(--muted); }
.signin-addresses { display: flex; flex-direction: column; gap: 8px; }
.signin-addresses .button { text-align: left; }
.signin-notice { margin: 0 0 14px; padding: 10px 12px; line-height: 1.5; color: #1b6b3a; background: #e7f4ec; border: 1px solid #b7dfc5; border-radius: var(--radius); }
.signin-card > .error { margin: 0 0 14px; }
.signin-why h2 { margin-bottom: 12px; font-size: 13px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }
.signin-why ul { display: flex; flex-direction: column; gap: 14px; margin: 0 0 20px; padding: 0; list-style: none; }
.signin-why li { padding-left: 14px; line-height: 1.5; color: var(--muted); border-left: 3px solid var(--border-strong); }
.signin-why strong { display: block; color: var(--text); }

/* --- Calculator --- */
.dealer-who { display: flex; align-items: center; gap: 12px; }
.dealer-who #who { font-weight: 600; color: var(--text); }
.dealer-cols { display: grid; grid-template-columns: minmax(280px, 360px) minmax(0, 1fr); gap: 16px; align-items: start; }
.dealer-cols .card { margin-bottom: 16px; }
.dealer-form { display: flex; flex-direction: column; gap: 12px; }
.dealer-form h2, .dealer-result h2 { margin-bottom: 4px; }
.dealer-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.dealer-result { display: flex; flex-direction: column; gap: 12px; }
.dealer-result > p { margin: 0; }
.dealer-figures { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; margin: 0; overflow: hidden; background: var(--border); border: 1px solid var(--border); border-radius: var(--radius); }
.dealer-figures > div { padding: 10px 12px; background: var(--head); }
.dealer-figures dt { font-size: 11px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.dealer-figures dd { margin: 2px 0 0; font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.dealer-figures > div:first-child { background: var(--accent-soft); }
.dealer-figures > div:first-child dd { color: var(--accent); }
.dealer-save { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; padding-top: 12px; border-top: 1px solid var(--border); }
.dealer-save label { flex: 1 1 240px; }
.dealer-save .button { padding: 8px 16px; }
.dealer .section-head input[type="search"] { width: 240px; max-width: 50%; }

/* --- Portal tabs and documents --- */
.portal-nav { display: flex; gap: 24px; margin-right: auto; margin-left: 32px; }
.portal-nav a { padding: 20px 0; color: var(--muted); text-decoration: none; letter-spacing: 0.02em; }
.portal-nav a:hover { color: var(--accent); }
.portal-nav a[aria-current="page"] { color: var(--accent); box-shadow: inset 0 -2px var(--accent); }
/* Wider than the rest of Breaking Bank's pages: the portal has room to use. */
main.dealer { max-width: 1480px; }
.doc-toolbar { position: sticky; top: 0; z-index: 2; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; margin: 0 -24px 16px; padding: 10px 24px; background: var(--bg, #f6f3f0); border-bottom: 1px solid var(--border); }
.doc-products { display: flex; flex-wrap: wrap; gap: 6px; }
.doc-chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; font-size: 13px; color: var(--text); white-space: nowrap; background: var(--surface); border: 1px solid var(--border-strong); border-radius: 999px; cursor: pointer; }
.doc-chip-count { font-size: 11px; color: var(--muted); }
.doc-chip[aria-pressed="true"] { color: #fff; background: var(--accent); border-color: var(--accent); }
.doc-chip[aria-pressed="true"] .doc-chip-count { color: rgb(255 255 255 / 0.75); }
.doc-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.doc-filters input { width: 240px; }
.doc-filters select { width: auto; }
.doc-product { margin-bottom: 28px; }
#doc-groups.doc-columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 24px; align-items: start; }
.doc-product-head { margin: 0 0 10px; font-size: 18px; }
/* A product's banner: its photo, darkened at the bottom so the name stays readable. */
.doc-banner { position: relative; display: flex; align-items: flex-end; min-height: 150px; margin-bottom: 10px; overflow: hidden; color: #fff; background: var(--accent) center / cover no-repeat; border-radius: 12px; }
.doc-banner::before { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgb(30 22 18 / 0.78), rgb(30 22 18 / 0.15) 65%, transparent); }
.doc-banner.plain { min-height: 0; color: var(--text); background: none; }
.doc-banner.plain::before { display: none; }
.doc-banner-text { position: relative; padding: 14px 18px; }
.doc-banner.plain .doc-banner-text { padding: 6px 2px; }
.doc-banner h2 { margin: 0; font-size: 22px; letter-spacing: 0.01em; }
.doc-banner p { margin: 2px 0 0; font-size: 13px; opacity: 0.9; }
/* "Start here": the documents a dealer needs most, open at the top of the product. */
.doc-start { margin-bottom: 8px; background: var(--accent-soft); border: 1px solid var(--border); border-radius: 10px; }
.doc-start h3 { margin: 0; padding: 12px 16px 8px; font-size: 13px; color: var(--accent); text-transform: uppercase; letter-spacing: 0.06em; }
.doc-start .doc-list { border-top: 0; }
.doc-start .doc-list li:last-child { border-bottom: 0; }
.doc-accs { display: flex; flex-direction: column; gap: 8px; }
.doc-acc { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; }
.doc-acc > summary { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 8px 16px; font-weight: 600; cursor: pointer; list-style: none; }
.doc-acc > summary::-webkit-details-marker { display: none; }
.doc-acc > summary::before { content: ""; flex: none; width: 8px; height: 8px; margin-right: 2px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(-45deg); transition: transform 0.15s; }
.doc-acc[open] > summary::before { transform: rotate(45deg); }
.doc-acc > summary:hover { background: var(--head); border-radius: 10px; }
.doc-acc-title { flex: 1; }
.doc-acc-count { min-width: 28px; padding: 2px 8px; font-size: 12px; color: var(--muted); text-align: center; background: var(--head); border-radius: 999px; }
/* The rows: two columns on a wide screen, one on a narrow one. */
.doc-list { margin: 0; padding: 0 16px 8px; list-style: none; border-top: 1px solid var(--border); }
.doc-list li { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 56px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.doc-name { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.doc-title { font-weight: 600; text-align: left; overflow-wrap: anywhere; }
.doc-meta { margin-top: 2px; font-size: 12px; }
.doc-actions { display: flex; flex: none; gap: 6px; }
.doc-btn { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 36px; padding: 4px 12px; font-size: 13px; font-weight: 600; color: var(--accent); text-decoration: none; background: var(--surface); border: 1px solid var(--border-strong); border-radius: 8px; cursor: pointer; }
.doc-btn:hover { color: #fff; background: var(--accent); border-color: var(--accent); }
.doc-preview { width: min(1100px, 96vw); height: 92vh; max-height: none; padding: 0; border: 0; border-radius: 10px; }
.doc-preview::backdrop { background: rgb(20 14 12 / 0.55); }
.doc-preview[open] { display: flex; flex-direction: column; }
.doc-preview-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; padding: 10px 16px; border-bottom: 1px solid var(--border); }
.doc-preview-head h2 { flex: 1 1 200px; margin: 0; font-size: 16px; }
.doc-preview-body { flex: 1; min-height: 0; background: #525659; }
.doc-preview-body iframe { width: 100%; height: 100%; border: 0; }
.doc-preview-body img { display: block; max-width: 100%; max-height: 100%; margin: auto; object-fit: contain; }

@media (max-width: 1100px) {
  #doc-groups.doc-columns { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 860px) {
  /* style.css folds a topbar's nav into a menu on phones; the portal's two tabs stay out. */
  .topbar { flex-wrap: wrap; height: auto; padding-bottom: 0; }
  .topbar nav.portal-nav { display: flex; flex-direction: row; order: 3; width: 100%; gap: 24px; margin: 4px 0 0; }
  .topbar nav.portal-nav a { padding: 10px 0; border-top: 0; background: none; font-weight: 400; }
  .topbar nav.portal-nav a[aria-current="page"] { background: none; box-shadow: inset 0 -2px var(--accent); }
  /* Phones: product buttons scroll sideways, rows stack the buttons under the title. */
  .doc-toolbar { position: static; margin: 0 -16px 12px; padding: 8px 16px; }
  .doc-products { flex-wrap: nowrap; width: 100%; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .doc-products::-webkit-scrollbar { display: none; }
  .doc-filters { width: 100%; }
  .doc-filters input { flex: 1 1 160px; width: auto; }
  .doc-acc > summary { padding: 8px 12px; }
  .doc-banner { min-height: 110px; }
  .doc-banner h2 { font-size: 20px; }
  .doc-start h3 { padding: 10px 12px 6px; }
  .doc-list { padding: 0 12px 4px; }
  .doc-list li { flex-direction: column; align-items: stretch; gap: 8px; padding: 12px 0; }
  .doc-actions .doc-btn { flex: 1; min-height: 40px; }
  .doc-preview { width: 100vw; height: 100dvh; max-width: none; border-radius: 0; }
  .signin { grid-template-columns: minmax(0, 440px); gap: 28px; align-items: start; }
  .signin-card { padding: 24px 20px; }
  .dealer-cols { grid-template-columns: minmax(0, 1fr); }
  .dealer-figures { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dealer-figures dd { font-size: 16px; }
}

/* The buttons on each of the company's estimates: View, Edit, Copy, Delete. */
td.estimate-actions { white-space: nowrap; }
td.estimate-actions .doc-btn { margin-left: 4px; }
@media (max-width: 700px) { td.estimate-actions { white-space: normal; } td.estimate-actions .doc-btn { margin: 2px; } }
