:root {
  color-scheme: light;
  --bg: #f6f5f2;
  --bg-accent: #ece9e3;
  --panel: rgba(255, 255, 255, 0.94);
  --panel-strong: #ffffff;
  --text: #1f1f1d;
  --muted: #6f6b66;
  --line: rgba(55, 53, 47, 0.12);
  --primary: #1f1f1d;
  --primary-strong: #0f0f0e;
  --secondary: #6f6b66;
  --shadow: 0 10px 28px rgba(15, 15, 15, 0.04);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: Inter, "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--text);
  line-height: 1.5;
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.72), transparent 34%),
    radial-gradient(circle at top right, rgba(31, 31, 29, 0.05), transparent 24%),
    linear-gradient(180deg, var(--bg) 0%, #f2efea 100%);
}

button,
input,
textarea {
  font: inherit;
}

.shell {
  width: min(1220px, calc(100% - 28px));
  margin: 0 auto;
  padding: 28px 0 40px;
}

.hero {
  display: grid;
  grid-template-columns: repeat(2, minmax(300px, 1fr));
  gap: 20px;
  align-items: stretch;
  margin-bottom: 20px;
}

.site-title {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.example-toggle-wrap {
  width: auto;
  flex: 0 0 auto;
  min-width: 0;
  max-width: 100%;
  text-align: right;
  padding: 10px 12px;
  border: 1px solid rgba(55, 53, 47, 0.08);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(12px);
}

.example-toggle-wrap label {
  margin-bottom: 6px;
  font-size: 0.82rem;
  color: var(--muted);
  font-weight: 600;
}

.example-toggle-row {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.example-toggle-row span {
  font-size: 0.8rem;
  color: var(--secondary);
}

.switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.switch-slider {
  position: absolute;
  inset: 0;
  cursor: pointer;
  background: #d8d3ca;
  border-radius: 24px;
  transition: background 0.2s ease;
}

.switch-slider::before {
  content: '';
  position: absolute;
  height: 18px;
  width: 18px;
  left: 3px;
  top: 3px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
  transition: transform 0.2s ease;
}

.switch input:checked + .switch-slider {
  background: #6f6b66;
}

.switch input:checked + .switch-slider::before {
  transform: translateX(20px);
}

.example-toggle-label {
  margin: 6px 0 0;
  font-size: 0.86rem;
  color: var(--secondary);
}

/* Make the two header cards share the same size and layout */
.hero > .hero-card,
.hero > .setup-panel {
  display: flex;
  flex-direction: column;
  min-height: 270px;
}

.hero > .hero-card .actions,
.hero > .setup-panel .actions {
  margin-top: auto;
}

.eyebrow {
  margin: 0 0 10px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.72rem;
  color: var(--secondary);
}

h1,
h2,
h3,
h4,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 12px;
  font-size: clamp(2.1rem, 3.7vw, 4.2rem);
  line-height: 0.96;
  letter-spacing: -0.04em;
  max-width: 11ch;
}

.lede {
  max-width: 66ch;
  margin-bottom: 0;
  font-size: 1rem;
  line-height: 1.6;
  color: var(--muted);
}

.hero-card,
.panel {
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--panel);
  backdrop-filter: blur(14px);
  box-shadow: 0 14px 38px rgba(15, 15, 15, 0.06);
}

.hero-card {
  padding: 20px;
}

label {
  display: block;
  margin-bottom: 8px;
  font-size: 0.92rem;
  font-weight: 700;
  line-height: 1.25;
}

input[type="text"],
input[type="number"],
textarea,
select,
input[type="text"] {
  width: 100%;
  border: 1px solid rgba(63, 49, 39, 0.18);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--text);
  padding: 12px 14px;
  outline: none;
  line-height: 1.45;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

input[type="text"]:focus,
input[type="number"]:focus,
select:focus,
textarea:focus {
  border-color: rgba(31, 78, 95, 0.55);
  box-shadow: 0 0 0 4px rgba(31, 78, 95, 0.12);
}

