:root {
  --bg: #f4f8f5;
  --panel: #ffffff;
  --text: #10231a;
  --muted: #6d7b72;
  --line: #dce7df;
  --green: #008060;
  --green-dark: #005d46;
  --danger: #a13d3d;
  --radius: 8px;
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background: var(--bg);
  color: var(--text);
}

body {
  overflow-x: hidden;
}

a,
button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.auth-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  gap: 20px;
  padding: 28px 16px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: inherit;
  text-decoration: none;
}

.brand img {
  width: 38px;
  height: 38px;
}

.brand strong,
.brand em {
  display: block;
}

.brand strong {
  font-size: 17px;
  line-height: 1.1;
}

.brand em {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.auth-card {
  width: min(100%, 430px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: 0 18px 42px rgba(16, 35, 26, 0.08);
  padding: 22px;
}

.auth-footer {
  width: min(100%, 430px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  color: var(--muted);
  font-size: 13px;
}

.auth-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.auth-footer a {
  color: #4c5e56;
  font-weight: 700;
  text-decoration: none;
}

.auth-heading h1 {
  margin: 0;
  color: #193328;
  font-size: 26px;
  line-height: 1.1;
}

.auth-heading p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.mode-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin: 18px 0;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f7faf7;
}

.mode-tabs button {
  min-height: 34px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

.mode-tabs button.active {
  background: #fff;
  color: var(--green-dark);
  box-shadow: 0 1px 4px rgba(16, 35, 26, 0.08);
}

.auth-form {
  display: grid;
  gap: 12px;
}

.field {
  display: grid;
  gap: 6px;
}

.field span {
  color: #4c5e56;
  font-size: 12px;
  font-weight: 750;
}

.field input {
  width: 100%;
  min-height: 42px;
  border: 1px solid #cfe2d6;
  border-radius: var(--radius);
  background: #fff;
  color: var(--text);
  padding: 0 11px;
  outline: none;
}

.field input:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(0, 128, 96, 0.12);
}

.primary-button,
.ghost-button {
  min-height: 40px;
  border-radius: var(--radius);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 13px;
  font-size: 14px;
  font-weight: 750;
}

.primary-button {
  border: 1px solid var(--green);
  background: var(--green);
  color: #fff;
}

.ghost-button {
  border: 1px solid #cfe2d6;
  background: #f1faf4;
  color: var(--green-dark);
}

.button-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.text-button {
  border: 0;
  background: transparent;
  color: var(--green-dark);
  font-size: 13px;
  font-weight: 750;
  padding: 4px 0;
}

.auth-message {
  margin: 14px 0 0;
  border: 1px solid #cfe2d6;
  border-radius: var(--radius);
  background: #f1faf4;
  color: #204c3b;
  padding: 10px 12px;
  font-size: 13px;
  line-height: 1.45;
}

.auth-message.error {
  border-color: #ead1d1;
  background: #fff7f7;
  color: var(--danger);
}

.extension-code {
  display: grid;
  gap: 8px;
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f7faf7;
  padding: 12px;
}

.extension-code span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.extension-code strong {
  color: #193328;
  font-size: 28px;
  letter-spacing: 0.12em;
  line-height: 1;
}

.turnstile-slot {
  min-height: 0;
  margin-top: 12px;
}

.hidden {
  display: none !important;
}

@media (max-width: 520px) {
  .auth-shell {
    place-items: start center;
    padding-top: 20px;
  }

  .auth-card {
    padding: 18px;
  }

  .auth-footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .auth-heading h1 {
    font-size: 23px;
  }
}
