:root {
  --cream-50: #fdfbf5;
  --cream-100: #f7f0e2;
  --cream-200: #efe4cd;
  --sage-100: #e6e9d6;
  --sage-200: #d3d9bd;
  --sage-300: #b7c4a0;
  --sage-500: #869268;
  --sage-600: #6d7a54;
  --sage-700: #566143;
  --sage-900: #38402c;
  --amber: #d98a3d;
  --ink: #3a3a2f;
  --white: #ffffff;
  --shadow: 0 10px 30px rgba(56, 64, 44, 0.15);
  --radius-lg: 28px;
  --radius-md: 16px;
  --serif: Georgia, 'Iowan Old Style', 'Palatino Linotype', 'Times New Roman', serif;
  --sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

/* Without this, any element that also has a class setting `display`
   (e.g. `.screen { display: flex }`) stays visually visible even when its
   `hidden` attribute is set — author styles win over the browser's default
   `[hidden] { display: none }` unless we force it here. This was silently
   breaking every hide/show toggle in the app (screens, the photo lightbox,
   error messages, ...). */
[hidden] {
  display: none !important;
}

html, body {
  height: 100%;
}

body {
  margin: 0;
  font-family: var(--sans);
  color: var(--ink);
  background: linear-gradient(160deg, var(--cream-50) 0%, var(--cream-100) 55%, var(--sage-100) 100%);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  font-family: var(--serif);
  color: var(--sage-900);
  margin: 0 0 0.4em;
  font-weight: 500;
}

p {
  margin: 0 0 1em;
  line-height: 1.55;
}

button {
  font-family: inherit;
  cursor: pointer;
}

a {
  color: var(--sage-700);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5em;
  border: none;
  border-radius: 999px;
  padding: 0.9em 1.8em;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  background: var(--sage-600);
  color: var(--cream-50);
  box-shadow: var(--shadow);
  transition: transform 0.15s ease, background 0.2s ease;
}

.btn:hover {
  background: var(--sage-700);
}

.btn:active {
  transform: scale(0.97);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.btn-outline {
  background: transparent;
  color: var(--sage-700);
  border: 2px solid var(--sage-300);
  box-shadow: none;
}

.btn-outline:hover {
  background: var(--sage-100);
}

.leaf-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6em;
  margin: 1.2em 0;
  color: var(--sage-500);
}

.leaf-divider::before,
.leaf-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--sage-300);
  max-width: 80px;
}

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

.field {
  width: 100%;
  padding: 0.9em 1.1em;
  border-radius: var(--radius-md);
  border: 2px solid var(--sage-200);
  background: var(--white);
  font-size: 1.05rem;
  color: var(--ink);
  outline: none;
  transition: border-color 0.15s ease;
}

.field:focus {
  border-color: var(--sage-500);
}

.error-text {
  color: #a4472c;
  font-size: 0.92rem;
  min-height: 1.3em;
  margin-top: 0.4em;
}

/* Shows when the server last (re)started — a quick "did my deploy take
   effect?" check without needing SSH. Deliberately subtle. */
.build-tag {
  position: fixed;
  bottom: 6px;
  right: 8px;
  margin: 0;
  font-size: 0.65rem;
  font-family: var(--sans);
  color: var(--sage-300);
  opacity: 0.75;
  z-index: 100;
  pointer-events: none;
}