select {
  padding: 11px 12px;
}

textarea {
  resize: vertical;
  min-height: 180px;
  line-height: 1.55;
}

/* Keep setup fields visually aligned in size */
#meetingTitle,
#attendeesInput,
#agendaInput {
  width: 100%;
}

#attendeesInput,
#agendaInput {
  min-height: 220px;
  resize: none;
  overflow-y: hidden;
}

#meetingTitle {
  min-height: 52px;
}

.primary,
.secondary,
.ghost,
.mini {
  border: 0;
  border-radius: 12px;
  padding: 11px 14px;
  cursor: pointer;
  line-height: 1.1;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.primary:hover,
.secondary:hover,
.ghost:hover,
.mini:hover {
  transform: translateY(-1px);
}

.primary {
  width: 100%;
  margin-top: 14px;
  background: var(--primary);
  color: #fff;
  box-shadow: 0 10px 20px rgba(15, 15, 15, 0.12);
}

.primary:hover {
  background: var(--primary-strong);
}

.secondary {
  background: rgba(55, 53, 47, 0.08);
  color: var(--secondary);
}

.ghost {
  background: rgba(255, 255, 255, 0.64);
  color: var(--text);
  border: 1px solid var(--line);
}

.mini {
  background: rgba(55, 53, 47, 0.06);
  color: var(--text);
  padding: 9px 12px;
  font-size: 0.88rem;
}

.layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
  align-items: start;
}

.panel {
  padding: 22px;
}

.panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.panel-header h2 {
  margin-bottom: 0;
  font-size: 1.3rem;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.actions {
  display: flex;
  gap: 10px;
  margin-top: 14px;
  flex-wrap: wrap;
}

.note {
  margin-bottom: 0;
  margin-top: 18px;
  font-size: 0.94rem;
  line-height: 1.55;
  color: var(--muted);
}

.minutes-sheet {
  min-height: 560px;
  padding: 4px;
}

.empty-state {
  min-height: 520px;
  display: grid;
  place-content: center;
  text-align: center;
  border: 1px dashed rgba(55, 53, 47, 0.16);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.7);
  color: var(--muted);
}

