:root {
  color-scheme: light;
  --ink: #173129;
  --green: #1f6f50;
  --green-dark: #173e31;
  --green-soft: #e9f2ed;
  --gold: #cda95d;
  --paper: #fbfaf6;
  --white: #ffffff;
  --line: #d9e1dc;
  --muted: #617068;
  --error: #a52f2f;
  --warning: #755916;
  --shadow: 0 24px 70px rgba(18, 49, 39, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--paper);
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 10% 10%, rgba(205, 169, 93, 0.15), transparent 30rem),
    linear-gradient(145deg, #fdfcf8 0%, #eef5f1 100%);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.55;
}

a {
  color: var(--green-dark);
}

a:hover {
  color: var(--green);
}

button,
input {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

:focus-visible {
  outline: 3px solid rgba(31, 111, 80, 0.36);
  outline-offset: 3px;
}

.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 20;
  padding: 10px 14px;
  border-radius: 8px;
  color: var(--white);
  background: var(--green-dark);
  transform: translateY(-160%);
}

.skip-link:focus {
  transform: translateY(0);
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: 24px 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border: 1px solid rgba(23, 49, 41, 0.24);
  border-radius: 50% 50% 50% 14px;
  background: var(--white);
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 18px;
}

.brand small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 9px;
}

.secure-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}

.secure-label::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 5px rgba(31, 111, 80, 0.12);
}

.page-shell {
  display: grid;
  align-items: center;
  min-height: calc(100vh - 188px);
  padding: 28px 20px 60px;
}

.auth-panel {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(390px, 0.8fr);
  gap: clamp(36px, 7vw, 100px);
  align-items: center;
  width: min(1100px, 100%);
  margin: 0 auto;
}

.auth-copy {
  max-width: 590px;
}

.eyebrow {
  margin: 0 0 14px;
  color: var(--green);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

h1,
h2,
p {
  overflow-wrap: anywhere;
}

h1 {
  max-width: 14ch;
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(38px, 5vw, 70px);
  font-weight: 500;
  line-height: 0.98;
  letter-spacing: -0.035em;
}

#pageLead {
  max-width: 48ch;
  margin: 24px 0 0;
  color: var(--muted);
  font-size: 17px;
}

.trust-list {
  display: grid;
  gap: 10px;
  margin: 30px 0 0;
  padding: 0;
  list-style: none;
  color: var(--muted);
  font-size: 14px;
}

.trust-list li {
  position: relative;
  padding-left: 26px;
}

.trust-list li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--green);
  font-weight: 800;
}

.auth-card {
  width: 100%;
  min-height: 360px;
  padding: clamp(24px, 4vw, 42px);
  border: 1px solid rgba(23, 49, 41, 0.12);
  border-radius: 26px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

form,
.state-view,
.cabinet-view {
  display: grid;
  gap: 20px;
}

[hidden] {
  display: none !important;
}

.field {
  display: grid;
  gap: 7px;
}

label,
.link-box > label {
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
}

input[type="text"],
input[type="email"],
input[type="password"] {
  width: 100%;
  min-height: 50px;
  padding: 11px 13px;
  border: 1px solid #a8b5ae;
  border-radius: 11px;
  color: var(--ink);
  background: var(--white);
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

input:hover {
  border-color: #70837a;
}

input:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 4px rgba(31, 111, 80, 0.11);
  outline: none;
}

input[aria-invalid="true"] {
  border-color: var(--error);
}

.password-field {
  position: relative;
}

.password-field input {
  padding-right: 90px;
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 8px;
  min-height: 36px;
  padding: 5px 8px;
  border: 0;
  color: var(--green-dark);
  background: transparent;
  transform: translateY(-50%);
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
}

.field-hint,
.field-error {
  min-height: 18px;
  color: var(--muted);
  font-size: 12px;
}

.field-error {
  color: var(--error);
}

.consent-row {
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 10px;
  align-items: start;
  font-weight: 500;
  line-height: 1.45;
}

.consent-row input {
  width: 19px;
  height: 19px;
  margin: 2px 0 0;
  accent-color: var(--green);
}

.legal-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  margin-top: -10px;
  font-size: 12px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 50px;
  padding: 12px 18px;
  border: 1px solid transparent;
  border-radius: 11px;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  font-weight: 800;
  transition: transform 150ms ease, background-color 150ms ease, border-color 150ms ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button:disabled {
  cursor: wait;
  opacity: 0.66;
  transform: none;
}

.button-primary {
  color: var(--white);
  background: var(--green-dark);
}

.button-primary:hover {
  color: var(--white);
  background: var(--green);
}

.button-secondary {
  border-color: #9aac9f;
  color: var(--green-dark);
  background: var(--white);
}

.button-wide {
  width: 100%;
}

.button-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.form-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 20px;
  margin: -2px 0 0;
  font-size: 13px;
}

