/* ── Dal Mio Caro Ricettario — Design System ──────────────────────────── */

:root {
  --cream:       #FAF6EE;
  --cream-dark:  #F0E8D8;
  --parchment:   #E8D9C0;
  --brown:       #8B5E3C;
  --brown-light: #C4A882;
  --red:         #C8533A;
  --red-light:   #E8785F;
  --gold:        #D4A853;
  --gold-light:  #E8C87A;
  --green:       #2E7D52;
  --text:        #2C1810;
  --text-muted:  #7A6555;
  --border:      #D4C5A9;
  --shadow:      rgba(44, 24, 16, 0.08);
  --shadow-md:   rgba(44, 24, 16, 0.14);
  --radius:      12px;
  --radius-lg:   20px;
  --font-display: 'Playfair Display', Georgia, serif;
  --font-body:    'Lato', sans-serif;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--cream);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
  position: relative;
}

.paper-texture {
  position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)' opacity='0.035'/%3E%3C/svg%3E");
  opacity: 1;
}

/* ── NAVBAR ─────────────────────────────────────────────────────────────── */
.navbar {
  position: sticky; top: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 2rem;
  height: 64px;
  background: rgba(250, 246, 238, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.nav-logo {
  display: flex; align-items: center; gap: 10px;
  text-decoration: none;
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
  letter-spacing: 0.01em;
}

.nav-links {
  display: flex; align-items: center; gap: 8px;
}

.nav-link {
  display: flex; align-items: center; gap: 6px;
  padding: 7px 16px;
  border-radius: 50px;
  text-decoration: none;
  font-size: 0.9rem;
  color: var(--text-muted);
  transition: all .2s;
  font-weight: 500;
}
.nav-link:hover, .nav-link.active {
  background: var(--cream-dark);
  color: var(--red);
}

.nav-user {
  display: flex; align-items: center; gap: 8px;
  margin-left: 8px;
  padding-left: 16px;
  border-left: 1px solid var(--border);
}
.user-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  border: 2px solid var(--border);
  object-fit: cover;
}
.user-name { font-size: 0.85rem; color: var(--text-muted); font-weight: 600; }
.nav-logout {
  display: flex; align-items: center;
  color: var(--text-muted); text-decoration: none;
  padding: 4px;
  border-radius: 6px;
  transition: color .2s;
}
.nav-logout:hover { color: var(--red); }

/* ── MAIN ────────────────────────────────────────────────────────────────── */
.main-content {
  position: relative; z-index: 1;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ── FOOTER ─────────────────────────────────────────────────────────────── */
.footer {
  position: relative; z-index: 1;
  text-align: center;
  padding: 2rem;
  margin-top: 4rem;
  color: var(--text-muted);
  font-size: 0.85rem;
  font-family: var(--font-display);
  font-style: italic;
  border-top: 1px solid var(--border);
}
.footer-ornament { margin-top: 6px; color: var(--red); opacity: 0.4; letter-spacing: 8px; }

/* ── BUTTONS ─────────────────────────────────────────────────────────────── */
.btn-primary {
  display: inline-flex; align-items: center; gap: 10px;
  background: var(--red);
  color: white;
  border: none; cursor: pointer;
  padding: 12px 28px;
  border-radius: 50px;
  font-family: var(--font-body);
  font-size: 1rem; font-weight: 700;
  text-decoration: none;
  transition: all .2s;
  letter-spacing: 0.02em;
}
.btn-primary:hover { background: var(--red-light); transform: translateY(-1px); box-shadow: 0 6px 20px rgba(200, 83, 58, 0.3); }

.btn-secondary {
  display: inline-flex; align-items: center; gap: 10px;
  background: transparent;
  color: var(--brown);
  border: 2px solid var(--brown-light);
  cursor: pointer;
  padding: 10px 24px;
  border-radius: 50px;
  font-family: var(--font-body);
  font-size: 0.95rem; font-weight: 600;
  text-decoration: none;
  transition: all .2s;
}
.btn-secondary:hover { background: var(--cream-dark); border-color: var(--brown); }

.btn-danger {
  display: inline-flex; align-items: center; gap: 8px;
  background: transparent; color: var(--text-muted);
  border: 1.5px solid var(--border); cursor: pointer;
  padding: 8px 20px; border-radius: 50px;
  font-family: var(--font-body); font-size: 0.85rem; font-weight: 600;
  transition: all .2s;
}
.btn-danger:hover { color: #B00020; border-color: #B00020; background: #FFF0F0; }

.btn-large { padding: 16px 36px; font-size: 1.05rem; }

.btn-google {
  display: inline-flex; align-items: center; gap: 14px;
  background: white;
  color: var(--text);
  border: 2px solid var(--border);
  cursor: pointer;
  padding: 14px 32px;
  border-radius: 50px;
  font-family: var(--font-body);
  font-size: 1.05rem; font-weight: 700;
  text-decoration: none;
  transition: all .2s;
  box-shadow: 0 2px 12px var(--shadow);
}
.btn-google:hover { box-shadow: 0 6px 24px var(--shadow-md); transform: translateY(-2px); border-color: var(--brown-light); }

/* ── HOME ─────────────────────────────────────────────────────────────────── */
.home-hero {
  display: grid;
  grid-template-columns: 120px 1fr 120px;
  align-items: center;
  min-height: calc(100vh - 64px - 80px);
  padding: 4rem 0;
  gap: 2rem;
}
.hero-decoration { display: flex; justify-content: center; }

.hero-content { text-align: center; }

.hero-label {
  font-family: var(--font-body);
  font-size: 0.8rem; font-weight: 700;
  letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--red); margin-bottom: 1rem;
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(3rem, 8vw, 6rem);
  line-height: 1.0;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 1.5rem;
}
.hero-title em { color: var(--red); font-style: italic; }

.hero-divider { display: flex; justify-content: center; margin: 1.5rem 0; }

.hero-subtitle {
  font-family: var(--font-display);
  font-size: 1.15rem;
  color: var(--text-muted);
  font-style: italic;
  margin-bottom: 2.5rem;
  line-height: 1.7;
}

.hero-logged-in, .hero-login { margin-top: 0.5rem; }

.welcome-back {
  font-family: var(--font-display);
  font-size: 1.1rem; color: var(--text-muted); margin-bottom: 1.5rem;
}
.welcome-back strong { color: var(--brown); }

.hero-buttons { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }

.login-hint {
  font-size: 0.95rem; color: var(--text-muted); margin-bottom: 1.5rem;
}

.home-features {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem; padding: 3rem 0 4rem;
  border-top: 1px solid var(--border);
}

.feature-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  text-align: center;
  transition: transform .2s, box-shadow .2s;
}
.feature-card:hover { transform: translateY(-3px); box-shadow: 0 8px 32px var(--shadow-md); }
.feature-icon { margin-bottom: 1rem; }
.feature-card h3 { font-family: var(--font-display); font-size: 1.2rem; margin-bottom: 0.5rem; color: var(--text); }
.feature-card p { font-size: 0.9rem; color: var(--text-muted); line-height: 1.6; }

/* ── PAGE HEADER ─────────────────────────────────────────────────────────── */
.page-header {
  text-align: center;
  padding: 3rem 0 2rem;
}
.page-header-ornament { margin-bottom: 1rem; }
.page-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 800;
  color: var(--text);
  line-height: 1.1;
  margin-bottom: 0.6rem;
}
.page-subtitle {
  font-family: var(--font-display);
  font-size: 1rem;
  color: var(--text-muted);
  font-style: italic;
  line-height: 1.7;
}

