@import url("https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,700;1,400&family=Inter:wght@300;400;500;600&display=swap");

:root {
  --cream: #faf7f2;
  --white: #ffffff;
  --brown: #3d2b1f;
  --brown-mid: #6b4c38;
  --brown-light: #a67c5b;
  --amber: #c8873a;
  --amber-light: #e8b87a;
  --amber-pale: #fdf0e0;
  --green: #2d6a45;
  --green-light: #e4f0e9;
  --red: #b83232;
  --red-light: #fdeaea;
  --text: #1e140d;
  --text-mid: #5a3e2e;
  --text-soft: #9a7560;
  --border: #e8ddd0;
  --shadow: rgba(61, 43, 31, 0.1);
  --radius: 14px;
  --radius-sm: 8px;
  --radius-lg: 20px;
}
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
html,
body {
  height: 100%;
}
body {
  font-family: "Inter", sans-serif;
  background: var(--cream);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}
main {
  flex: 1;
}

/* NAVBAR */
.navbar {
  background: var(--brown);
  padding: 0 36px;
  min-height: 66px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.12);
}
.nav-logo {
  font-family: "Playfair Display", serif;
  color: var(--amber-light);
  font-size: 21px;
  text-decoration: none;
  letter-spacing: 0.01em;
  flex: 0 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.nav-right {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-shrink: 0;
}
.nav-user {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.75);
  font-weight: 400;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.nav-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: rgba(255, 255, 255, 0.75);
  padding: 9px 18px;
  border-radius: 9px;
  cursor: pointer;
  font-size: 13px;
  font-family: "Inter", sans-serif;
  transition: all 0.18s;
  white-space: nowrap;
  flex-shrink: 0;
}
.nav-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  color: white;
}

/* BETA-BADGE (kleines Hinweis-Label an neuen/experimentellen Funktionen) */
.beta-badge {
  position: absolute;
  top: -8px;
  right: -8px;
  background: linear-gradient(135deg, #b565f5, #7c3aed);
  color: white;
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: 0.03em;
  padding: 2px 5px;
  border-radius: 8px;
  pointer-events: none;
  animation: beta-glow 2.4s ease-in-out infinite;
}
@keyframes beta-glow {
  0%,
  100% {
    box-shadow: 0 0 5px rgba(168, 85, 247, 0.55), 0 0 2px rgba(168, 85, 247, 0.8);
  }
  50% {
    box-shadow: 0 0 11px rgba(168, 85, 247, 0.9), 0 0 4px rgba(168, 85, 247, 1);
  }
}

/* FOOTER */
footer {
  background: var(--brown);
  padding: 26px 36px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px 28px;
  margin-top: auto;
}
.footer-left h4 {
  font-family: "Playfair Display", serif;
  color: var(--amber-light);
  font-size: 17px;
}
.footer-left p {
  color: rgba(255, 255, 255, 0.4);
  font-size: 12px;
  margin-top: 3px;
}
.footer-right {
  display: flex;
  align-items: center;
  gap: 8px;
}
.footer-credit {
  font-size: 12.5px;
  color: rgba(255, 255, 255, 0.4);
}
.footer-heart {
  color: var(--red);
}

/* Entwickler-Link - schlicht im Textfluss, mit sanftem, dauerhaftem Textglanz */
.dev-link {
  font-weight: 600;
  text-decoration: none;
  background-image: linear-gradient(
    100deg,
    var(--amber-light) 0%,
    var(--amber-light) 35%,
    #fff 50%,
    var(--amber-light) 65%,
    var(--amber-light) 100%
  );
  background-size: 250% auto;
  background-position: 100% center;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  animation: dev-link-shine 4.5s ease-in-out infinite;
}
@keyframes dev-link-shine {
  0% {
    background-position: 100% center;
  }
  50% {
    background-position: 0% center;
  }
  100% {
    background-position: 100% center;
  }
}

/* FORMS */
.form-group {
  margin-bottom: 16px;
}
.form-group label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-soft);
  margin-bottom: 7px;
}
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-family: "Inter", sans-serif;
  color: var(--text);
  background: white;
  transition:
    border-color 0.18s,
    box-shadow 0.18s;
  outline: none;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--amber);
  box-shadow: 0 0 0 3px rgba(200, 135, 58, 0.12);
}

