/* Auth / onboarding: household-first, professional */

:root {
  --auth-navy: #0f2347;
  --auth-blue: #1a3a6c;
  --auth-mid: #4b5c73;
  --auth-muted: #6b7c93;
  --auth-line: #d0d7e2;
  --auth-bg: #f4f6fa;
  --auth-card: #ffffff;
  --auth-gold: #ffcc01;
  --auth-gold-deep: #ee9d18;
  --auth-err: #b91c1c;
  --auth-ok: #166534;
  --auth-radius: 16px;
  --auth-font: "Yantramanav", Helvetica, Arial, sans-serif;
}

body.auth-page {
  margin: 0;
  min-height: 100vh;
  background: var(--auth-bg);
  font-family: var(--auth-font);
  color: var(--auth-navy);
  -webkit-font-smoothing: antialiased;
}

body.auth-page.shell-app {
  /* keep shell spacing when full shell is used */
}

/* ─── Minimal auth chrome (logo bar only) ─── */
.auth-chrome {
  background: #fff;
  border-bottom: 1px solid rgba(26, 58, 108, 0.08);
  box-shadow: 0 2px 12px rgba(15, 35, 71, 0.04);
}

.auth-chrome__inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 1.25rem;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.auth-chrome__logo img {
  height: 40px;
  width: auto;
  display: block;
}

.auth-chrome__link {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--auth-blue);
  text-decoration: none;
}

.auth-chrome__link:hover {
  color: var(--auth-gold-deep);
}

.auth-continue {
  display: none;
  max-width: 1120px;
  margin: 0 auto;
  padding: 2.5rem 1.25rem;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--auth-mid);
}

html.auth-checking .auth-layout {
  display: none;
}

html.auth-checking .auth-continue {
  display: block;
}

/* ─── Layout base: always single-column unless --split ─── */
.auth-layout {
  max-width: 1120px;
  width: 100%;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 3rem;
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  align-items: start;
  box-sizing: border-box;
}

/* Two-column only when explicitly marked (aside + form) */
@media (min-width: 900px) {
  .auth-layout--split {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
    gap: 2.5rem;
    padding: 2.5rem 1.5rem 4rem;
    min-height: calc(100vh - 64px);
    align-items: center;
  }
}

/* Value / trust panel */
.auth-aside {
  background: linear-gradient(160deg, #0f2347 0%, #1a3a6c 55%, #243f72 100%);
  color: #fff;
  border-radius: var(--auth-radius);
  padding: 1.75rem 1.5rem;
  box-shadow: 0 16px 40px rgba(15, 35, 71, 0.18);
}

@media (min-width: 900px) {
  .auth-aside {
    padding: 2.25rem 2rem;
    min-height: 520px;
    display: flex;
    flex-direction: column;
    justify-content: center;
  }
}

.auth-aside__eyebrow {
  margin: 0 0 0.75rem;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--auth-gold);
}

.auth-aside h1,
.auth-aside__title {
  margin: 0 0 0.75rem;
  font-size: clamp(1.45rem, 2.5vw, 1.85rem);
  font-weight: 900;
  line-height: 1.2;
  color: #fff;
}

.auth-aside__lead {
  margin: 0 0 1.5rem;
  font-size: 1.02rem;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.88);
  font-weight: 500;
}

.auth-benefits {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.85rem;
}

.auth-benefits li {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 0.75rem;
  align-items: start;
  font-size: 0.95rem;
  line-height: 1.45;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.95);
}

.auth-benefits__icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: rgba(255, 204, 1, 0.18);
  color: var(--auth-gold);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 900;
  flex-shrink: 0;
}

.auth-aside__foot {
  margin: 1.75rem 0 0;
  padding-top: 1.25rem;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.7);
  line-height: 1.45;
}