/* ── RECORDER ────────────────────────────────────────────────────────────── */
.recorder-section { max-width: 700px; margin: 0 auto 3rem; }

.recorder-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 3rem 2rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  transition: box-shadow .3s;
  box-shadow: 0 2px 16px var(--shadow);
}
.recorder-card.is-recording {
  border-color: var(--red);
  box-shadow: 0 0 0 4px rgba(200, 83, 58, 0.1), 0 4px 24px var(--shadow-md);
}

.recorder-status {
  font-size: 0.85rem; font-weight: 600;
  letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--text-muted);
}

.record-btn {
  display: flex; flex-direction: column; align-items: center; gap: 14px;
  background: none; border: none; cursor: pointer;
}

.record-btn-inner {
  width: 110px; height: 110px;
  border-radius: 50%;
  background: var(--brown);
  display: flex; align-items: center; justify-content: center;
  transition: all .25s;
  box-shadow: 0 6px 24px rgba(139, 94, 60, 0.3);
}
.record-btn:hover .record-btn-inner { transform: scale(1.05); box-shadow: 0 8px 32px rgba(139, 94, 60, 0.4); }
.record-btn.recording .record-btn-inner {
  background: var(--red);
  box-shadow: 0 6px 24px rgba(200, 83, 58, 0.4);
  animation: pulseRed 1.5s infinite;
}

