/* Signup, login, onboarding, and the dashboard.
 *
 * Named for the surface, like landing.css / blog.css / legal.css. Everything
 * here builds on the shared primitives in application.css and the .field
 * vocabulary in estimator.css - there is deliberately no second form system.
 *
 * Propshaft's `stylesheet_link_tag :app` ships this to the landing page too.
 * That is already true of legal.css and blog.css; see DESIGN.md 10, gap 8. */

/* Auth and onboarding card */
.auth-card {
  max-width: 30rem;
  margin-inline: auto;
  padding: 1.75rem 1.5rem;
}

.auth-heading {
  font-size: clamp(1.5rem, 4vw, 2rem);
  margin-bottom: 0.35rem;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 1.5rem;
}

.auth-submit {
  width: 100%;
  margin-top: 0.25rem;
}

.auth-alt {
  margin: 1.25rem 0 0;
  font-size: 0.9rem;
  text-align: center;
}

.auth-alt a {
  color: var(--accent);
  font-weight: 600;
}

/* Errors */
.form-errors {
  margin: 0;
  padding: 0.75rem 0.9rem 0.75rem 2rem;
  list-style: disc;
  background: #fdeeea;
  border: 1px solid var(--accent);
  border-radius: 8px;
  color: #7a2d13;
  font-size: 0.9rem;
}

.form-errors li + li {
  margin-top: 0.25rem;
}

/* Flash */
.flash {
  margin: 1rem 0 0;
  padding: 0.7rem 0.9rem;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--bg-alt);
  font-size: 0.9rem;
}

.flash-alert {
  border-color: var(--accent);
  background: #fdeeea;
  color: #7a2d13;
}

/* Onboarding: the homeowner / contractor question. The box and checked state
   come from .choice-card in application.css. */
.choice-group {
  margin: 0;
  padding: 0;
  border: 0;
}

.choice-grid {
  display: grid;
  gap: 0.75rem;
}

.choice-card {
  padding: 1rem 1.1rem;
  gap: 0.2rem;
}

.choice-card-label {
  font-size: 1.05rem;
  font-weight: 600;
}

/* Selection must not read by colour alone: `:has()` and the accent fill are
   both invisible to some users. */
.choice-card:has(input:checked) .choice-card-label::after {
  content: " \2713";
  color: var(--accent);
}

.choice-card-note {
  font-size: 0.88rem;
  color: var(--ink-soft);
}

.choice-card:has(input:focus-visible) {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

@media (min-width: 34rem) {
  .choice-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Onboarding: the upload. The native control is styled rather than replaced -
   it already has the keyboard and screen-reader semantics, and on a phone it
   opens the camera and file picker without any JavaScript. */
.upload-field input[type="file"] {
  font: inherit;
  font-size: 0.95rem;
  width: 100%;
  padding: 1rem;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  background: var(--bg-alt);
  cursor: pointer;
}

.upload-field input[type="file"]::file-selector-button {
  font: inherit;
  font-weight: 600;
  margin-right: 0.75rem;
  padding: 0.45rem 0.9rem;
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  cursor: pointer;
}

/* The "I don't have a report" / "upload it instead" escape hatch. It has to
   stay visible after a failed upload, which is what makes retry-or-switch
   real rather than a dead end. */
.branch-switch {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.4rem;
  margin: 1.25rem 0 0;
  font-size: 0.9rem;
  color: var(--ink-soft);
}

.branch-switch-form {
  display: inline;
  margin: 0;
}

/* Received */
.received-detail {
  font-size: 0.9rem;
  padding: 0.75rem 0.9rem;
  background: var(--bg-alt);
  border-radius: 8px;
}

/* Dashboard */
.request-list {
  list-style: none;
  margin: 1.5rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.75rem;
}

.request-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  align-items: baseline;
  justify-content: space-between;
  padding: 1rem 1.1rem;
}

.request-source {
  margin: 0;
  font-weight: 600;
}

.request-detail,
.request-status {
  margin: 0;
  font-size: 0.9rem;
}

.request-status span {
  display: block;
  font-size: 0.8rem;
}

.dashboard-actions {
  margin-top: 1.75rem;
}

/* Header, signed in */
.header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* With the nav hidden there is no margin-left: auto to push the actions over. */
.header-actions-alone {
  margin-left: auto;
}

.header-logout {
  margin: 0;
}

.checkbox-field {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  color: var(--ink-soft);
}

.checkbox-field input {
  width: auto;
}

/* Available to any label that has to exist for a screen reader and not on
   screen. */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
