/* Book Viewer — shared styles
   A calm, paper-inspired reading environment. */

:root {
  --bg: #f5f1ea;
  --bg-card: #fdfbf6;
  --ink: #1a1714;
  --ink-soft: #5a5048;
  --ink-faint: #9a8f83;
  --accent: #8b3a2f;
  --accent-soft: #c2604f;
  --line: rgba(26, 23, 20, 0.12);
  --shadow: 0 1px 2px rgba(26, 23, 20, 0.04),
            0 8px 24px rgba(26, 23, 20, 0.08);
  --radius: 4px;
  --serif: 'Cormorant Garamond', 'Georgia', serif;
  --sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

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

html, body {
  height: 100%;
}

body {
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3 {
  font-family: var(--serif);
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--ink);
}

h1 { font-size: 2.25rem; line-height: 1.15; }
h2 { font-size: 1.5rem; line-height: 1.2; }

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-soft); text-decoration: underline; }

button {
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 500;
  padding: 0.7rem 1.4rem;
  background: var(--ink);
  color: var(--bg-card);
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.15s, transform 0.05s;
}
button:hover { background: #2d2823; }
button:active { transform: translateY(1px); }
button:disabled {
  background: var(--ink-faint);
  cursor: not-allowed;
}
button.ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
}
button.ghost:hover { background: rgba(26, 23, 20, 0.04); }

input[type="email"],
input[type="password"],
input[type="text"] {
  width: 100%;
  padding: 0.7rem 0.9rem;
  font-family: inherit;
  font-size: 0.95rem;
  color: var(--ink);
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: border-color 0.15s;
}
input:focus {
  outline: none;
  border-color: var(--accent);
}

label {
  display: block;
  font-size: 0.85rem;
  color: var(--ink-soft);
  margin-bottom: 0.4rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.card {
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 2.5rem;
}

.center-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
}

.form-stack > * + * {
  margin-top: 1.25rem;
}

.muted {
  color: var(--ink-soft);
  font-size: 0.9rem;
}

.error {
  background: rgba(139, 58, 47, 0.08);
  color: var(--accent);
  padding: 0.7rem 0.9rem;
  border-radius: var(--radius);
  font-size: 0.9rem;
  border-left: 3px solid var(--accent);
}

.success {
  background: rgba(46, 125, 50, 0.08);
  color: #2e7d32;
  padding: 0.7rem 0.9rem;
  border-radius: var(--radius);
  font-size: 0.9rem;
  border-left: 3px solid #2e7d32;
}

.hidden { display: none !important; }