@keyframes pulseRed {
  0%, 100% { box-shadow: 0 6px 24px rgba(200, 83, 58, 0.4); }
  50% { box-shadow: 0 6px 40px rgba(200, 83, 58, 0.6); transform: scale(1.03); }
}

.record-btn-label {
  font-family: var(--font-display);
  font-size: 1.15rem; font-weight: 600;
  color: var(--text);
}

/* Audio waves */
.audio-waves {
  display: flex; align-items: flex-end; gap: 4px;
  height: 40px;
  opacity: 0;
  transition: opacity .3s;
}
.audio-waves.active { opacity: 1; }
.audio-waves span {
  display: block; width: 5px;
  background: var(--red); border-radius: 3px;
  min-height: 5px;
}
.audio-waves.active span:nth-child(1) { animation: wave .9s ease-in-out infinite; }
.audio-waves.active span:nth-child(2) { animation: wave .9s ease-in-out .12s infinite; }
.audio-waves.active span:nth-child(3) { animation: wave .9s ease-in-out .24s infinite; }
.audio-waves.active span:nth-child(4) { animation: wave .9s ease-in-out .36s infinite; }
.audio-waves.active span:nth-child(5) { animation: wave .9s ease-in-out .48s infinite; }
.audio-waves.active span:nth-child(6) { animation: wave .9s ease-in-out .60s infinite; }
.audio-waves.active span:nth-child(7) { animation: wave .9s ease-in-out .48s infinite; }
.audio-waves.active span:nth-child(8) { animation: wave .9s ease-in-out .36s infinite; }
.audio-waves.active span:nth-child(9) { animation: wave .9s ease-in-out .24s infinite; }
.audio-waves.active span:nth-child(10) { animation: wave .9s ease-in-out .12s infinite; }

@keyframes wave {
  0%, 100% { height: 6px; }
  50% { height: 34px; }
}

.transcript-area {
  width: 100%;
  background: var(--cream);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  text-align: left;
}
.transcript-label {
  font-size: 0.75rem; font-weight: 700; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--text-muted); margin-bottom: 0.5rem;
}
.transcript-text {
  font-family: var(--font-display);
  font-style: italic;
  color: var(--text);
  font-size: 1rem;
  line-height: 1.7;
  min-height: 40px;
}

/* AI Loading */
.ai-loading {
  display: flex; justify-content: center; align-items: center;
  padding: 4rem 2rem;
}
.ai-loading-inner { text-align: center; }
.loading-spinner {
  width: 48px; height: 48px;
  border: 3px solid var(--border);
  border-top-color: var(--red);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
  margin: 0 auto 1rem;
}
@keyframes spin { to { transform: rotate(360deg); } }
.ai-loading p { font-family: var(--font-display); font-style: italic; color: var(--text-muted); }
.loading-dots::after { content: '...'; animation: dots 1.5s steps(4, end) infinite; }
@keyframes dots { 0%,100%{content:''} 25%{content:'.'} 50%{content:'..'} 75%{content:'...'} }

/* Result section */
.result-section { margin-top: 1.5rem; }
.result-header {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--font-display);
  font-size: 1.3rem; font-weight: 700;
  color: var(--green);
  margin-bottom: 1.5rem;
}

/* Recipe preview card */
.recipe-preview {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 4px 24px var(--shadow);
  margin-bottom: 1.5rem;
}
.rp-header {
  padding: 2rem 2rem 1.5rem;
  background: linear-gradient(135deg, var(--cream) 0%, white 100%);
  border-bottom: 1px solid var(--border);
  position: relative;
}
.rp-tipologia {
  display: inline-block;
  color: white;
  font-size: 0.72rem; font-weight: 700;
  letter-spacing: 0.15em; text-transform: uppercase;
  padding: 4px 14px; border-radius: 50px;
  margin-bottom: 0.75rem;
  background: var(--red);
}
.rp-nome {
  font-family: var(--font-display);
  font-size: 1.8rem; font-weight: 800;
  line-height: 1.2;
  color: var(--text);
  margin-bottom: 0.75rem;
}
.rp-tags { display: flex; gap: 6px; flex-wrap: wrap; }
.rp-body { padding: 1.5rem 2rem 2rem; display: grid; gap: 2rem; }

