/* ---------- Global reset / base ---------- */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  line-height: 1.5;
}

body {
  margin: 0;
  background: #f5f3f0; /* warm paper-like */
  color: #191919;
}

a {
  color: #0f766e; /* teal-ish */
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

img {
  max-width: 100%;
}

/* ---------- Layout shell ---------- */

.page-content {
  max-width: 900px;
  margin: 0 auto;
  padding: 1.5rem 1rem 3rem;
}

/* ---------- Header & nav (improved mobile layout) ---------- */

.site-header {
  border-bottom: 1px solid #e2e2e2;
  background: #fdfcfb;
}

.site-header-inner {
  max-width: 900px;
  margin: 0 auto;
  padding: 0.75rem 1rem;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
}

/* Title */
.site-title a {
  font-size: 1.4rem;
  font-weight: 650;
  text-decoration: none;
  color: #111827;
  white-space: nowrap;
}

/* Navigation */
.site-nav {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.site-nav a {
  font-size: 0.95rem;
  color: #4b5563;
  text-decoration: none;
  white-space: nowrap;
}

.site-nav a:hover {
  color: #0f766e;
}

/* Logout button */
.site-logout button {
  font-size: 0.85rem;
  padding: 0.35rem 0.75rem;
  white-space: nowrap;
}

/* -------- Mobile behavior -------- */

@media (max-width: 640px) {
  .site-header-inner {
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 1rem 1rem 1.25rem;
  }

  .site-nav {
    justify-content: center;
    gap: 0.75rem 1.25rem;
  }

  .site-logout {
    width: 100%;
    display: flex;
    justify-content: center;
  }
}


/* ---------- Buttons ---------- */

button,
input[type="submit"] {
  font-family: inherit;
  border: none;
  border-radius: 999px;
  padding: 0.6rem 1.1rem;
  font-size: 0.95rem;
  cursor: pointer;
  background: #e5e7eb;
  color: #111827;
  transition: background 0.15s ease, transform 0.05s ease;
}

button:hover,
input[type="submit"]:hover {
  background: #d1d5db;
}

button:active,
input[type="submit"]:active {
  transform: translateY(1px);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 0.6rem 1.1rem;
  font-size: 0.95rem;
}

.btn-primary {
  background: #0f766e;
  color: #f9fafb;
}

.btn-primary:hover {
  background: #0d5c55;
}

.btn-secondary {
  background: #ecfdf3;
  color: #166534;
  border: 1px solid #bbf7d0;
}

.btn-secondary:hover {
  background: #dcfce7;
}

/* Full width on small screens */
@media (max-width: 640px) {
  .btn,
  button,
  input[type="submit"] {
    width: 100%;
    justify-content: center;
  }
}

/* ---------- Generic cards & sections ---------- */

.cards {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 1rem;
}

.card {
  border-radius: 1rem;
  border: 1px solid #e5e7eb;
  background: #fdfcfb;
  padding: 1rem 1.1rem;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.05);
}

.card h2 {
  margin-top: 0;
  margin-bottom: 0.4rem;
  font-size: 1.2rem;
}

.card p {
  margin: 0.25rem 0;
}

.card-actions {
  margin-top: 0.9rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.1rem 0.6rem;
  font-size: 0.75rem;
  font-weight: 500;
  background: #fee2e2;
  color: #b91c1c;
}

.badge-default {
  background: #fef3c7;
  color: #92400e;
}

.badge-role {
  background: #e0f2fe;
  color: #1d4ed8;
}

/* Cards side-by-side on larger screens */
@media (min-width: 768px) {
  .cards {
    flex-direction: row;
  }

  .card {
    flex: 1;
  }
}

/* ---------- Home page specifics ---------- */

.home-heading {
  margin-top: 0.25rem;
  margin-bottom: 0.5rem;
}

.home-subtitle {
  margin-top: 0;
  margin-bottom: 1rem;
  color: #4b5563;
  font-size: 0.95rem;
}

/* ---------- Forms & fields ---------- */

.field {
  margin-bottom: 1rem;
}

label {
  display: block;
  margin-bottom: 0.25rem;
  font-size: 0.9rem;
  font-weight: 500;
  color: #374151;
}

input[type="text"],
input[type="email"],
textarea,
select {
  width: 100%;
  padding: 0.5rem 0.6rem;
  border-radius: 0.5rem;
  border: 1px solid #d1d5db;
  font: inherit;
  background: #ffffff;
}

textarea {
  min-height: 6rem;
  resize: vertical;
}

input[type="file"] {
  font-size: 0.9rem;
}

/* ---------- Prompt / question view ---------- */

.prompt-card {
  border-radius: 1.25rem;
  border: 1px solid #e5e7eb;
  background: #fdfcfb;
  padding: 1.25rem 1.25rem 1.3rem;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.08);
}

