/* The account page: login and registration, and behind them the customer's orders, quotes, addresses and profile.
   Tokens, buttons, form controls, cards, badges, notices and table.grid come from base.css. */

/* The footer stays at the bottom of the window, also under a short page (an empty list, the login form). */
body { min-height: 100vh; display: flex; flex-direction: column; }
.account-page { flex: 1 0 auto; width: 100%; padding-top: 32px; }
.account-page h1 { font-size: 28px; }
.account-page h2 { font-size: 20px; }
.account-page h3 { font-size: 16px; }
.account-page a:focus-visible, .account-page button:focus-visible, .dialog button:focus-visible {
  outline: 2px solid var(--accent-dark); outline-offset: 2px; }
.optional { font-weight: 400; color: var(--steel); }
.hint { font-size: 13px; color: var(--steel); margin: 5px 0 0; }
.hint[data-state="short"] { color: var(--warn); }
.hint[data-state="ok"] { color: var(--ok); }
.form-error { margin-bottom: 14px; }
.field-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0 14px; }
.field-row-zip { grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); }
input[readonly] { background: var(--bg); color: var(--steel); }
input[aria-invalid="true"] { border-color: var(--err); }

/* ---------------------------------------------------------------- not logged in */

.auth-intro { max-width: 720px; margin-bottom: 22px; }
.auth-intro .notice { margin: 12px 0 0; }
.auth-tabs { display: none; }
.auth-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 24px; align-items: start; max-width: 1000px; }
.auth-card { padding: 26px; }
.auth-card > .muted { margin: 0 0 18px; }
.auth-card .btn[type="submit"] { width: 100%; }
.password-row { display: flex; gap: 8px; }
.password-row input { flex: 1; min-width: 0; }
/* Same width for "Toon" and "Verberg", so the field does not jump when the label changes. */
.password-toggle { flex: none; min-width: 82px; }
/* "Wachtwoord vergeten" and the new password behind its link: one card instead of the two side by side. */
.auth-single { max-width: 480px; }
.auth-single .notice-ok { margin: 0; }
.auth-single .notice-ok:focus { outline: none; }   /* focused by script once the request is done, so that it is read out */
.auth-alt { margin: 14px 0 0; font-size: 14px; color: var(--steel); text-align: center; }
/* A step inside this page (another form) and not an address to go to: a button that reads as a link. */
.link-btn { border: 0; padding: 0; background: none; font: inherit; color: var(--blue); text-decoration: underline; cursor: pointer; }
.link-btn[disabled] { opacity: .45; cursor: not-allowed; }
.auth-intro .notice-ok { background: #e3f4ea; border-color: #b9dfc8; color: #14532d; }

@media (max-width: 760px) {
  .auth-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; margin-bottom: 14px;
    background: #e6e9ed; border-radius: 10px; }
  .auth-tab { border: 0; border-radius: 7px; padding: 10px 8px; font: inherit; font-weight: 600; background: transparent;
    color: var(--ink-2); cursor: pointer; }
  .auth-tab[aria-pressed="true"] { background: var(--card); color: var(--ink); box-shadow: var(--shadow); }
  .auth-grid { grid-template-columns: minmax(0, 1fr); }
  .auth[data-tab="login"] #register-form, .auth[data-tab="register"] #login-form { display: none; }
  .auth-card { padding: 20px; }
}

/* ---------------------------------------------------------------- logged in: navigation and frame */

.account-head { margin-bottom: 20px; }
.account-head h1 { margin-bottom: 4px; }
.account-head p { margin: 0; overflow-wrap: anywhere; }
.account-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 28px; align-items: start; }
.account-nav { display: flex; flex-direction: column; gap: 2px; padding: 8px; position: sticky; top: 84px; }
.account-nav a { display: block; padding: 10px 12px; border-radius: 8px; color: var(--ink-2); text-decoration: none; font-weight: 600; }
.account-nav a:hover { background: var(--bg); }
.account-nav a[aria-current="page"] { background: var(--ink); color: #fff; }
.account-content { min-width: 0; }
.account-content h2:focus { outline: none; }   /* focused by script after a route change, not by the visitor */

@media (max-width: 860px) {
  .account-layout { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  /* Tabs. They scroll sideways inside their own bar before they would ever widen the page. */
  .account-nav { position: static; flex-direction: row; padding: 5px; overflow-x: auto; }
  .account-nav a { flex: 1 1 auto; text-align: center; white-space: nowrap; padding: 9px 8px; }
}
@media (max-width: 480px) {
  .account-page { padding: 20px 16px 0; }
  .account-page h1 { font-size: 24px; }
  .account-nav a { font-size: 13.5px; padding: 9px 5px; }
}

.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.section-head h2 { margin: 0; }
/* What can be done with the order or quote on screen; the buttons go under each other's row before they widen the page. */
.head-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.by-hand { margin-left: 4px; font-size: 13px; font-weight: 400; color: var(--steel); white-space: nowrap; }
.back-link { display: inline-block; margin-bottom: 12px; font-size: 14px; text-decoration: none; }
.back-link:hover { text-decoration: underline; }
.pad { padding: 20px 22px; }
.pad > p:last-child { margin-bottom: 0; }
.section-lead { margin: -6px 0 16px; }
.account-content .card + .card, .account-content .card + .detail-cols { margin-top: 18px; }
.card-title { margin: 0; padding: 16px 20px 0; }
.card-title small { font-weight: 400; color: var(--steel); font-size: 13px; margin-left: 6px; }

.empty { padding: 44px 24px; text-align: center; }
.empty h3 { font-size: 18px; margin-bottom: 6px; }
.empty p { margin: 0 auto 18px; max-width: 460px; }

/* ---------------------------------------------------------------- lists of orders and quotes */

.table-card { overflow: hidden; }
table.rows th:first-child, table.rows td:first-child { padding-left: 20px; }
table.rows th:last-child, table.rows td:last-child { padding-right: 20px; }
table.rows th, table.rows td { vertical-align: middle; }
table.rows tbody tr:last-child td { border-bottom: 0; }
table.rows tbody tr[data-href] { cursor: pointer; }
table.rows tbody tr[data-href]:hover { background: #fafbfc; }
table.rows td a { font-weight: 600; }

/* A phone has no room for six columns: every row becomes a block of "label: value" lines. */
@media (max-width: 640px) {
  table.stack, table.stack tbody, table.stack tr, table.stack td { display: block; width: 100%; }
  table.stack thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  table.stack tr { padding: 12px 16px; border-bottom: 1px solid var(--line); }
  table.stack tbody tr:last-child { border-bottom: 0; }
  table.stack td, table.stack td:first-child, table.stack td:last-child { display: flex; justify-content: space-between;
    align-items: baseline; gap: 16px; padding: 3px 0; border: 0; text-align: right; overflow-wrap: anywhere; }
  table.stack td::before { content: attr(data-label); flex: none; text-align: left; color: var(--steel); font-size: 12.5px;
    text-transform: uppercase; letter-spacing: .4px; font-weight: 600; }
}

/* ---------------------------------------------------------------- one order or quote */

.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px 24px; margin: 0; }
.facts dt { font-size: 12.5px; text-transform: uppercase; letter-spacing: .4px; color: var(--steel); font-weight: 600; }
.facts dd { margin: 2px 0 0; font-weight: 600; overflow-wrap: anywhere; }

/* The five steps of an order. Done and current steps are joined by a dark line; what is still to come is grey. */
.track { list-style: none; margin: 0 0 6px; padding: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); }
.track li { position: relative; padding-top: 32px; text-align: center; font-size: 13.5px; color: var(--steel); }
.track li::before { content: ""; position: absolute; top: 10px; right: 50%; width: 100%; height: 3px; background: var(--line); }
.track li:first-child::before { display: none; }
.track .dot { position: absolute; top: 0; left: 50%; margin-left: -12px; width: 24px; height: 24px; border-radius: 50%;
  background: var(--card); border: 3px solid var(--line); z-index: 1; }
.track li[data-state="done"], .track li[data-state="current"] { color: var(--ink); }
.track li[data-state="done"]::before, .track li[data-state="current"]::before { background: var(--ink); }
.track li[data-state="done"] .dot { background: var(--ink); border-color: var(--ink); }
.track li[data-state="current"] { font-weight: 700; }
.track li[data-state="current"] .dot { background: var(--accent); border-color: var(--ink); }
/* "Geleverd" is the end of the line: as the current step it reads as finished, not as busy. */
.track li[data-state="current"]:last-child .dot { background: var(--ok); border-color: var(--ok); }
.track li[data-state="done"] .dot::after, .track li[data-state="current"]:last-child .dot::after { content: "";
  position: absolute; left: 6px; top: 2px; width: 5px; height: 10px; border: solid #fff; border-width: 0 2px 2px 0;
  transform: rotate(45deg); }
.track-note { margin: 14px 0 18px; }
/* What the owner wrote with the last status change, with the line breaks as typed. */
.order-note { margin: 0 0 16px; }
.order-note p { margin: 4px 0 0; white-space: pre-line; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

@media (max-width: 560px) {
  /* Five labels do not fit next to each other: the steps go underneath each other. */
  .track { grid-template-columns: minmax(0, 1fr); }
  .track li { text-align: left; padding: 2px 0 16px 36px; min-height: 24px; }
  .track li:last-child { padding-bottom: 0; }
  .track li::before { top: -18px; right: auto; left: 10px; width: 3px; height: 20px; }
  .track .dot { left: 0; margin-left: 0; }
}

.quote-actions { display: flex; align-items: center; gap: 12px 16px; flex-wrap: wrap; margin-top: 18px; }
.quote-actions .notice { flex: 1 1 260px; }
.notice-ok { background: #e3f4ea; border-color: #b9dfc8; color: #14532d; }
/* A request that was not sent yet: the remark and the button to send it, under the sentence that says so. */
.request-form { flex: 1 1 100%; max-width: 620px; }
.request-form textarea { display: block; min-height: 84px; resize: vertical; }
.request-form .field { margin-bottom: 12px; }
/* What the customer wrote with the request and what the owner wrote with his offer, with the line breaks as typed. */
.quote-note { margin: 16px 0 0; }
.quote-note p { margin: 4px 0 0; white-space: pre-line; overflow-wrap: anywhere; }
.quote-refusal { margin: 0 0 14px; }

.lines-table th:first-child, .lines-table td:first-child { padding-left: 20px; }
.lines-table th:last-child, .lines-table td:last-child { padding-right: 20px; }
.lines-table tbody tr:last-child td { border-bottom: 0; }
.part { display: flex; align-items: flex-start; gap: 14px; min-width: 0; }
.part-text { min-width: 0; text-align: left; }
.part-name { font-weight: 600; overflow-wrap: anywhere; }
.part-spec, .part-extra { font-size: 13px; color: var(--steel); overflow-wrap: anywhere; }
.part-extra { white-space: pre-line; }
/* What the shop cannot make as drawn, in the server's words. It blocks nothing, but it must not be read over. */
.part-warnings { list-style: none; margin: 6px 0 0; padding: 6px 10px; font-size: 13px; color: #7a4a00; background: #fff7e0;
  border: 1px solid #ffe3a1; border-radius: 8px; overflow-wrap: anywhere; }
.part-warnings li + li { margin-top: 4px; }
.part-warnings .warn-label { font-weight: 700; }
.thumb { flex: none; width: 72px; height: 54px; padding: 5px; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; }
.thumb svg { display: block; width: 100%; height: 100%; }
.thumb path.outline { fill: #ffe7a0; stroke: var(--ink); stroke-width: 1.5; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.thumb path.icon { fill: none; stroke: var(--steel); stroke-width: 1.5; stroke-linejoin: round; stroke-linecap: round; }
@media (max-width: 640px) {
  /* In line with the title of the card above the rows. */
  table.lines-table tr { padding-left: 20px; padding-right: 20px; }
  /* The part itself gets the full width; its label would only repeat what the drawing already says. */
  .lines-table td.part-cell { display: block; text-align: left; padding-bottom: 8px; }
  .lines-table td.part-cell::before { display: none; }
}

.detail-cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; align-items: start; }
/* The grid's own gap spaces these two; the "card after card" margin above would push the second one down. */
.account-content .detail-cols > .card { margin-top: 0; }
@media (max-width: 760px) { .detail-cols { grid-template-columns: minmax(0, 1fr); } }

/* No column gap: the lines above the sums run through from the label to the amount. */
.totals { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 7px 0; margin: 0; }
.totals dt { color: var(--ink-2); }
.totals dd { margin: 0; padding-left: 16px; text-align: right; font-variant-numeric: tabular-nums; }
.totals .sum { border-top: 1px solid var(--line); padding-top: 8px; font-weight: 600; }
.totals .grand { border-top: 2px solid var(--ink); padding-top: 9px; font-weight: 700; font-size: 17px; }
.totals-note { margin: 12px 0 0; font-size: 13px; color: var(--steel); }

.address-pair { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; }
.address-block h3 { font-size: 12.5px; text-transform: uppercase; letter-spacing: .4px; color: var(--steel); margin-bottom: 6px; }
.address-block p { margin: 0; overflow-wrap: anywhere; }
@media (max-width: 420px) { .address-pair { grid-template-columns: minmax(0, 1fr); } }

/* ---------------------------------------------------------------- addresses */

.address-groups { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; align-items: start; }
@media (max-width: 1020px) { .address-groups { grid-template-columns: minmax(0, 1fr); } }
.group-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.group-head h3 { margin: 0; }
.address-list { display: grid; gap: 12px; }
.address { padding: 16px 18px; }
.address-name { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-weight: 600; margin-bottom: 2px; }
.address-name span:first-child { overflow-wrap: anywhere; min-width: 0; }
.address-body div { overflow-wrap: anywhere; }
.address-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.empty-line { margin: 0; padding: 16px 18px; border: 1px dashed #c9cfd6; border-radius: var(--radius); color: var(--steel); }

/* ---------------------------------------------------------------- profile */

.profile-form { max-width: 620px; }
.profile-form h3 { margin-bottom: 14px; }
.form-done { margin: 0 0 14px; }

/* ---------------------------------------------------------------- dialogs */

.dialog { border: 0; border-radius: 12px; padding: 0; width: min(540px, calc(100vw - 28px)); max-height: calc(100vh - 28px);
  overflow: auto; color: var(--ink); background: var(--card); box-shadow: 0 24px 64px rgba(16, 24, 40, .35); }
.dialog::backdrop { background: rgba(21, 25, 30, .55); }
.dialog-small { width: min(440px, calc(100vw - 28px)); }
.dialog form, .dialog-body { padding: 24px; }
.dialog h2 { font-size: 20px; overflow-wrap: anywhere; }
.dialog-body p { margin: 0; overflow-wrap: anywhere; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; margin-top: 20px; }
.dialog .form-error { margin: 14px 0 0; }
.terms { margin: 0 0 12px; padding: 10px 12px; background: var(--bg); border-radius: 8px; font-size: 13.5px; color: var(--ink-2);
  white-space: pre-line; max-height: 150px; overflow: auto; }
@media (max-width: 480px) {
  .dialog form, .dialog-body { padding: 18px; }
  .field-row { grid-template-columns: minmax(0, 1fr); }
  .field-row-zip { grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); }
  .dialog-actions .btn { flex: 1 1 auto; }
}