.rp-section-title {
  display: flex; align-items: center; gap: 8px;
  font-family: var(--font-display);
  font-size: 1.05rem; font-weight: 700;
  color: var(--brown);
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1.5px solid var(--cream-dark);
}

.ingredienti-list { list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 6px 16px; }
.ingredienti-list li { display: flex; gap: 8px; align-items: baseline; font-size: 0.9rem; }
.ing-qty { font-weight: 700; color: var(--red); min-width: 60px; white-space: nowrap; }
.ing-nome { color: var(--text); }

.procedimento-list { list-style: none; display: grid; gap: 12px; }
.procedimento-list li {
  display: flex; gap: 14px;
  font-size: 0.9rem; line-height: 1.6;
  padding: 10px 12px;
  background: var(--cream);
  border-radius: 8px;
}
.step-num {
  min-width: 26px; height: 26px;
  background: var(--red);
  color: white;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.75rem; font-weight: 700;
  flex-shrink: 0;
}

.recipe-tag {
  display: inline-block;
  background: var(--cream-dark);
  color: var(--brown);
  font-size: 0.72rem; font-weight: 700;
  letter-spacing: 0.08em; text-transform: uppercase;
  padding: 3px 10px; border-radius: 50px;
}

.result-actions { display: flex; gap: 1rem; flex-wrap: wrap; }

/* Tips */
.tips-section {
  max-width: 700px; margin: 0 auto 4rem;
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem;
}
.tips-title {
  font-family: var(--font-display);
  font-size: 1.1rem; font-weight: 700;
  color: var(--brown);
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}
.tips-grid { display: grid; gap: 1rem; }
.tip { display: flex; gap: 1rem; align-items: flex-start; }
.tip-number {
  min-width: 32px; height: 32px;
  background: var(--gold);
  color: white;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 0.85rem;
  flex-shrink: 0;
}
.tip p { font-size: 0.9rem; color: var(--text-muted); line-height: 1.6; }

/* ── RICETTARIO PAGE ─────────────────────────────────────────────────────── */
.filter-bar {
  display: flex; gap: 8px; flex-wrap: wrap;
  margin: 1.5rem 0 2rem;
}
.filter-btn {
  padding: 8px 18px;
  border-radius: 50px;
  border: 1.5px solid var(--border);
  background: white;
  color: var(--text-muted);
  font-family: var(--font-body);
  font-size: 0.85rem; font-weight: 600;
  cursor: pointer;
  transition: all .2s;
}
.filter-btn:hover { border-color: var(--brown-light); color: var(--brown); }
.filter-btn.active { background: var(--red); border-color: var(--red); color: white; }

.recipes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.25rem;
  margin-bottom: 6rem;
}

.recipe-card {
  display: flex; flex-direction: column;
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  text-decoration: none;
  color: var(--text);
  transition: transform .2s, box-shadow .2s;
  overflow: hidden;
  position: relative;
}
.recipe-card:hover { transform: translateY(-3px); box-shadow: 0 10px 36px var(--shadow-md); }

.recipe-card-top {
  height: 90px;
  display: flex; align-items: center; justify-content: center;
  position: relative;
  background: var(--cream);
}
.recipe-tipo-badge {
  position: absolute; top: 12px; left: 12px;
  color: white;
  font-size: 0.68rem; font-weight: 700;
  letter-spacing: 0.12em; text-transform: uppercase;
  padding: 3px 12px; border-radius: 50px;
  background: var(--red);
}

.recipe-card-body { padding: 1.25rem 1.5rem 1rem; flex: 1; }
.recipe-card-name {
  font-family: var(--font-display);
  font-size: 1.15rem; font-weight: 700;
  line-height: 1.3;
  margin-bottom: 0.4rem;
  color: var(--text);
}
.recipe-card-meta { margin-bottom: 0.6rem; }
.recipe-date { font-size: 0.78rem; color: var(--text-muted); }
.recipe-card-tags { display: flex; gap: 4px; flex-wrap: wrap; }
.recipe-tag-small {
  font-size: 0.7rem; font-weight: 600;
  color: var(--brown-light);
  letter-spacing: 0.05em;
}

.recipe-card-arrow {
  display: flex; align-items: center; justify-content: flex-end;
  padding: 0.75rem 1.25rem;
  color: var(--border);
  border-top: 1px solid var(--cream-dark);
  transition: color .2s;
}
.recipe-card:hover .recipe-card-arrow { color: var(--red); }