.prompt-meta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
  font-size: 0.9rem;
  color: #6b7280;
  flex-wrap: wrap;
}

.prompt-meta-title {
  font-weight: 600;
  color: #374151;
}

.prompt-quote {
  border-left: 3px solid #0f766e;
  padding-left: 0.75rem;
  margin-bottom: 0.75rem;
  color: #374151;
}

.prompt-quote-text {
  font-size: 1rem;
  font-style: italic;
}

.prompt-quote-attrib {
  font-size: 0.85rem;
  margin-top: 0.25rem;
  color: #6b7280;
}

.prompt-question {
  margin-top: 0.5rem;
  margin-bottom: 0.9rem;
}

.prompt-question-text {
  font-size: 1.05rem;
  font-weight: 600;
  color: #111827;
}

.prompt-answer-section {
  margin-top: 1rem;
}

.prompt-answer-section h2 {
  margin-top: 0;
  margin-bottom: 0.4rem;
  font-size: 1.05rem;
}

.prompt-footer-actions {
  margin-top: 1.25rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

/* ---------- Previous responses on prompt page ---------- */

.responses-list {
  margin-top: 1.75rem;
}

.responses-list h2 {
  margin-bottom: 0.5rem;
  font-size: 1.05rem;
}

.response-card {
  border-radius: 0.75rem;
  border: 1px solid #e5e7eb;
  padding: 0.75rem 0.8rem;
  margin-bottom: 0.6rem;
  background: #f9fafb;
}

.response-card-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: #6b7280;
}

.response-card-text {
  margin-top: 0.3rem;
  white-space: pre-wrap;
  font-size: 0.95rem;
}

.response-card audio {
  margin-top: 0.4rem;
  width: 100%;
}

/* ---------- History / timeline ---------- */

.history-list {
  list-style: none;
  padding: 0;
  margin: 1rem 0;
}

.history-item {
  display: grid;
  grid-template-columns: auto 1fr;
  column-gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.waypoint-column {
  position: relative;
  padding-top: 0.3rem;
}

.waypoint-dot {
  width: 10px;
  height: 10px;
  background: #0f766e;
  border-radius: 999px;
  margin-left: 3px;
}

.waypoint-line {
  position: absolute;
  top: 10px;
  left: 7px;
  width: 2px;
  bottom: -0.75rem;
  background: #e5e7eb;
}

.history-item:last-child .waypoint-line {
  display: none;
}

.history-card {
  border-radius: 0.9rem;
  border: 1px solid #e5e7eb;
  background: #fdfcfb;
  padding: 0.7rem 0.8rem;
}

.history-card-title {
  font-size: 0.98rem;
  font-weight: 550;
  margin-bottom: 0.2rem;
}

.history-card-meta {
  font-size: 0.85rem;
  color: #6b7280;
  margin-bottom: 0.3rem;
}

/* ---------- Invite page ---------- */

.invite-card {
  max-width: 600px;
  margin: 0 auto;
}

/* ---------- Auth / login page ---------- */

.auth-page {
  max-width: 600px;
  margin: 2.5rem auto;
  padding: 1.5rem 1.25rem 1.75rem;
  border-radius: 1.25rem;
  border: 1px solid #e5e7eb;
  background: #fdfcfb;
  box-shadow: 0 2px 7px rgba(15, 23, 42, 0.08);
}

.auth-title {
  font-size: 1.7rem;
  margin-top: 0;
  margin-bottom: 0.4rem;
}

.auth-subtitle {
  margin-top: 0;
  margin-bottom: 1rem;
  color: #4b5563;
  font-size: 0.98rem;
}

.auth-list {
  padding-left: 1.25rem;
  margin-top: 0.4rem;
  margin-bottom: 1.2rem;
}

.auth-note {
  margin-top: 0.75rem;
  font-size: 0.85rem;
  color: #6b7280;
}

/* ---------- Utility ---------- */

.text-sm {
  font-size: 0.88rem;
}

.text-muted {
  color: #6b7280;
}

.mt-1 {
  margin-top: 0.25rem;
}

.mt-2 {
  margin-top: 0.5rem;
}

.mt-3 {
  margin-top: 0.75rem;
}

.mb-0 {
  margin-bottom: 0;
}
