* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

[hidden] {
  display: none !important;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  background: var(--cream);
  color: var(--brown);
  font-family: var(--font-sans);
  font-size: var(--text-md);
  line-height: 1.7;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main {
  flex: 1;
  width: min(760px, 92%);
  margin: 0 auto;
  outline: none;
}

h1, h2, h3 {
  font-family: var(--font-serif);
  font-weight: 500;
  line-height: 1.25;
}

.muted {
  color: var(--muted);
}

.eyebrow {
  color: var(--accent);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.fine {
  color: var(--muted);
  font-size: var(--text-xs);
}

/* Accessibility */
.skip-link {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 100;
  background: var(--brown);
  color: #fff;
  padding: 10px 16px;
  border-radius: 8px;
  text-decoration: none;
  transition: top 0.2s;
}

.skip-link:focus {
  top: 12px;
}

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

/* Buttons */
.btn {
  min-height: var(--tap);
  padding: 0 20px;
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  font: inherit;
  font-size: var(--text-sm);
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s, opacity 0.2s;
}

.btn-primary {
  background: var(--brown);
  color: #fff;
}

.btn-primary:hover:not(:disabled) {
  background: var(--accent);
}

.btn-quiet {
  background: transparent;
  color: var(--brown);
  border-color: var(--line);
  padding: 0 14px;
}

.btn-quiet:hover {
  background: var(--paper);
  border-color: var(--accent-soft);
}

.btn-block {
  width: 100%;
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn[aria-busy="true"] {
  cursor: progress;
}

/* Forms */
.field {
  margin-bottom: 18px;
}

label {
  display: block;
  font-size: var(--text-sm);
  font-weight: 600;
  margin-bottom: 6px;
}

input[type="text"],
input[type="password"] {
  width: 100%;
  min-height: var(--tap);
  padding: 0 14px;
  font: inherit;
  color: var(--brown);
  background: var(--cream);
  border: 1px solid var(--line);
  border-radius: 10px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

input:focus-visible {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(140, 99, 67, 0.25);
}

input[aria-invalid="true"] {
  border-color: var(--danger);
}

input[readonly] {
  opacity: 0.7;
}

.field-error,
.form-error {
  color: var(--danger);
  font-size: var(--text-xs);
  min-height: 0;
}

.field-error:not(:empty) {
  margin-top: 6px;
}

.form-error {
  margin-bottom: 14px;
  font-size: var(--text-sm);
}