/* ==========================================================================
   Wizo — the account: signing in, "Your projects", the project file.

   These pages are inside the building: plaster ground, ink words, hairlines.
   The lamp is used only for what is current (the stage a project is at) and for
   the slot of a page's main action.

   Shared pieces (buttons, fields, captions, the top bar, the menu) come from base.css.
   The drop area and the grid of uploaded files come from uploads.css, which the
   project page loads after this file.

   1. The top bar of account pages
   2. Signing in (the layout of every django-allauth page)
   3. The page frame
   4. Your projects
   5. The project file
   ========================================================================== */

/* 1. The top bar of account pages -------------------------------------------
   Built on .topbar from base.css. Account pages scroll, so the bar gets the wall's
   colour and a hairline; both disappear while the menu is open. */
.app-bar { background: var(--plaster); border-bottom: 1px solid var(--line); transition: color 0.6s var(--ease-out), background-color 0.4s, border-color 0.4s; }
.app-bar[data-open="true"] { background: transparent; border-bottom-color: transparent; }
.app-bar__links { display: flex; align-items: center; gap: clamp(1.1rem, 2.4vw, 2.2rem); }
.app-bar__links form { margin: 0; }
/* Links that only fit on a wide screen. On a phone they live in the menu. */
.app-bar__wide { display: none; }
@media (min-width: 860px) { .app-bar__wide { display: inline-flex; } }
/* "Sign out" at the foot of the menu: a button that reads like the links around it. */
.menu__signout { min-height: 44px; color: inherit; font-size: inherit; }
.menu__signout:hover { color: #fff; }

/* 2. Signing in ---------------------------------------------------------------
   Two halves: the words and the form on plaster, a photograph of the place beside them.
   On a phone: the bar, the photograph as a short band, then the form. */
body.page-auth { background: var(--plaster); }
.auth { display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto 1fr; min-height: 100svh; }
.auth__bar { display: flex; align-items: center; justify-content: space-between; height: var(--bar); padding-inline: var(--gutter); }
/* The band keeps the photograph's own proportion (1600 x 893), so the whole front is seen. */
.auth__plate { height: min(56vw, 46svh); min-height: 10rem; }
/* The picture is a touch taller than its frame, so the frame trims the last few pixels at the
   bottom (a dark line of water and a sliver of stepping stone) and ends on the wall itself. */
.auth__plate img { height: 104%; }
.auth__side { display: flex; flex-direction: column; padding: clamp(2rem, 6vh, 3rem) var(--gutter) 4rem; }
.auth__body { width: min(100%, 27rem); }

/* Wide screens: bar and form in the left column, the photograph fills the right one. */
@media (min-width: 900px) {
  .auth { grid-template-columns: minmax(28rem, 5fr) minmax(0, 7fr); grid-template-rows: auto 1fr; }
  .auth__bar { grid-column: 1; grid-row: 1; }
  .auth__side { grid-column: 1; grid-row: 2; padding-block: 2rem calc(var(--bar) + 2rem); }
  .auth__plate { grid-column: 2; grid-row: 1 / span 2; position: sticky; top: 0; height: 100svh; max-height: none; }
  .auth__body { margin-block: auto; }
}

/* Messages ("A sign-in code has been sent…"): on a wide screen kept over the form's column
   instead of straddling the photograph. */
@media (min-width: 900px) { .page-auth .toasts { left: var(--gutter); transform: none; width: min(27rem, 100% - 2 * var(--gutter)); } }

/* The words */
.auth__title, .auth__body h1 { font-size: var(--step-3); font-weight: 500; letter-spacing: -0.04em; line-height: 1; }
.auth__body .caption + .auth__title { margin-top: 0.9rem; }
.auth__body p { color: var(--muted); margin-top: 1rem; max-width: 36ch; }
.auth__body p.caption { margin-top: 0; }
.auth__body p a { color: var(--fg); text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 0.24em; }
.auth__body p a:hover { text-decoration-color: currentColor; }
/* A second part of a page ("Add an address"): set apart under a hairline, like a sheet. */
.auth__body h2, .panel__title { font-size: var(--step-1); font-weight: 550; letter-spacing: -0.02em; margin-top: 3rem; padding-top: 1.4rem; border-top: 1px solid var(--line-strong); }
.auth__body hr { margin-block: 2.2rem 1rem; }
.auth__body .auth__foot { margin-top: 1.8rem; font-size: 0.95rem; }

/* The forms (only those with something to show: allauth also prints empty helper forms) */
.auth__body form:has(.auth__actions) { margin-top: 2.2rem; }
.auth__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1.2rem; margin-top: 2.2rem; }
.auth__actions:empty { display: none; }
/* allauth sometimes puts a group of buttons inside the actions of a form: no second margin. */
.auth__actions .auth__actions { margin-top: 0; }
/* Every button of a row has the same height; the main one is a little wider and larger. */
.auth__actions .btn { min-height: 3.75rem; }
.auth__actions .btn--ember { padding-inline: 1.9rem; font-size: 1.04rem; }
.auth__body .errorlist { margin-top: 0.4rem; }
.auth__body form > .errorlist { margin: 0 0 1.4rem; }
.auth-alert { margin-top: 1.4rem; border-left-color: var(--danger); color: var(--danger); }
/* A saved email filled in by the browser keeps the wall's colour (the inset "shadow" is
   only the way browsers let us paint over their autofill tint). */