/* Form panel */
.auth-panel {
  background: var(--auth-card);
  border-radius: var(--auth-radius);
  padding: 1.5rem 1.35rem 1.75rem;
  box-shadow: 0 10px 36px rgba(15, 35, 71, 0.08);
  border: 1px solid rgba(26, 58, 108, 0.06);
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

@media (min-width: 640px) {
  .auth-panel {
    padding: 2rem 2rem 2.15rem;
  }
}

.auth-panel__header {
  margin-bottom: 1.25rem;
}

.auth-panel__header h1,
.auth-panel__title {
  margin: 0 0 0.4rem;
  font-size: 1.45rem;
  font-weight: 900;
  color: var(--auth-navy);
  line-height: 1.2;
}

.auth-panel__lead {
  margin: 0;
  color: var(--auth-mid);
  font-size: 0.98rem;
  line-height: 1.5;
  font-weight: 500;
}

/* Tabs: Create account | Sign in */
.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.35rem;
  padding: 0.3rem;
  background: #eef1f6;
  border-radius: 12px;
  margin-bottom: 1.35rem;
}

.auth-tabs button {
  appearance: none;
  border: 0;
  background: transparent;
  border-radius: 10px;
  min-height: 44px;
  padding: 0.55rem 0.75rem;
  font: inherit;
  font-size: 0.92rem;
  font-weight: 800;
  color: var(--auth-muted);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.auth-tabs button:hover {
  color: var(--auth-navy);
}

.auth-tabs button[aria-selected="true"] {
  background: #fff;
  color: var(--auth-navy);
  box-shadow: 0 2px 8px rgba(15, 35, 71, 0.08);
}

.auth-tab-panel[hidden] {
  display: none;
}

/* Fields */
.auth-field {
  margin-bottom: 0.95rem;
}

.auth-field label {
  display: block;
  font-weight: 700;
  font-size: 0.88rem;
  margin-bottom: 0.4rem;
  color: var(--auth-blue);
}

.auth-field input,
.auth-field select,
.auth-field textarea {
  width: 100%;
  box-sizing: border-box;
  min-height: 48px;
  padding: 0.7rem 0.9rem;
  border: 1.5px solid var(--auth-line);
  border-radius: 10px;
  font: inherit;
  font-size: 1rem;
  color: var(--auth-navy);
  background: #fff;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.auth-field input:focus,
.auth-field select:focus,
.auth-field textarea:focus {
  outline: none;
  border-color: var(--auth-gold-deep);
  box-shadow: 0 0 0 3px rgba(255, 204, 1, 0.28);
}

.auth-field input[aria-invalid="true"],
.auth-field select[aria-invalid="true"],
.auth-field textarea[aria-invalid="true"] {
  border-color: var(--auth-err);
}

.auth-field input[aria-invalid="true"]:focus,
.auth-field select[aria-invalid="true"]:focus,
.auth-field textarea[aria-invalid="true"]:focus {
  border-color: var(--auth-err);
  box-shadow: 0 0 0 3px rgba(185, 28, 28, 0.16);
}

.auth-field__error {
  margin: 0.35rem 0 0;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--auth-err);
  line-height: 1.35;
}

.auth-field__error[hidden] {
  display: none;
}

.auth-field__error--ok {
  color: var(--auth-ok);
}

.auth-field__error--ok::before {
  content: "✓ ";
}

.auth-field__error--mismatch::before {
  content: "× ";
}

.auth-field input.is-password-match {
  border-color: var(--auth-ok);
}

.auth-field input.is-password-match:focus {
  border-color: var(--auth-ok);
  box-shadow: 0 0 0 3px rgba(22, 101, 52, 0.16);
}

.auth-field input::placeholder {
  color: #9aa8bc;
}

.auth-field__hint {
  margin: 0.35rem 0 0;
  font-size: 0.8rem;
  color: var(--auth-muted);
  line-height: 1.35;
}

.auth-field__hint[hidden] {
  display: none;
}

.auth-check {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  margin: 0.25rem 0 1rem;
  font-size: 0.95rem;
  line-height: 1.4;
  color: var(--auth-navy);
}

.auth-check input[type="checkbox"] {
  width: auto;
  min-height: 0;
  margin-top: 0.2rem;
  flex: 0 0 auto;
}

.suburb-wrap {
  position: relative;
}

.suburb-suggest {
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  z-index: 20;
  background: #fff;
  border: 1px solid var(--auth-line);
  border-radius: 10px;
  box-shadow: 0 8px 28px rgba(15, 35, 71, 0.08);
  max-height: 200px;
  overflow: auto;
  display: none;
}

.suburb-suggest button {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  padding: 0.65rem 0.85rem;
  font: inherit;
  font-weight: 600;
  color: var(--auth-navy);
  cursor: pointer;
}

.suburb-suggest button:hover,
.suburb-suggest button.is-active {
  background: rgba(255, 204, 1, 0.15);
}

.suburb-suggest--with-footer {
  flex-direction: column;
  overflow: hidden;
  max-height: 260px;
}

.suburb-suggest__results {
  overflow: auto;
  flex: 1 1 auto;
  min-height: 0;
}

.suburb-suggest__empty {
  margin: 0;
  padding: 0.65rem 0.85rem;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--auth-muted);
}