/* BUTTONS */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 11px 22px;
  border-radius: var(--radius-sm);
  font-family: "Inter", sans-serif;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s;
  border: none;
  text-decoration: none;
}
.btn:active:not(:disabled) {
  transform: scale(0.96);
}
.btn-primary {
  background: var(--brown);
  color: var(--amber-light);
}
.btn-primary:hover {
  background: var(--brown-mid);
  transform: translateY(-1px);
}
.btn-primary:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}
.btn-amber {
  background: var(--amber);
  color: white;
}
.btn-amber:hover {
  background: var(--brown-mid);
  transform: translateY(-1px);
}
.btn-ghost {
  background: transparent;
  border: 1.5px solid var(--border);
  color: var(--text-mid);
}
.btn-ghost:hover {
  border-color: var(--brown);
  color: var(--brown);
}
.btn-danger {
  background: var(--red-light);
  border: 1.5px solid #f0bcbc;
  color: var(--red);
}
.btn-danger:hover {
  background: #f9d0d0;
}
.btn-full {
  width: 100%;
}

/* CARDS */
.card {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: 0 2px 16px var(--shadow);
}

/* BADGES */
.badge {
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}
.badge-easy {
  background: var(--green-light);
  color: var(--green);
}
.badge-mid {
  background: #fff4e6;
  color: #b86a00;
}
.badge-hard {
  background: var(--red-light);
  color: var(--red);
}
.badge-time {
  background: var(--amber-pale);
  color: var(--brown-mid);
}
.badge-pers {
  background: #e8f0ff;
  color: #2a50a0;
}

/* OVERLAY */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(20, 10, 5, 0.55);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 999;
  backdrop-filter: blur(2px);
}
.overlay.show {
  display: flex;
  animation: fade-in 0.2s ease;
}
.overlay-box {
  background: white;
  border-radius: var(--radius-lg);
  padding: 32px 44px;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
  animation: pop-in 0.28s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.spinner {
  width: 44px;
  height: 44px;
  border: 3px solid var(--border);
  border-top-color: var(--amber);
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
  margin: 0 auto 14px;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
@keyframes fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
@keyframes pop-in {
  from {
    opacity: 0;
    transform: scale(0.92);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}
.overlay-box p {
  color: var(--text-mid);
  font-size: 15px;
}

/* Wiederverwendbare Ladeanzeige (z.B. Rezeptliste, Rezeptdetails) */
.loading-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 70px 20px;
  color: var(--text-soft);
  font-size: 14px;
  animation: fade-in 0.25s ease;
}
.loading-block .spinner {
  margin-bottom: 16px;
}

/* TOAST */
.toast {
  position: fixed;
  bottom: 28px;
  right: 28px;
  background: var(--brown);
  color: var(--amber-light);
  padding: 13px 20px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  z-index: 2000;
  transform: translateY(80px);
  opacity: 0;
  transition: all 0.28s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.25);
  max-width: 320px;
}
.toast.show {
  transform: translateY(0);
  opacity: 1;
}
.toast.err {
  background: var(--red);
  color: white;
}

/* BACK LINK */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-soft);
  font-size: 14px;
  text-decoration: none;
  transition: color 0.18s;
}
.back-link:hover {
  color: var(--brown);
}

/* MODAL */
.modal-bg {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 600;
  backdrop-filter: blur(2px);
}
.modal-bg.open {
  display: flex;
}
.modal {
  background: white;
  border-radius: var(--radius-lg);
  padding: 36px 32px;
  width: min(400px, 92vw);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  text-align: center;
}
.modal h3 {
  font-family: "Playfair Display", serif;
  font-size: 22px;
  color: var(--brown);
  margin-bottom: 10px;
}
.modal p {
  color: var(--text-soft);
  font-size: 15px;
  margin-bottom: 26px;
  line-height: 1.55;
}
.modal-btns {
  display: flex;
  gap: 10px;
  justify-content: center;
}

@media (max-width: 380px) {
  .nav-user {
    display: none;
  }
}

@media (max-width: 680px) {
  .navbar {
    padding: 0 16px;
    min-height: 58px;
    gap: 10px;
  }
  .nav-logo {
    font-size: 17px;
  }
  .nav-right {
    gap: 8px;
  }
  .nav-user {
    max-width: 110px;
    font-size: 12.5px;
  }
  .nav-btn {
    padding: 8px 13px;
    font-size: 12px;
  }
  footer {
    padding: 22px 18px;
    flex-direction: column;
  }
}