.message {
  margin-bottom: 18px;
  padding: 12px 14px;
  border: 1px solid #f0b9b9;
  border-radius: 11px;
  color: #7d2424;
  background: #fff2f2;
  font-size: 14px;
}

.message-success {
  border-color: #acd0bd;
  color: #18523b;
  background: #edf8f1;
}

.message-warning {
  margin: 0;
  border-color: #dfcf9b;
  color: var(--warning);
  background: #fff9e8;
}

.state-view {
  place-items: center;
  min-height: 280px;
  text-align: center;
}

.state-view h2,
.state-view p {
  margin: 0;
}

.spinner {
  width: 42px;
  height: 42px;
  border: 3px solid var(--green-soft);
  border-top-color: var(--green);
  border-radius: 50%;
  animation: spin 800ms linear infinite;
}

.success-mark {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  color: var(--white);
  background: var(--green);
  font-size: 28px;
  font-weight: 800;
}

.cabinet-view {
  gap: 22px;
}

.auth-panel.leader-cabinet-layout {
  display: block;
  width: min(1180px, 100%);
}

.leader-cabinet-layout .auth-copy {
  display: none;
}

.leader-cabinet-layout .auth-card {
  min-height: 0;
  padding: clamp(20px, 3vw, 36px);
}

.status-badge {
  justify-self: start;
  padding: 7px 11px;
  border-radius: 999px;
  color: #18523b;
  background: var(--green-soft);
  font-size: 12px;
  font-weight: 800;
}

.status-badge.is-blocked {
  color: var(--warning);
  background: #fff1c8;
}

.profile-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin: 0;
}

.profile-list div {
  min-width: 0;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.profile-list dt {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.profile-list dd {
  margin: 4px 0 0;
  overflow-wrap: anywhere;
  font-weight: 700;
}

.link-box {
  display: grid;
  gap: 10px;
  padding: 18px;
  border-radius: 16px;
  background: var(--green-soft);
}

.link-box input {
  background: rgba(255, 255, 255, 0.9);
}

.leader-orders {
  display: grid;
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #f8faf9;
}

.leader-orders-heading,
.leader-order-card-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 18px;
}

.leader-orders-heading h2,
.leader-orders-heading p,
.leader-order-card p,
.leader-order-card h4 {
  margin: 0;
}

.leader-orders-heading > p,
.leader-orders-message,
.leader-order-card time,
.leader-order-totals {
  color: var(--muted);
  font-size: 13px;
}

.leader-orders-heading > p {
  max-width: 440px;
}

.leader-orders-count {
  display: inline-grid;
  min-width: 30px;
  min-height: 30px;
  place-items: center;
  margin-left: 6px;
  padding: 2px 8px;
  border-radius: 999px;
  color: var(--white);
  background: var(--green-dark);
  font-size: 14px;
  vertical-align: middle;
}

.leader-orders-message {
  min-height: 20px;
  margin: 0;
}

.leader-orders-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.leader-orders-tabs button {
  min-height: 40px;
  padding: 8px 12px;
  border: 1px solid #a8b5ae;
  border-radius: 999px;
  color: var(--ink);
  background: var(--white);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.leader-orders-tabs button[aria-selected="true"] {
  border-color: var(--green-dark);
  color: var(--white);
  background: var(--green-dark);
}

.leader-orders-tabs span {
  margin-left: 4px;
}

.leader-orders-search {
  display: grid;
  gap: 6px;
}

.leader-orders-search input {
  width: 100%;
  min-height: 44px;
  padding: 9px 11px;
  border: 1px solid #a8b5ae;
  border-radius: 9px;
  color: var(--ink);
  background: var(--white);
  font: inherit;
}

.leader-orders-list {
  display: grid;
  gap: 12px;
}

.leader-order-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.leader-order-danger {
  border: 1px solid #b33a3a;
  color: #8c2020;
  background: #fff;
}

.leader-order-card {
  display: grid;
  gap: 8px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--white);
}

.leader-order-card-heading strong {
  color: var(--green-dark);
}

.leader-order-card details {
  margin-top: 4px;
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.leader-order-card summary {
  cursor: pointer;
  color: var(--green-dark);
  font-weight: 800;
}

.leader-order-contact {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 14px 0;
}

.leader-order-contact div {
  min-width: 0;
}

.leader-order-contact dt {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.leader-order-contact dd {
  margin: 3px 0 0;
  overflow-wrap: anywhere;
}

.leader-order-items {
  display: grid;
  gap: 7px;
  margin: 7px 0 14px;
  padding: 0;
  list-style: none;
}

.leader-order-items li {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--line);
}

.leader-order-items span,
.leader-order-comment {
  color: var(--muted);
  font-size: 13px;
}

.auth-panel.leader-availability-layout {
  display: block;
  width: min(1440px, 100%);
}

.leader-availability-layout .auth-copy {
  display: none;
}

.leader-availability-layout .auth-card {
  min-height: 0;
  padding: clamp(20px, 3vw, 36px);
}

.leader-availability-view {
  display: grid;
  gap: 16px;
}

.leader-availability-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 24px;
}

.leader-availability-heading h2,
.leader-availability-heading p {
  margin: 0;
}

.leader-availability-heading p:last-child {
  max-width: 760px;
  margin-top: 8px;
  color: var(--muted);
}

.leader-availability-tools {
  display: grid;
  grid-template-columns: minmax(280px, 2fr) minmax(250px, 1fr);
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #f8faf9;
}

.leader-availability-tools label {
  display: grid;
  gap: 6px;
}

.leader-availability-tools input,
.leader-availability-tools select {
  width: 100%;
  min-height: 44px;
  padding: 9px 11px;
  border: 1px solid #a8b5ae;
  border-radius: 9px;
  color: var(--ink);
  background: var(--white);
  font: inherit;
}

.leader-availability-message {
  min-height: 44px;
  padding: 10px 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--muted);
  background: #f8faf9;
}