.suburb-suggest button.suburb-suggest__footer {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  border-top: 1px solid var(--auth-line);
  font-weight: 800;
  min-height: 48px;
}

.suburb-suggest__footer::after {
  content: "+";
  color: #c48a12;
  font-size: 1.15rem;
  line-height: 1;
  font-weight: 700;
}

.auth-field__hint .suburb-did-you-mean {
  border: 0;
  background: none;
  padding: 0;
  font: inherit;
  font-weight: 700;
  color: inherit;
  text-decoration: underline;
  cursor: pointer;
}

.auth-row-2 {
  display: grid;
  gap: 0.75rem;
}

@media (min-width: 520px) {
  .auth-row-2 {
    grid-template-columns: 1fr 1fr;
  }
}

/* Errors / success */
.auth-err {
  display: none;
  margin: 0 0 0.85rem;
  padding: 0.7rem 0.85rem;
  border-radius: 10px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: var(--auth-err);
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.4;
}

.auth-err.is-visible {
  display: block;
}

.auth-err__cta-wrap {
  display: block;
  margin-top: 0.55rem;
}

.auth-err__cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 0.95rem;
  border-radius: 10px;
  border: 2px solid var(--auth-blue);
  background: #fff;
  color: var(--auth-blue);
  font-weight: 800;
  text-decoration: none;
}

.auth-err__cta:hover {
  background: rgba(26, 58, 108, 0.06);
  color: var(--auth-navy);
}

.auth-ok {
  display: none;
  margin: 0 0 0.85rem;
  padding: 0.7rem 0.85rem;
  border-radius: 10px;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: var(--auth-ok);
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.4;
}

.auth-ok.is-visible {
  display: block;
}

/* Buttons */
.auth-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 52px;
  padding: 0.85rem 1.15rem;
  border-radius: 12px;
  border: 2px solid transparent;
  font: inherit;
  font-size: 1.02rem;
  font-weight: 800;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
  box-sizing: border-box;
  line-height: 1.25;
  transition: filter 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.auth-btn:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.auth-btn--primary {
  background: linear-gradient(135deg, var(--auth-gold), var(--auth-gold-deep));
  color: var(--auth-navy);
  box-shadow: 0 6px 18px rgba(238, 157, 24, 0.32);
}

.auth-btn--primary:hover:not(:disabled) {
  filter: brightness(1.03);
}

.auth-btn--secondary {
  background: #fff;
  border-color: rgba(26, 58, 108, 0.18);
  color: var(--auth-navy);
}

.auth-btn--secondary:hover:not(:disabled) {
  border-color: var(--auth-gold-deep);
  background: rgba(255, 204, 1, 0.08);
}

.auth-otp-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem 1.15rem;
  margin-top: 1rem;
}

.auth-otp-actions button {
  appearance: none;
  border: 0;
  background: none;
  padding: 0;
  font: inherit;
  font-weight: 700;
  color: var(--auth-blue);
  cursor: pointer;
  text-decoration: underline;
}

.auth-otp-actions button:hover:not(:disabled) {
  color: var(--auth-gold-deep);
}