/* ============================================================
   INTERAKTIVES TUTORIAL
============================================================ */
.tour-blocker {
  position: fixed;
  inset: 0;
  z-index: 2998;
  background: transparent;
}
.tour-blocker-solid {
  background: rgba(20, 10, 5, 0.72);
}
.tour-spotlight {
  position: fixed;
  z-index: 2999;
  border-radius: 14px;
  box-shadow:
    0 0 0 9999px rgba(20, 10, 5, 0.72),
    0 0 0 3px var(--amber),
    0 0 26px rgba(232, 184, 122, 0.65);
  pointer-events: none;
  transition:
    top 0.25s ease,
    left 0.25s ease,
    width 0.25s ease,
    height 0.25s ease;
}
.tour-tip {
  position: fixed;
  z-index: 3000;
  width: min(320px, 88vw);
  background: white;
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: 0 20px 55px rgba(0, 0, 0, 0.35);
}
.tour-tip-center {
  width: min(360px, 88vw);
}
.tour-close-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--text-soft);
  font-size: 20px;
  font-weight: 300;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.55;
  transition: all 0.2s;
}
.tour-close-btn:hover {
  opacity: 1;
  background: var(--amber-pale);
  color: var(--brown);
  transform: rotate(90deg);
}
.tour-tip-step {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--amber);
  margin-bottom: 8px;
  padding-right: 26px;
}
.tour-tip h4 {
  font-family: "Playfair Display", serif;
  font-size: 17px;
  color: var(--brown);
  margin-bottom: 8px;
  padding-right: 20px;
}
.tour-tip p {
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--text-mid);
  margin-bottom: 16px;
}
.tour-tip-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.tour-tip-spacer {
  flex: 1;
}
.tour-skip-btn {
  background: transparent;
  border: none;
  color: var(--text-soft);
  font-size: 12.5px;
  cursor: pointer;
  font-family: "Inter", sans-serif;
  text-decoration: underline;
  padding: 6px 0;
}
.tour-skip-btn:hover {
  color: var(--red);
}
.tour-back-btn {
  background: transparent;
  border: 1.5px solid var(--border);
  color: var(--text-mid);
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  cursor: pointer;
  font-family: "Inter", sans-serif;
}
.tour-next-btn {
  background: var(--amber);
  color: white;
  border: none;
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  font-family: "Inter", sans-serif;
  transition: all 0.18s;
}
.tour-next-btn:hover {
  background: var(--brown-mid);
}
.tour-arrow {
  position: absolute;
  width: 16px;
  height: 16px;
  background: white;
  transform: rotate(45deg);
  z-index: -1;
}
.tour-arrow-bottom {
  top: -8px;
}
.tour-arrow-top {
  bottom: -8px;
}
.tour-arrow-left {
  right: -8px;
}
.tour-arrow-right {
  left: -8px;
}

/* CTA-Banner (nur Home) */
.tutorial-cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  background: white;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 24px;
  margin: 0 auto 8px;
  max-width: 820px;
  transition: all 0.2s;
}
.tutorial-cta.highlight {
  border-color: var(--amber);
  animation: tutorial-pulse 2.2s infinite;
}
@keyframes tutorial-pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(200, 135, 58, 0.45);
  }
  70% {
    box-shadow: 0 0 0 14px rgba(200, 135, 58, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(200, 135, 58, 0);
  }
}
.tutorial-cta .tc-text h3 {
  font-family: "Playfair Display", serif;
  color: var(--brown);
  font-size: 17px;
  margin-bottom: 4px;
}
.tutorial-cta .tc-text p {
  font-size: 13px;
  color: var(--text-soft);
}
.tour-start-btn {
  padding: 12px 22px;
  border-radius: var(--radius-sm);
  font-family: "Inter", sans-serif;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
  background: transparent;
  border: 1.5px solid var(--border);
  color: var(--text-mid);
}
.tutorial-cta.highlight .tour-start-btn {
  background: var(--amber);
  color: white;
  border-color: var(--amber);
}
.tutorial-cta.highlight .tour-start-btn:hover {
  background: var(--brown-mid);
}
.tutorial-cta:not(.highlight) .tour-start-btn:hover {
  border-color: var(--amber);
  color: var(--brown);
}

@media (max-width: 480px) {
  .tour-tip {
    width: calc(100vw - 32px);
    left: 16px !important;
  }
  .tutorial-cta {
    padding: 16px 18px;
    margin-bottom: 4px;
  }
}