.auth__body input:-webkit-autofill { -webkit-text-fill-color: var(--ink); box-shadow: 0 0 0 100px var(--plaster) inset; }
.auth__body input:-webkit-autofill:focus { box-shadow: 0 0 0 100px var(--plaster) inset, 0 1px 0 0 var(--ink); }

/* The one-time code: large figures that line up, set wide apart, typed onto the wall. */
.auth__body input[name="code"] {
  padding-block: 0.4rem 0.7rem; font-size: clamp(2rem, 9vw, 2.75rem); font-weight: 500; font-stretch: 88%;
  font-variant-numeric: tabular-nums; letter-spacing: 0.3em; text-transform: uppercase;
}
/* The caption above already says "Code": the empty line needs no second word. */
.auth__body input[name="code"]::placeholder { color: transparent; }

/* A tick box (or a choice) and its words on one line */
.field--check { display: flex; align-items: center; gap: 0.7rem; min-height: 44px; }
.field--check label { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 0.7rem; min-width: 0; font-size: 0.95rem; cursor: pointer; }
.field--check input { flex: none; width: 1.15rem; height: 1.15rem; accent-color: var(--ink); }
.field--check + .field--check { margin-top: 0.4rem; }

/* Something folded away ("Use a password instead", "What you told us"):
   a small slot in front of the words; it widens when the fold is open. */
.auth__more > summary, .more > summary {
  display: inline-flex; align-items: center; gap: 0.7rem; min-height: 44px; cursor: pointer; list-style: none;
  font-size: 0.95rem; text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 0.3em;
}
.auth__more > summary::-webkit-details-marker, .more > summary::-webkit-details-marker { display: none; }
.auth__more > summary::before, .more > summary::before { content: ""; flex: none; width: 2px; height: 1.05em; background: var(--ink); transition: width 0.45s var(--ease-out); }
.auth__more > summary:hover, .more > summary:hover { text-decoration-color: currentColor; }
.auth__more[open] > summary::before, .more[open] > summary::before { width: 6px; }
.auth__more form:has(.auth__actions) { margin-top: 1.2rem; }

/* 3. The page frame -----------------------------------------------------------
   The body is a column so that a short page still has its footer at the bottom. */
body.page-app { display: flex; flex-direction: column; background: var(--plaster); }
body.page-app > main { flex: 1; }
/* Messages on account pages sit at the foot of the screen, so they never cover the head of the
   page (right after signing in there are two of them). They stay under the menu when it is open. */