.empty-ricettario {
  text-align: center; padding: 5rem 2rem;
}
.empty-illustration { margin-bottom: 1.5rem; }
.empty-ricettario h2 {
  font-family: var(--font-display);
  font-size: 1.6rem; margin-bottom: 0.75rem;
}
.empty-ricettario p { color: var(--text-muted); margin-bottom: 2rem; }
.empty-filter { text-align: center; padding: 3rem; color: var(--text-muted); }
.empty-filter p { margin-bottom: 1.5rem; font-family: var(--font-display); font-style: italic; }

/* FAB */
.fab-container { position: fixed; bottom: 2rem; right: 2rem; z-index: 50; }
.fab {
  display: flex; align-items: center; justify-content: center;
  width: 60px; height: 60px;
  border-radius: 50%;
  background: var(--red);
  color: white;
  text-decoration: none;
  box-shadow: 0 6px 24px rgba(200, 83, 58, 0.4);
  transition: all .2s;
}
.fab:hover { transform: scale(1.08) translateY(-2px); box-shadow: 0 10px 32px rgba(200, 83, 58, 0.5); }

/* ── RECIPE DETAIL ───────────────────────────────────────────────────────── */
.detail-back { padding: 1.5rem 0 0; }
.back-link {
  display: inline-flex; align-items: center; gap: 6px;
  text-decoration: none;
  color: var(--text-muted);
  font-size: 0.9rem; font-weight: 600;
  transition: color .2s;
}
.back-link:hover { color: var(--red); }

.recipe-detail {
  max-width: 760px;
  margin: 2rem auto 4rem;
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 4px 32px var(--shadow);
}

.rd-header {
  padding: 3rem 3rem 2rem;
  background: linear-gradient(135deg, var(--cream) 0%, white 70%);
  border-bottom: 1px solid var(--border);
  --accent: var(--red);
}

.rd-tipologia-wrap { margin-bottom: 0.75rem; }
.rd-tipologia {
  display: inline-block;
  color: white;
  font-size: 0.72rem; font-weight: 700;
  letter-spacing: 0.15em; text-transform: uppercase;
  padding: 5px 16px; border-radius: 50px;
}

.rd-title {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 5vw, 3rem);
  font-weight: 800;
  color: var(--text);
  line-height: 1.15;
  margin-bottom: 0.75rem;
}
.rd-meta { display: flex; gap: 1rem; align-items: center; margin-bottom: 1rem; }
.rd-date {
  display: flex; align-items: center; gap: 6px;
  font-size: 0.82rem; color: var(--text-muted);
}
.rd-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 1.5rem; }
.rd-divider { margin-top: 1rem; }

.rd-body {
  padding: 2.5rem 3rem;
  display: grid; gap: 2.5rem;
}

.rd-section-title {
  display: flex; align-items: center; gap: 12px;
  font-family: var(--font-display);
  font-size: 1.25rem; font-weight: 700;
  color: var(--text);
  margin-bottom: 1.25rem;
}
.rd-section-num {
  font-family: var(--font-display);
  font-style: italic;
  color: var(--red);
  font-size: 1.4rem;
  font-weight: 800;
  min-width: 28px;
}

.ingredienti-detail-list { list-style: none; display: grid; gap: 8px; }
.ingredienti-detail-list li {
  display: flex; align-items: baseline; gap: 10px;
  padding: 8px 0;
  border-bottom: 1px dotted var(--cream-dark);
}
.ingredienti-detail-list li:last-child { border-bottom: none; }
.id-bullet { flex-shrink: 0; }
.id-qty {
  font-weight: 700;
  color: var(--red);
  min-width: 80px;
  font-size: 0.95rem;
}
.id-name {
  font-size: 0.95rem;
  color: var(--text);
  font-family: var(--font-display);
}

.procedimento-detail-list { list-style: none; display: grid; gap: 1rem; }
.procedimento-detail-list li {
  display: flex; gap: 1rem;
  padding: 1.25rem;
  background: var(--cream);
  border-radius: var(--radius);
  border-left: 3px solid var(--red);
}
.pd-step-num {
  min-width: 32px; height: 32px;
  background: var(--red);
  color: white;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 0.85rem;
  flex-shrink: 0;
}
.procedimento-detail-list li p {
  font-family: var(--font-display);
  font-size: 1rem;
  line-height: 1.7;
  color: var(--text);
}

