:root {
  color-scheme: light;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --green: #7f946f;
  --green-dark: #617653;
  --green-soft: #edf2e9;
  --red: #c71f31;
  --red-dark: #a91829;
  --cream: #f1e6a8;
  --ink: #2e332c;
  --muted: #6f766c;
  --line: #d8dfd4;
  --paper: #fff;
  --page: #f3f6f0;
  --danger: #a81d2c;
  --success: #527147;
}

* { box-sizing: border-box; }
html { min-height: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 80% 12%, rgba(241,230,168,.45), transparent 24rem),
    linear-gradient(145deg, #f8faf6 0%, var(--page) 100%);
}

button, input { font: inherit; }
a { color: var(--green-dark); }
a:hover { color: var(--red); }

.shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 36px 18px;
}

.card {
  width: min(480px, 100%);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 30px;
  box-shadow: 0 22px 60px rgba(74,56,40,.12);
}

.brand {
  display: flex;
  align-items: center;
  gap: 18px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--line);
}

.logo {
  width: 122px;
  max-height: 78px;
  object-fit: contain;
  object-position: left center;
}

.eyebrow {
  margin: 0 0 3px;
  color: var(--red);
  font-size: .85rem;
  font-weight: 750;
  letter-spacing: .02em;
}

h1 {
  margin: 0;
  color: var(--green-dark);
  font-size: 1.75rem;
  line-height: 1.1;
}

.intro {
  margin: 22px 0;
  color: var(--muted);
  line-height: 1.55;
}

.tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin: 0 -30px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: #f3f5f1;
}

.tab {
  appearance: none;
  border: 0;
  border-bottom: 4px solid transparent;
  background: transparent;
  padding: 16px 12px 12px;
  color: var(--muted);
  font-weight: 750;
  cursor: pointer;
}

.tab.active {
  color: var(--green-dark);
  background: var(--paper);
  border-bottom-color: var(--red);
}

.panel { padding-top: 10px; }
.hidden { display: none !important; }

label {
  display: block;
  margin: 16px 0 7px;
  font-weight: 700;
  color: #41483f;
}

input {
  width: 100%;
  padding: 12px 13px;
  border: 1px solid #cbd5c6;
  border-radius: 9px;
  background: #fff;
  color: var(--ink);
  outline: none;
}

input:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 4px rgba(127,148,111,.18);
}

.field-hint {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: .84rem;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

button, .button-link {
  width: 100%;
  min-height: 46px;
  margin-top: 20px;
  border: 0;
  border-radius: 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 11px 16px;
  background: var(--green-dark);
  color: #fff;
  font-weight: 750;
  text-decoration: none;
  cursor: pointer;
}

button:hover, .button-link:hover { background: var(--green); color: #fff; }
button.secondary { background: var(--red); }
button.secondary:hover { background: var(--red-dark); }
button:disabled { opacity: .55; cursor: not-allowed; }

.notice {
  margin-top: 18px;
  padding: 16px;
  border-radius: 12px;
  background: var(--green-soft);
  line-height: 1.5;
}
.notice p { margin: 7px 0 0; }
.notice.success { border-left: 4px solid var(--success); }

.status {
  margin-top: 18px;
  padding: 12px 13px;
  border-radius: 9px;
  background: #f6f7f4;
  line-height: 1.45;
  white-space: pre-wrap;
}
.status.ok { border-left: 4px solid var(--success); background: #f1f6ee; }
.status.err { border-left: 4px solid var(--danger); background: #fff1f2; color: #6d1621; }

.help {
  margin-top: 26px;
  padding: 16px;
  border-radius: 12px;
  background: #f7f8f5;
  text-align: center;
  font-size: .92rem;
}
.help p { margin: 0 0 5px; color: var(--muted); }
.help a { font-weight: 700; text-decoration: none; }

footer {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 20px;
  color: var(--muted);
  font-size: .85rem;
}
footer a { text-decoration: none; }
footer a:hover { text-decoration: underline; }

@media (max-width: 520px) {
  .shell { padding: 18px 12px; align-items: start; }
  .card { padding: 22px 18px; border-radius: 16px; }
  .tabs { margin-left: -18px; margin-right: -18px; }
  .brand { gap: 12px; }
  .logo { width: 102px; max-height: 66px; }
  h1 { font-size: 1.55rem; }
}

.access-box {
  margin-top: 26px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fafbf9;
  text-align: center;
}
.access-kicker {
  margin: 0 0 4px;
  color: var(--red);
  font-size: .78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .06em;
}
.access-box h2 {
  margin: 0;
  color: var(--green-dark);
  font-size: 1rem;
}
.access-primary {
  margin-top: 14px;
}
.secondary-links {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin-top: 13px;
  font-size: .82rem;
}
.secondary-links a {
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.secondary-links a:hover { color: var(--red); }
.success-links { margin-top: 14px; }

.password-meter { margin-top: 10px; }
.meter-track {
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: #e7ebe4;
}
.meter-track span {
  display: block;
  width: 0;
  height: 100%;
  background: var(--red);
  transition: width .2s ease, background .2s ease;
}
.meter-track span[data-score="3"],
.meter-track span[data-score="4"] { background: #c08b24; }
.meter-track span[data-score="5"] { background: var(--green-dark); }
.meter-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 6px;
  color: var(--muted);
  font-size: .82rem;
}
.meter-row strong { color: var(--ink); }
.password-rules {
  margin: 11px 0 2px;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: .82rem;
}
.password-rules li::before {
  content: '○';
  display: inline-block;
  width: 1.25rem;
  color: #9aa194;
  font-weight: 800;
}
.password-rules li.passed { color: var(--green-dark); }
.password-rules li.passed::before { content: '✓'; color: var(--success); }