.auth-otp-actions button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.auth-btn--ghost {
  background: transparent;
  color: var(--auth-blue);
  border-color: transparent;
  min-height: 44px;
  font-size: 0.95rem;
}

.auth-btn--ghost:hover:not(:disabled) {
  background: rgba(26, 58, 108, 0.05);
}

/* Divider / secondary paths */
.auth-divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 1.25rem 0 1rem;
  color: var(--auth-muted);
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--auth-line);
}

.auth-alt {
  text-align: center;
  margin: 0;
  font-size: 0.92rem;
  color: var(--auth-mid);
  line-height: 1.5;
}

.auth-alt a {
  color: var(--auth-blue);
  font-weight: 800;
  text-decoration: none;
}

.auth-alt a:hover {
  color: var(--auth-gold-deep);
  text-decoration: underline;
}

/* Tertiary path: quiet, not competing with primary CTA */
.auth-tradie-path {
  margin-top: 1.35rem;
  padding: 0.95rem 1rem;
  border-radius: 12px;
  background: #f7f8fb;
  border: 1px solid rgba(26, 58, 108, 0.08);
  text-align: center;
}

.auth-tradie-path p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--auth-mid);
  font-weight: 600;
  line-height: 1.45;
}

.auth-tradie-path a {
  color: var(--auth-blue);
  font-weight: 800;
  text-decoration: none;
}

.auth-tradie-path a:hover {
  color: var(--auth-gold-deep);
  text-decoration: underline;
}

/* Compact single-column (standalone card: never 2-col) */
.auth-layout--compact {
  max-width: 440px;
  width: 100%;
  margin-inline: auto;
  padding-top: 2rem;
  grid-template-columns: 1fr;
}

@media (min-width: 900px) {
  .auth-layout--compact {
    grid-template-columns: 1fr;
    min-height: auto;
    padding-top: 2.5rem;
  }
}

.auth-layout--compact .auth-panel {
  width: 100%;
}

.auth-layout--wide-form {
  max-width: 640px;
  margin-inline: auto;
  grid-template-columns: 1fr;
}

.auth-layout--wide-form .auth-panel {
  width: 100%;
}

/* Join tradie / sign-in split: slightly tighter max + column ratio */
.auth-layout--tradie {
  max-width: 980px;
}

@media (min-width: 900px) {
  .auth-layout--split.auth-layout--tradie {
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  }
}

/* Trust chips under primary CTA */
.auth-trust-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  margin: 0.9rem 0 0;
  justify-content: center;
}

.auth-trust-row span {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--auth-muted);
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.auth-trust-row span::before {
  content: "✓";
  color: var(--auth-ok);
  font-weight: 900;
}

/* Hide full shell chrome when minimal mode marks body */
body.auth-minimal .shell-top,
body.auth-minimal .shell-nav,
body.auth-minimal .shell-footer {
  display: none !important;
}

body.auth-minimal {
  padding-top: 0 !important;
}

.auth-dual__actions {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 0.35rem;
}

.auth-coverage {
  margin: 0 0 1.1rem;
}

.auth-coverage__label {
  margin: 0 0 0.5rem;
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--auth-navy);
}

.auth-coverage__opts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.auth-coverage__opt {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 44px;
  padding: 0.35rem 0.9rem;
  border: 2px solid #d7deea;
  border-radius: 999px;
  background: #fff;
  color: var(--auth-blue);
  font-weight: 800;
  cursor: pointer;
}

.auth-coverage__opt input {
  margin: 0;
}

.auth-coverage__opt.is-selected {
  background: #1a3a6c;
  border-color: #1a3a6c;
  color: #fff;
}

.auth-coverage-back {
  margin: 0.85rem 0 0;
}

.auth-coverage__link {
  border: 0;
  background: none;
  padding: 0;
  font: inherit;
  font-weight: 800;
  color: var(--auth-blue);
  cursor: pointer;
  text-decoration: none;
}

.auth-coverage__link:hover {
  color: var(--auth-gold-deep);
  text-decoration: underline;
}