.rd-footer {
  padding: 2rem 3rem;
  text-align: center;
  border-top: 1px solid var(--border);
  background: var(--cream);
}
.rd-footer-ornament { margin-bottom: 1.5rem; display: flex; justify-content: center; }

/* ── RESPONSIVE ──────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .navbar { padding: 0 1rem; }
  .nav-logo span { display: none; }
  .home-hero { grid-template-columns: 1fr; }
  .hero-decoration { display: none; }
  .main-content { padding: 0 1rem; }
  .rd-body, .rd-header { padding: 1.5rem; }
  .recipes-grid { grid-template-columns: 1fr; }
  .hero-buttons { flex-direction: column; align-items: center; }
  .rp-body { padding: 1.25rem 1.5rem; }
  .ingredienti-list { grid-template-columns: 1fr; }
}


/* ═══════════════════════════════════════════════════════
   SETUP PAGE
═══════════════════════════════════════════════════════ */

.setup-page {
  max-width: 680px;
  margin: 60px auto 80px;
  padding: 0 24px;
}

.setup-header {
  text-align: center;
  margin-bottom: 56px;
}

.setup-icon {
  display: flex;
  justify-content: center;
  margin-bottom: 24px;
}

.setup-title {
  font-family: 'Playfair Display', serif;
  font-size: clamp(1.8rem, 4vw, 2.4rem);
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 16px;
  line-height: 1.25;
}

.setup-subtitle {
  font-family: 'Lato', sans-serif;
  font-size: 1.05rem;
  color: var(--ink-light);
  line-height: 1.7;
}

/* Steps */
.setup-steps {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.setup-step {
  display: flex;
  gap: 24px;
  padding: 28px 0;
  border-bottom: 1px solid rgba(139, 94, 60, 0.12);
  position: relative;
}

.setup-step:last-child {
  border-bottom: none;
}

.step-number {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #C8533A, #a83e28);
  color: #fff;
  font-family: 'Playfair Display', serif;
  font-size: 1.1rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 2px;
  box-shadow: 0 4px 12px rgba(200, 83, 58, 0.3);
}

.step-content {
  flex: 1;
}

.step-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 8px;
}

.step-desc {
  font-family: 'Lato', sans-serif;
  font-size: 0.97rem;
  color: var(--ink-light);
  line-height: 1.7;
  margin-bottom: 16px;
}

.step-desc strong {
  color: var(--ink);
  font-weight: 700;
}

.step-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  background: var(--ink);
  color: var(--parchment);
  border-radius: 8px;
  font-family: 'Lato', sans-serif;
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-decoration: none;
  transition: background 0.2s, transform 0.15s;
}

.step-link:hover {
  background: #C8533A;
  transform: translateY(-1px);
}

/* Visual mock */
.step-visual {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 12px;
  padding: 16px 20px;
  background: rgba(139, 94, 60, 0.05);
  border-radius: 10px;
  border: 1px solid rgba(139, 94, 60, 0.12);
}

.step-visual-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: #1a73e8;
  color: white;
  border-radius: 6px;
  font-family: 'Lato', sans-serif;
  font-size: 0.85rem;
  font-weight: 700;
  white-space: nowrap;
}

.step-visual-result {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: rgba(139, 94, 60, 0.1);
  border: 1px solid rgba(139, 94, 60, 0.2);
  border-radius: 6px;
  font-family: 'Lato', monospace;
  font-size: 0.85rem;
  color: var(--brown);
  letter-spacing: 0.05em;
}