.page-app .toasts { top: auto; bottom: max(1rem, env(safe-area-inset-bottom)); left: var(--gutter); transform: none; width: min(100% - 2 * var(--gutter), 30rem); z-index: 50; }
/* Headlines that rise out of a mask (.reveal in base.css): room for the tails of g, j, p, y. */
.page-app .reveal > *, .page-auth .reveal > * { padding-bottom: 0.14em; margin-bottom: -0.14em; }
/* The page shares both edges with the top bar; only on a very wide screen does it stop growing,
   and then it stays on the left. */
.app-page { width: min(100% - 2 * var(--gutter), 1920px); margin-inline: var(--gutter) auto; padding-block: calc(var(--bar) + clamp(2.2rem, 7vh, 5rem)) clamp(4rem, 10vh, 7rem); }
.app-head__title { font-size: var(--step-4); margin-top: 0.9rem; }
/* An email address reads badly in capitals: keep it as typed. */
.app-head__who { text-transform: none; letter-spacing: 0.02em; font-weight: 500; font-size: 0.82rem; }

/* 4. Your projects --------------------------------------------------------------
   A register: one hairline row per project. The slot appears at the left of the row
   that is about to be opened. */
.rows { margin-top: clamp(2.4rem, 7vh, 4.5rem); }
/* The name and the stage share the free width, so on a wide screen the stage stays near the name. */
.rows__head, .row { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(13rem, 1fr) 7.5rem 8rem 6.5rem; gap: 0 1.5rem; align-items: baseline; }
.rows__head { padding-bottom: 0.8rem; border-bottom: 1px solid var(--line-strong); }
.row { position: relative; padding: 1.55rem 0 1.6rem; border-bottom: 1px solid var(--line); transition: padding 0.5s var(--ease-out); }
.row::before { content: ""; position: absolute; left: 0; top: 1.45rem; bottom: 1.5rem; width: 2px; background: var(--lamp); opacity: 0; transition: width 0.5s var(--ease-out), opacity 0.3s; }
.row:hover, .row:focus-visible { padding-left: 1.3rem; }
.row:hover::before, .row:focus-visible::before { width: 6px; opacity: 1; }
.row__name { font-size: var(--step-2); font-weight: 500; letter-spacing: -0.035em; line-height: 1.08; }
.row__stage { color: var(--ink); }
.row__stage.is-draft { color: var(--muted); }
.row__stage.is-live { color: var(--success); }
.row__ref, .row__date { color: var(--muted); }
.row__go { justify-self: end; font-weight: 550; font-size: 0.95rem; white-space: nowrap; }
.row__go span { display: inline-block; margin-left: 0.3em; transition: transform 0.5s var(--ease-out); }
.row:hover .row__go span { transform: translateX(5px); }

/* Phone: the name and the arrow on one line, the facts under the name. */
@media (max-width: 760px) {
  .rows__head { display: none; }
  .rows__list { border-top: 1px solid var(--line-strong); }
  .row { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "name go" "stage ref"; gap: 0.7rem 1rem; padding-block: 1.3rem 1.35rem; }
  .row::before { top: 1.25rem; bottom: 1.3rem; }
  .row__name { grid-area: name; }
  .row__go { grid-area: go; }
  .row__stage { grid-area: stage; }
  .row__ref { grid-area: ref; justify-self: end; }
  .row__date { display: none; }
}

/* No project yet */
.empty { display: grid; justify-items: start; gap: 1.1rem; margin-top: clamp(2.4rem, 7vh, 4.5rem); padding-top: 2rem; border-top: 1px solid var(--line-strong); }
.empty .btn { margin-top: 0.8rem; }

/* 5. The project file -------------------------------------------------------------
   Title block, where the project stands, what needs the customer, then the facts. */
/* The way back: a small word, but a full-size target for a thumb. */
.file__back { display: inline-flex; align-items: center; min-height: 44px; margin-block: -15px; }
.file__name { font-size: var(--step-3); margin-top: 0.9rem; max-width: 22ch; }

