:root {
  --bg: #f4f6f3;
  --surface: #ffffff;
  --ink: #17242a;
  --muted: #65717a;
  --line: #dce2de;
  --accent: #007f73;
  --accent-strong: #00645c;
  --coral: #d96c3f;
  --shadow: 0 20px 44px rgba(23, 36, 42, 0.12);
  --radius: 8px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  background: linear-gradient(180deg, #f4f6f3 0%, #e9eee9 100%);
  color: var(--ink);
  padding: 18px;
  overflow-x: hidden;
}

.login {
  width: 100%;
  max-width: 420px;
  background: var(--surface);
  border: 1px solid rgba(23, 36, 42, 0.08);
  box-shadow: var(--shadow);
}

.accent-line {
  height: 4px;
  background: linear-gradient(90deg, var(--accent) 0%, #f3b23f 52%, var(--coral) 100%);
}

header {
  padding: 24px 22px 16px;
  border-bottom: 1px solid var(--line);
}

.login-brand {
  display: block;
  color: inherit;
  text-decoration: none;
}

.login-brand:focus-visible {
  outline: 3px solid rgba(0, 127, 115, 0.24);
  outline-offset: 4px;
  border-radius: var(--radius);
}

.login-logo {
  width: min(240px, 100%);
  max-height: 74px;
  display: block;
  object-fit: contain;
  object-position: left center;
  margin: 0 0 14px;
}

.login-logo[hidden] {
  display: none;
}

.kicker {
  margin: 0 0 5px;
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: 24px;
  line-height: 1.15;
  letter-spacing: 0;
}

form {
  display: grid;
  gap: 14px;
  padding: 22px;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

input {
  width: 100%;
  min-height: 50px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 11px 12px;
  color: var(--ink);
  font: inherit;
  font-size: 16px;
  outline: none;
}

input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0, 127, 115, 0.14);
}

button {
  min-height: 52px;
  border: 0;
  border-radius: var(--radius);
  background: var(--accent);
  color: #fff;
  padding: 10px 14px;
  font: inherit;
  line-height: 1.2;
  font-weight: 900;
  white-space: normal;
  overflow-wrap: anywhere;
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.72;
}

.secondary-button,
.link-button {
  min-height: auto;
  padding: 0;
  background: transparent;
  color: var(--accent-strong);
  font-weight: 800;
  text-align: left;
}

.secondary-button {
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  color: var(--ink);
  text-align: center;
}

button:focus-visible {
  outline: 3px solid rgba(0, 127, 115, 0.22);
  outline-offset: 2px;
}

.form-actions {
  display: grid;
  gap: 10px;
}

.turnstile-panel {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f7faf9;
}

.turnstile-panel[hidden] {
  display: none;
}

.turnstile-title {
  margin: 0;
  color: var(--ink);
  font-weight: 800;
}

.turnstile-status {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.turnstile-status[data-tone="success"] { color: #087f5b; }
.turnstile-status[data-tone="warning"] { color: #9a6700; }
.turnstile-status[data-tone="error"] { color: #b42318; }

.turnstile-widget {
  width: 100%;
  min-height: 65px;
  overflow: hidden;
}

.turnstile-retry {
  justify-self: start;
  width: auto;
  min-height: 42px;
  padding: 9px 14px;
}

.hint {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.error {
  display: none;
  padding: 10px 12px;
  border: 1px solid #f0c4b4;
  background: #fff1ec;
  color: #9a3d22;
  border-radius: var(--radius);
  font-size: 13px;
  line-height: 1.35;
}

.error.show {
  display: block;
}

.success {
  display: none;
  padding: 10px 12px;
  border: 1px solid #b8dfd3;
  background: #eef9f5;
  color: #075c4c;
  border-radius: var(--radius);
  font-size: 13px;
  line-height: 1.35;
}

.success.show {
  display: block;
}

.system-footer {
  padding: 12px 18px 14px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
  text-align: center;
}

.system-footer a {
  color: var(--accent-strong);
  font-weight: 800;
  text-decoration: none;
}

.system-footer a:hover,
.system-footer a:focus-visible {
  text-decoration: underline;
}

[hidden] {
  display: none !important;
}

@media (max-width: 520px) {
  body {
    display: block;
    padding: max(12px, env(safe-area-inset-top)) 12px max(16px, env(safe-area-inset-bottom));
  }

  .login {
    max-width: none;
    margin: 0 auto;
    box-shadow: 0 12px 26px rgba(23, 36, 42, 0.1);
  }

  header {
    padding: 22px 18px 14px;
  }

  form {
    padding: 18px;
  }

  h1 {
    font-size: 34px;
  }
}