/* Input area */
.key-input-area {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.key-input-wrapper {
  flex: 1;
  min-width: 220px;
  position: relative;
  display: flex;
  align-items: center;
}

.key-icon {
  position: absolute;
  left: 14px;
  color: var(--terracotta);
  pointer-events: none;
}

.key-input {
  width: 100%;
  padding: 14px 16px 14px 44px;
  border: 2px solid rgba(139, 94, 60, 0.2);
  border-radius: 10px;
  background: var(--parchment-light);
  font-family: 'Lato', monospace;
  font-size: 0.95rem;
  color: var(--ink);
  letter-spacing: 0.04em;
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
}

.key-input:focus {
  border-color: var(--terracotta);
  box-shadow: 0 0 0 3px rgba(200, 83, 58, 0.12);
}

.key-input::placeholder {
  color: rgba(74, 52, 40, 0.35);
  letter-spacing: 0;
}

.btn-save-key {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 28px;
  background: linear-gradient(135deg, #C8533A, #a83e28);
  color: white;
  border: none;
  border-radius: 10px;
  font-family: 'Lato', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s, background 0.2s;
  box-shadow: 0 4px 16px rgba(200, 83, 58, 0.35);
  white-space: nowrap;
}

.btn-save-key:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(200, 83, 58, 0.4);
}

.btn-save-key:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.btn-save-key.btn-success {
  background: linear-gradient(135deg, #2e7d32, #1b5e20);
  box-shadow: 0 4px 16px rgba(46, 125, 50, 0.35);
}

.key-error {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 12px;
  padding: 12px 16px;
  background: rgba(200, 83, 58, 0.08);
  border: 1px solid rgba(200, 83, 58, 0.25);
  border-radius: 8px;
  font-family: 'Lato', sans-serif;
  font-size: 0.9rem;
  color: #a83e28;
}

.key-loading {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  font-family: 'Lato', sans-serif;
  font-size: 0.9rem;
  color: var(--ink-light);
}

.loading-dots {
  display: flex;
  gap: 4px;
}

.loading-dots span {
  width: 6px;
  height: 6px;
  background: var(--terracotta);
  border-radius: 50%;
  animation: dot-bounce 1.2s infinite;
}

.loading-dots span:nth-child(2) { animation-delay: 0.2s; }
.loading-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes dot-bounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30% { transform: translateY(-6px); opacity: 1; }
}

.setup-note {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 40px;
  padding: 16px 20px;
  background: rgba(212, 168, 83, 0.1);
  border: 1px solid rgba(212, 168, 83, 0.3);
  border-radius: 10px;
  font-family: 'Lato', sans-serif;
  font-size: 0.88rem;
  color: var(--ink-light);
  line-height: 1.6;
}


/* ═══════════════════════════════════════════════════════
   SPLASH SCREEN (primo accesso)
═══════════════════════════════════════════════════════ */

.splash-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(245, 235, 220, 0.97);
  backdrop-filter: blur(6px);
  animation: splash-in 0.6s ease both;
}

.splash-overlay.splash-out {
  animation: splash-fade-out 0.7s ease both;
}

@keyframes splash-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes splash-fade-out {
  from { opacity: 1; transform: scale(1); }
  to { opacity: 0; transform: scale(1.03); }
}

.splash-inner {
  text-align: center;
  padding: 60px 40px;
  max-width: 520px;
  width: 90%;
  animation: splash-rise 0.8s cubic-bezier(0.23, 1, 0.32, 1) 0.1s both;
  position: relative;
}

@keyframes splash-rise {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}

.splash-ornament {
  display: flex;
  justify-content: center;
}

.splash-ornament.top { margin-bottom: 28px; }
.splash-ornament.bottom { margin-top: 28px; }

.splash-label {
  font-family: 'Lato', sans-serif;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--terracotta);
  margin-bottom: 20px;
  opacity: 0;
  animation: fade-up 0.6s ease 0.4s both;
}

.splash-title {
  font-family: 'Playfair Display', serif;
  font-size: clamp(2rem, 6vw, 3rem);
  font-weight: 800;
  color: var(--ink);
  line-height: 1.2;
  margin-bottom: 24px;
  opacity: 0;
  animation: fade-up 0.7s ease 0.55s both;
}

.splash-title em {
  color: var(--terracotta);
  font-style: italic;
}

.splash-divider {
  display: flex;
  justify-content: center;
  margin-bottom: 24px;
  opacity: 0;
  animation: fade-up 0.6s ease 0.65s both;
}

.splash-text {
  font-family: 'Lato', sans-serif;
  font-size: 1rem;
  color: var(--ink-light);
  line-height: 1.8;
  margin-bottom: 40px;
  opacity: 0;
  animation: fade-up 0.6s ease 0.75s both;
}

.splash-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 16px 36px;
  background: linear-gradient(135deg, #C8533A, #a83e28);
  color: white;
  border: none;
  border-radius: 50px;
  font-family: 'Lato', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(200, 83, 58, 0.4);
  transition: transform 0.2s, box-shadow 0.2s;
  opacity: 0;
  animation: fade-up 0.6s ease 0.9s both;
}

.splash-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 32px rgba(200, 83, 58, 0.5);
}

@keyframes fade-up {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}
