/* riff-base.css — Shared design system for Riff-generated apps */
/* Link once, override --primary-* in a <style> block per app */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,300;0,9..144,500;0,9..144,700;1,9..144,400&family=DM+Sans:wght@300;400;500&display=swap');

/* ─── Theme tokens ─── */
:root {
  --primary:       #25D366;
  --primary-dark:  #128C7E;
  --primary-light: #DCF8C6;
  --primary-pale:  #f0faf4;
  --bg:            #FFFEF9;
  --bg-alt:        #F5F0E8;
  --text:          #1a1a1a;
  --text-muted:    #555;
  --text-light:    #999;
  --shadow-sm:     0 1px 4px rgba(0,0,0,0.08);
  --shadow-md:     0 4px 18px rgba(0,0,0,0.10);
  --shadow-lg:     0 8px 40px rgba(0,0,0,0.13);
  --radius-sm:     9px;
  --radius-md:     14px;
  --radius-lg:     20px;
  --radius-full:   100px;
}

/* ─── Reset + base ─── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'DM Sans', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ─── Typography ─── */
h1, h2, h3, h4 { font-family: 'Fraunces', serif; letter-spacing: -0.03em; line-height: 1.1; }
h1 { font-size: clamp(2rem, 4.4vw, 3.2rem); font-weight: 700; margin-bottom: 18px; }
h2 { font-size: clamp(1.6rem, 3.2vw, 2.4rem); font-weight: 700; margin-bottom: 14px; }
h3 { font-size: 1.1rem; font-weight: 500; margin-bottom: 7px; letter-spacing: -0.02em; }
h4 { font-size: 0.92rem; font-weight: 500; margin-bottom: 5px; }
p  { font-size: 1rem; color: var(--text-muted); line-height: 1.65; font-weight: 300; }

/* ─── Buttons ─── */
.btn-primary, .btn-secondary, .btn-ghost {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 13px 28px; border-radius: var(--radius-full);
  font-family: 'DM Sans', sans-serif; font-size: 0.95rem; font-weight: 500;
  border: none; cursor: pointer; text-decoration: none;
  transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
}
.btn-primary {
  background: var(--primary); color: #fff;
  box-shadow: 0 4px 24px color-mix(in srgb, var(--primary) 35%, transparent);
}
.btn-primary:hover  { background: var(--primary-dark); transform: translateY(-2px); }
.btn-primary:active { transform: translateY(0); }

.btn-secondary {
  background: #fff; color: var(--text);
  border: 1.5px solid rgba(0,0,0,0.1);
}
.btn-secondary:hover { border-color: var(--primary); color: var(--primary-dark); }

.btn-ghost {
  background: transparent; color: var(--primary-dark); padding: 10px 20px;
}
.btn-ghost:hover { background: var(--primary-pale); }

/* ─── Cards ─── */
.card {
  background: #fff; border-radius: var(--radius-md);
  border: 1px solid rgba(0,0,0,0.06);
  box-shadow: var(--shadow-sm);
  transition: transform 0.25s, box-shadow 0.25s;
  overflow: hidden;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.card-header { padding: 18px 22px; border-bottom: 1px solid rgba(0,0,0,0.06); }
.card-body   { padding: 22px; }

/* ─── Forms ─── */
input, select, textarea {
  width: 100%; padding: 11px 14px;
  border: 1.5px solid rgba(0,0,0,0.11); border-radius: var(--radius-sm);
  font-family: 'DM Sans', sans-serif; font-size: 0.92rem;
  color: var(--text); background: var(--bg);
  transition: border-color 0.2s; outline: none;
}
input:focus, select:focus, textarea:focus { border-color: var(--primary); }
input::placeholder, textarea::placeholder { color: #bbb; }
label { display: block; font-size: 0.78rem; font-weight: 500; margin-bottom: 5px; }

/* ─── Layout utilities ─── */
.container { max-width: 640px; margin: 0 auto; padding: 24px 16px; }
.flex      { display: flex; align-items: center; }
.flex-col  { display: flex; flex-direction: column; }
.gap-sm    { gap: 8px; }
.gap-md    { gap: 16px; }
.gap-lg    { gap: 28px; }
.text-center { text-align: center; }

/* ─── Badges ─── */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 12px; border-radius: var(--radius-full);
  font-size: 0.74rem; font-weight: 600; letter-spacing: 0.02em;
  background: var(--primary-light); color: var(--primary-dark);
}
.badge-success { background: #dcf8c6; color: #128C7E; }
.badge-warning { background: #fff3cd; color: #856404; }
.badge-error   { background: #fde2e2; color: #b91c1c; }

/* ─── Feedback FAB ─── */
.riff-feedback {
  position: fixed; bottom: 20px; right: 20px; z-index: 900;
  width: 52px; height: 52px; border-radius: 50%;
  background: var(--primary); color: #fff;
  border: none; cursor: pointer; font-size: 1.4rem;
  box-shadow: var(--shadow-md);
  display: flex; align-items: center; justify-content: center;
  transition: background 0.2s, transform 0.15s;
}
.riff-feedback:hover { background: var(--primary-dark); transform: scale(1.08); }

/* ─── Animations ─── */
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.fade-in { animation: fadeIn 0.3s ease forwards; }

/* ─── Responsive (640px breakpoint) ─── */
@media (min-width: 640px) {
  .container { padding: 32px 24px; }
  h1 { font-size: clamp(2.2rem, 4vw, 3.2rem); }
}
