:root {
  --navy: #143961;
  --green: #9bc32c;
  --green-dark: #86aa22;
  --text: #1f2933;
  --muted: #6b7680;
  --line: #d5d9dd;
  --field: #f9f9f9;
  --error: #b3261e;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.45;
  color: var(--text);
  background: #fff;
}

[hidden] { display: none !important; }

.top {
  position: relative;
  background: var(--navy);
  text-align: center;
  padding: 14px 16px 10px;
}
.brand img { display: inline-block; max-width: 60vw; height: auto; vertical-align: middle; }

.lang {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, .5);
  border-radius: 4px;
  padding: 4px 10px;
  font-size: 13px;
  cursor: pointer;
}
.lang:hover { background: rgba(255, 255, 255, .12); }

main {
  max-width: 640px;
  margin: 0 auto;
  padding: 48px 16px 64px;
}

h1 {
  font-family: Georgia, "Times New Roman", serif;
  font-weight: normal;
  font-size: 24px;
  line-height: 1.2;
  text-align: center;
  margin: 0 0 8px;
}

.lead {
  font-family: Georgia, "Times New Roman", serif;
  color: var(--muted);
  text-align: center;
  margin: 0 0 24px;
}

.muted { color: var(--muted); }
.center { text-align: center; }
.right { text-align: right; margin: 6px 0 16px; }

textarea, input[type="text"], input[type="password"], select {
  width: 100%;
  font: inherit;
  color: var(--text);
  background: var(--field);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 10px;
}
textarea {
  resize: vertical;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 15px;
}
textarea:focus, input:focus, select:focus, button:focus-visible {
  outline: 2px solid var(--navy);
  outline-offset: 1px;
}

fieldset {
  border: 1px solid var(--line);
  border-radius: 4px;
  margin: 0 0 16px;
  padding: 12px 16px 16px;
}
legend {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  padding: 0 6px;
}

.row {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 12px;
  align-items: center;
  margin-top: 12px;
}
.row label { color: var(--muted); text-align: right; }
form > .row { margin: 0 0 16px; }

button { font: inherit; cursor: pointer; }
button:disabled { opacity: .6; cursor: default; }

.primary, .secondary {
  border-radius: 4px;
  padding: 12px 16px;
}
.primary {
  display: block;
  width: 100%;
  background: var(--green);
  border: 1px solid var(--green-dark);
  color: var(--navy);
  font-size: 18px;
  font-weight: 700;
}
.primary:hover:not(:disabled) { background: var(--green-dark); }
.secondary {
  background: #f3f4f5;
  border: 1px solid var(--line);
  color: var(--text);
  white-space: nowrap;
}
.secondary:hover { background: #e8eaec; }
.wide { display: block; width: 100%; margin-top: 24px; }

.link {
  background: none;
  border: 0;
  padding: 0;
  color: var(--navy);
  text-decoration: underline;
  font-size: 14px;
}

.copyrow { display: flex; gap: 8px; }
.copyrow input { flex: 1; min-width: 0; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 14px; }

#view-revealed textarea { margin-bottom: 16px; }

.note {
  font-family: Georgia, "Times New Roman", serif;
  font-style: italic;
  color: var(--muted);
  text-align: center;
  margin: 20px 0 0;
}

.error {
  border: 1px solid var(--error);
  border-radius: 4px;
  background: #fdecea;
  color: var(--error);
  padding: 10px 12px;
  margin: 0 0 24px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

@media (max-width: 520px) {
  main { padding-top: 28px; }
  .row { grid-template-columns: 1fr; gap: 4px; }
  .row label { text-align: left; }
  .lang { right: 8px; }
}