.minutes-title {
  margin: 0 0 14px;
  font-size: 1.8rem;
  line-height: 1.08;
  letter-spacing: -0.03em;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.meeting-meta {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.meta-label,
.entry-kicker {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.7rem;
  color: var(--secondary);
}

.meta-value {
  margin: 0;
  white-space: pre-wrap;
  line-height: 1.55;
  color: var(--text);
}

.agenda-item {
  padding: 18px;
  margin-bottom: 16px;
  border: 1px solid rgba(55, 53, 47, 0.12);
  border-radius: 20px;
  background: var(--panel-strong);
}

.agenda-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 14px;
}

.item-label {
  margin-bottom: 4px;
  color: var(--secondary);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.72rem;
}

.item-title {
  margin-bottom: 0;
  font-size: 1.12rem;
  line-height: 1.18;
  letter-spacing: -0.02em;
}

.item-controls {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.entry-columns {
  margin-bottom: 14px;
}

.discussion-notes {
  min-height: 140px;
}

.entry-block h4 {
  margin-bottom: 10px;
  font-size: 0.95rem;
}

.entries {
  display: grid;
  gap: 10px;
}

.motion-entry {
  border: 1px solid rgba(55, 53, 47, 0.1);
  border-radius: 18px;
  padding: 15px;
  background: rgba(250, 249, 247, 0.98);
}

.motion-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.motion-head textarea {
  min-height: 90px;
  margin-top: 6px;
}

.motion-head .mini {
  flex: 0 0 auto;
}

.motion-amendments {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.motion-amendments h5 {
  margin: 0 0 10px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--muted);
  line-height: 1.2;
}

.amendment-entry {
  padding: 12px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(55, 53, 47, 0.08);
}

.amendment-entry textarea {
  min-height: 72px;
  margin-bottom: 10px;
}

.entry-meta {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: center;
}

.entry-meta span {
  font-size: 0.9rem;
  color: var(--muted);
}

.entry-meta input {
  padding: 10px 12px;
  border-radius: 10px;
}

.vote-panel {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 12px 0;
}

.vote-field {
  display: grid;
  gap: 6px;
}

.vote-field span {
  font-size: 0.84rem;
  color: var(--muted);
  line-height: 1.2;
}

.vote-field input {
  padding: 10px 12px;
  border-radius: 10px;
}

.vote-outcome select {
  padding: 10px 12px;
  border-radius: 10px;
  font-weight: 600;
}

.vote-outcome select.outcome-pending {
  background: #f5f3ef;
  color: #6f6b66;
  border-color: rgba(55, 53, 47, 0.2);
}

.vote-outcome select.outcome-passed {
  background: #e7f5ea;
  color: #1f6b39;
  border-color: rgba(31, 107, 57, 0.35);
}

.vote-outcome select.outcome-rejected {
  background: #fdecec;
  color: #8f2c2c;
  border-color: rgba(143, 44, 44, 0.35);
}

@media (max-width: 980px) {
  .site-title {
    flex-direction: column;
    align-items: flex-start;
  }

  .example-toggle-wrap {
    text-align: left;
    width: min(320px, 100%);
  }

  .hero,
  .layout,
  .vote-panel,
  .motion-head {
    grid-template-columns: 1fr;
  }

  .hero {
    gap: 16px;
  }

  .panel,
  .hero-card {
    padding: 18px;
  }

  .hero {
    align-items: stretch;
  }

  .minutes-sheet {
    min-height: auto;
  }
}

@media (max-width: 640px) {
  .shell {
    width: min(100% - 16px, 1220px);
    padding: 16px 0 24px;
  }

  h1 {
    font-size: clamp(1.8rem, 8vw, 2.7rem);
  }

  .site-title {
    gap: 12px;
  }

  .example-toggle-wrap {
    width: 100%;
    max-width: none;
  }

  .panel-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .panel-header .ghost {
    align-self: flex-start;
  }
}

@media print {
  body {
    background: #fff;
  }

  .shell {
    width: 100%;
    padding: 0;
  }

  .hero-card,
  .setup-panel,
  .panel-header .ghost,
  .actions,
  #loadExample,
  #buildTemplate {
    display: none !important;
  }

  .layout {
    grid-template-columns: 1fr;
  }

  .preview-panel {
    border: 0;
    box-shadow: none;
    background: #fff;
    padding: 0;
  }

  .agenda-item {
    break-inside: avoid;
    border-color: #bbb;
  }
}

/* --- Add everything below to the end of your existing styles.css --- */

/* Hides the whole app instantly while auth.js checks the password, no flash of content. */
html.locked .shell {
  display: none;
}

.auth-gate {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f6f5f2;
  z-index: 1000;
  padding: 24px;
}

.auth-card {
  background: #ffffff;
  border-radius: 12px;
  padding: 32px;
  max-width: 360px;
  width: 100%;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
  text-align: center;
}

.auth-card h2 {
  margin: 0 0 8px;
}

.auth-card p {
  margin: 0 0 16px;
  color: #666;
}

.auth-card input[type="password"] {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #ddd;
  border-radius: 8px;
  margin-bottom: 12px;
  font-size: 1rem;
  box-sizing: border-box;
}

.auth-card button.primary {
  width: 100%;
}

.auth-error {
  color: #c0392b;
  margin-top: 12px;
  margin-bottom: 0;
  font-size: 0.9rem;
}

/* Small subtitle under the main title ("Fortes" / "Pura Vida") and the link to switch pages. */
.page-subtitle {
  margin: 0;
  font-weight: 600;
  opacity: 0.7;
}

.page-switch-link {
  display: inline-block;
  margin-top: 4px;
  font-size: 0.85rem;
}

/* --- You can now remove any old .example-toggle-wrap / .switch / .switch-slider rules --- */
/* --- from your existing styles.css, since the toggle markup no longer exists.        --- */