/*
 * Small, dependency-free design system for the whole app — no CSS
 * framework, just custom properties + element-level styling so admin
 * views (tables, forms, buttons) all pick this up without per-view
 * classes. See app/views/layouts/application.html.erb for the header
 * markup this file styles.
 */

:root {
  --color-bg: #f7f5f2;
  --color-surface: #ffffff;
  --color-text: #22201d;
  --color-muted: #6b6459;
  --color-border: #e4ddd3;
  --color-primary: #b5541a;
  --color-primary-hover: #943f0f;
  --color-primary-contrast: #ffffff;
  --color-header-bg: #201a14;
  --color-header-text: #f3ede3;
  --color-header-muted: #c9bcaa;
  --color-success-bg: #e6f4ea;
  --color-success-text: #1e4620;
  --color-alert-bg: #fdecea;
  --color-alert-text: #611a15;
  --radius: 10px;
  --shadow: 0 1px 3px rgba(32, 26, 20, 0.08), 0 1px 2px rgba(32, 26, 20, 0.06);
}

* { box-sizing: border-box; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.5;
}

main {
  max-width: 960px;
  margin: 0 auto;
  padding: 32px 24px 64px;
}

h1, h2, h3 { line-height: 1.25; }
h1 { font-size: 1.75rem; margin: 0 0 20px; }
h2 { font-size: 1.25rem; margin: 32px 0 12px; }

a { color: var(--color-primary); }
a:hover { color: var(--color-primary-hover); }

/* --- Site header / nav --- */

.site-header {
  background: var(--color-header-bg);
  color: var(--color-header-text);
}

.site-header .site-header-inner {
  max-width: 960px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.site-header .brand {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--color-header-text);
  text-decoration: none;
  letter-spacing: 0.01em;
}

.site-header nav {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}

.site-header nav a {
  color: var(--color-header-muted);
  text-decoration: none;
  font-size: 0.95rem;
}

.site-header nav a:hover,
.site-header nav a.current {
  color: var(--color-header-text);
}

.site-header .account-name {
  color: var(--color-header-muted);
  font-size: 0.9rem;
}

.site-header .btn {
  padding: 6px 14px;
  font-size: 0.9rem;
}

/* --- Flash messages --- */

.flash {
  padding: 10px 14px;
  border-radius: var(--radius);
  margin-bottom: 20px;
}
.flash.notice { background: var(--color-success-bg); color: var(--color-success-text); }
.flash.alert { background: var(--color-alert-bg); color: var(--color-alert-text); }

/* --- Buttons --- */

.btn,
input[type="submit"],
button:not(.link-button),
.button_to input[type="submit"] {
  display: inline-block;
  background: var(--color-primary);
  color: var(--color-primary-contrast);
  border: none;
  border-radius: var(--radius);
  padding: 9px 18px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
}

.btn:hover,
input[type="submit"]:hover,
button:not(.link-button):hover {
  background: var(--color-primary-hover);
}

.btn.btn-secondary {
  background: transparent;
  color: var(--color-primary);
  border: 1px solid var(--color-border);
}
.btn.btn-secondary:hover { background: var(--color-surface); }

/* Every button_to renders its own <form>; keep small action buttons
   (reorder arrows, delete) from stretching to fill their row. */
form.button_to { display: inline-block; margin: 0 4px 0 0; }

/* --- Forms --- */

label { display: block; font-weight: 600; margin: 0 0 4px; font-size: 0.9rem; }

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="file"],
input[type="color"],
select,
textarea {
  display: block;
  width: 100%;
  margin-bottom: 16px;
  padding: 9px 10px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-surface);
  color: var(--color-text);
  font-size: 0.95rem;
  font-family: inherit;
}

input[type="color"] { padding: 4px; height: 42px; }

input:focus, select:focus, textarea:focus {
  outline: 2px solid var(--color-primary);
  outline-offset: 1px;
}

/* --- Cards / surfaces --- */

.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px 24px;
  margin-bottom: 24px;
}

.menu-section { margin-bottom: 28px; }

/* --- Tables --- */

table {
  width: 100%;
  border-collapse: collapse;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
}
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--color-border); }
th { color: var(--color-muted); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.04em; }
tr:last-child td { border-bottom: none; }

img.thumb { height: 60px; border-radius: 4px; }

code {
  background: #f4f0ea;
  padding: 2px 6px;
  border-radius: 4px;
  word-break: break-all;
  font-size: 0.9em;
}

.muted { color: var(--color-muted); }
.asterisk-note { color: var(--color-muted); font-size: 0.85rem; }

/* --- Landing page --- */

.hero { text-align: center; padding: 40px 0 8px; }
.hero h1 { font-size: 2.25rem; margin: 0 0 16px; }
.hero-sub {
  max-width: 620px;
  margin: 0 auto 28px;
  color: var(--color-muted);
  font-size: 1.05rem;
}
.hero-cta { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; }

.pitch-quote {
  max-width: 720px;
  margin: 40px auto;
  font-size: 1.05rem;
  font-style: italic;
  color: var(--color-text);
}
.pitch-quote p { margin: 0; }

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin: 40px 0;
}
.feature-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 20px;
}
.feature-card h3 { margin: 0 0 8px; font-size: 1.05rem; }
.feature-card p { margin: 0; font-size: 0.9rem; }

.hero-cta-footer {
  text-align: center;
  padding: 40px 0 8px;
  border-top: 1px solid var(--color-border);
}
.hero-cta-footer h2 { margin: 0 0 16px; }