/* The title block: label over value, cells divided by hairlines. */
.file__strip { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); margin-top: clamp(1.6rem, 4vh, 2.4rem); border-block: 1px solid var(--line-strong); }
.file__strip > div { display: grid; align-content: start; gap: 0.35rem; padding: 0.85rem 1rem 0.9rem 0; }
.file__strip > div + div { padding-left: 1.2rem; border-left: 1px solid var(--line); }
.file__strip dd { font-size: 0.98rem; }
@media (max-width: 700px) {
  .file__strip { grid-auto-flow: row; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .file__strip > div + div { padding-left: 0; border-left: 0; }
  .file__strip > div:nth-child(even) { padding-left: 1.1rem; border-left: 1px solid var(--line); }
  .file__strip > div:nth-child(n + 3) { border-top: 1px solid var(--line); }
}

/* Where the project is: the headline of the page. */
.status { margin-top: clamp(2.6rem, 8vh, 5.5rem); }
.status__title { font-size: var(--step-4); margin-top: 1.1rem; max-width: 14ch; }
.status__text { margin-top: 1.2rem; }

/* The path, as a row of slots: ink = done, the lamp = now, pale = still to come. */
.timeline { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); margin-top: clamp(2.4rem, 7vh, 4.5rem); }
.timeline li { position: relative; display: grid; align-content: start; gap: 0.3rem; min-height: 5.2rem; padding: 0.9rem 0.8rem 0 0.95rem; border-top: 1px solid var(--line-strong); color: var(--muted); }
.timeline li::before { content: ""; position: absolute; left: 0; top: 0; width: 2px; height: 2.7rem; background: var(--line-strong); }
.timeline__num { font-stretch: 84%; font-weight: 600; font-size: 0.7rem; letter-spacing: 0.15em; }
.timeline__label { font-stretch: 88%; font-size: 0.9rem; line-height: 1.25; }
.timeline li.is-done { color: var(--ink); }
.timeline li.is-done::before { background: var(--ink); }
.timeline li.is-current { color: var(--ink); padding-left: 1.2rem; }
.timeline li.is-current::before { width: 6px; background: var(--lamp); }
.timeline li.is-current .timeline__label { font-weight: 650; }
.timeline__count { display: none; }
.timeline__count:empty { display: none !important; }   /* a cancelled project has no current step */
/* Medium screens: two rows of five. */
@media (max-width: 1100px) { .timeline { grid-auto-flow: row; grid-template-columns: repeat(5, minmax(0, 1fr)); row-gap: 1.2rem; } }
/* Phone: only the slots, and the count in words under them. */
@media (max-width: 700px) {
  .timeline { grid-auto-flow: column; grid-template-columns: none; row-gap: 0; }
  .timeline li { min-height: 0; height: 2.2rem; padding: 0; }
  .timeline li::before { height: 100%; }
  .timeline__num, .timeline__label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  /* "Step 4 of 10" on the left, "Next — In production" on the right. */
  .timeline__count { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.3rem 1.2rem; margin-top: 0.9rem; }
  .timeline__count span:first-child { color: var(--ink); }
}

/* The body of the file: what needs you on the left, the facts on the right. */
.file__body { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 0 clamp(2.5rem, 7vw, 7rem); align-items: start; margin-top: clamp(3rem, 9vh, 6rem); }
@media (max-width: 960px) { .file__body { grid-template-columns: minmax(0, 1fr); } }
.file .callout { max-width: 46rem; margin-top: 2.2rem; }

/* A sheet: one section of the file, under a strong hairline. */
.sheet { padding-block: 1.3rem clamp(2.6rem, 7vh, 4.2rem); border-top: 1px solid var(--line-strong); }
.sheet__head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin-bottom: 1.5rem; }
.sheet__title { font-size: var(--step-1); font-weight: 550; letter-spacing: -0.02em; line-height: 1.15; }
.sheet__text { max-width: 52ch; }
/* A second part inside a sheet, under a lighter hairline. */
.sheet__part { margin-top: 2.2rem; padding-top: 1.6rem; border-top: 1px solid var(--line); }
/* "Request changes": the line grows with the words, so the browser's resize grip is not needed. */
.file textarea { resize: none; field-sizing: content; min-height: 5.5rem; }