.leader-availability-message.is-error {
  border-color: #f0b9b9;
  color: var(--error);
  background: #fff2f2;
}

.leader-availability-table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 14px;
}

.leader-availability-table {
  width: 100%;
  min-width: 1120px;
  border-collapse: collapse;
}

.leader-availability-table th,
.leader-availability-table td {
  padding: 12px 11px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

.leader-availability-table th {
  background: #f5f8f6;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.leader-availability-table tbody tr:last-child td {
  border-bottom: 0;
}

.leader-availability-table tbody tr.is-dirty {
  background: #fff9e8;
}

.leader-availability-table input[type="checkbox"] {
  width: 20px;
  height: 20px;
  accent-color: var(--green);
}

.availability-state {
  display: inline-block;
  padding: 5px 8px;
  border-radius: 999px;
  color: #18523b;
  background: var(--green-soft);
  font-size: 11px;
  font-weight: 800;
}

.availability-state.is-off {
  color: var(--error);
  background: var(--error-soft);
}

.leader-availability-savebar {
  position: sticky;
  bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 13px 15px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 10px 28px rgba(18, 49, 39, 0.12);
}

.text-action {
  justify-self: start;
  padding: 0;
  border: 0;
  color: var(--green-dark);
  background: transparent;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 4px;
}

.honeypot {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.site-footer {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: 26px 0 34px;
  border-top: 1px solid rgba(23, 49, 41, 0.1);
  color: var(--muted);
  text-align: center;
  font-size: 12px;
}

.site-footer p {
  margin: 4px 0;
}

.noscript {
  position: fixed;
  inset: auto 16px 16px;
  z-index: 30;
  padding: 14px;
  border-radius: 10px;
  color: var(--white);
  background: var(--error);
  text-align: center;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@media (max-width: 900px) {
  .auth-panel {
    grid-template-columns: 1fr;
    gap: 30px;
    max-width: 620px;
  }

  .auth-copy {
    text-align: center;
  }

  h1,
  #pageLead {
    margin-right: auto;
    margin-left: auto;
  }

  .trust-list {
    display: none;
  }

  .leader-availability-heading {
    display: grid;
  }

  .leader-availability-tools {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  .site-header {
    width: min(100% - 28px, 1180px);
    padding: 16px 0;
  }

  .brand-mark {
    width: 44px;
    height: 44px;
    font-size: 14px;
  }

  .brand strong {
    font-size: 15px;
  }

  .secure-label {
    display: none;
  }

  .page-shell {
    min-height: auto;
    padding: 16px 14px 36px;
  }

  .auth-panel {
    gap: 22px;
  }

  h1 {
    font-size: clamp(35px, 11vw, 48px);
  }

  #pageLead {
    margin-top: 16px;
    font-size: 15px;
  }

  .auth-card {
    min-height: 0;
    padding: 22px 18px;
    border-radius: 19px;
  }

  form,
  .state-view,
  .cabinet-view {
    gap: 17px;
  }

  .profile-list,
  .button-row,
  .leader-order-contact {
    grid-template-columns: 1fr;
  }

  .leader-orders-heading,
  .leader-order-card-heading,
  .leader-order-items li {
    align-items: start;
    flex-direction: column;
  }

  .leader-availability-savebar {
    align-items: stretch;
    flex-direction: column;
  }

  .site-footer {
    width: calc(100% - 28px);
    padding-bottom: 24px;
  }
}

@media (min-width: 1500px) {
  .site-header,
  .site-footer {
    width: min(1440px, calc(100% - 80px));
  }

  .auth-panel {
    width: min(1320px, 100%);
    grid-template-columns: minmax(0, 1fr) minmax(430px, 0.72fr);
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