/* The quote: the one total of the page. */
.quote { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 1.6rem 2rem; }
.quote__amount { font-size: var(--step-4); font-weight: 500; letter-spacing: -0.045em; line-height: 0.95; font-variant-numeric: tabular-nums; }
.quote__currency { font-size: 0.36em; font-stretch: 86%; letter-spacing: 0.04em; color: var(--muted); }
.quote .muted { margin-top: 0.7rem; max-width: 34ch; }
.quote form { display: grid; gap: 0.7rem; justify-items: start; }
.quote__secure { color: var(--muted); }

/* The uploader on this page: one drop area, full width, a little lower than in the flow. */
.file .uploader { margin-top: 0; }
.file .dropzones { grid-template-columns: minmax(0, 1fr); }
.file .dropzone { min-height: 9.5rem; }
.file .dropzone__icon { background: var(--ink); }   /* the lamp is kept for the current stage */
/* On a touch screen the small buttons on a file (remove, star) get a full-size target. */
@media (hover: none) { .file :is(.asset-card__remove, .asset-card__key) { width: 2.75rem; height: 2.75rem; } }

/* Facts from the brief and the activity: hairline tables. */
.facts > div { display: grid; grid-template-columns: 7rem minmax(0, 1fr); gap: 1rem; align-items: baseline; padding: 0.8rem 0 0.85rem; border-bottom: 1px solid var(--line); font-size: 0.97rem; }
.facts > div:first-child { padding-top: 0; }
.facts dd { margin: 0; }
.activity li { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; padding: 0.8rem 0 0.85rem; border-bottom: 1px solid var(--line); font-size: 0.97rem; }
.activity li:first-child { padding-top: 0; }
.activity time { color: var(--muted); white-space: nowrap; }
.file__help { padding-top: 1.3rem; border-top: 1px solid var(--line-strong); color: var(--muted); font-size: 0.97rem; }
.file__help a { color: var(--fg); white-space: nowrap; }   /* the link moves to the next line whole */
/* Text links in a sentence: a taller target without moving the line. */
.file__help a, .auth__foot a { padding-block: 0.7rem; }

/* --------------------------------------------------------------------------
   The proposal: the customer's website, shown inside their project page
   -------------------------------------------------------------------------- */
.proposal__frame { margin-top: 1.6rem; border: 1px solid var(--line-strong); background: var(--surface); }
.proposal__tools { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: 0.4rem 0.9rem; border-bottom: 1px solid var(--line); font-size: 0.9rem; }
.proposal__sizes { display: inline-flex; }
.proposal__sizes button { min-height: 44px; padding: 0 0.9rem; color: var(--muted); border-bottom: 2px solid transparent; }
.proposal__sizes button.is-on { color: var(--fg); border-bottom-color: var(--lamp); }
.proposal__screen { display: grid; justify-items: center; background: var(--surface-2); }
.proposal__screen iframe { display: block; width: 100%; height: min(78svh, 46rem); border: 0; background: #fff; transition: width 0.6s var(--ease-out); }
.proposal__frame[data-size="phone"] .proposal__screen iframe { width: min(100%, 390px); }
.proposal__asked { margin-top: 1.2rem; padding-left: 1rem; border-left: 3px solid var(--lamp); }
.proposal__asked .caption { display: block; margin-bottom: 0.2rem; }
/* Being made: three slots breathing, as in the questionnaire. */
.proposal__slots { display: inline-flex; gap: 5px; }
.proposal__slots i { width: 3px; height: 1.1rem; background: var(--lamp); animation: proposal-breathe 1.2s var(--ease-in-out) infinite; }
.proposal__slots i:nth-child(2) { animation-delay: 0.15s; }
.proposal__slots i:nth-child(3) { animation-delay: 0.3s; }
@keyframes proposal-breathe { 0%, 100% { transform: scaleY(0.35); opacity: 0.4; } 50% { transform: scaleY(1); opacity: 1; } }
