/* Dau — Sistema de recetas · estilo niña de medicina muy cute ✿ */

:root {
  --pink-50:  #fff5fb;
  --pink-100: #ffe2f1;
  --pink-200: #ffc8e2;
  --pink-300: #ffa6cf;
  --pink-400: #ff7eb9;
  --pink-500: #ff48a4;
  --pink-600: #e91e8a;
  --pink-700: #b8175f;
  --rose:     #ffd6e7;
  --cream:    #fff8fc;
  --ink:      #4a1d33;
  --shadow:   0 16px 40px rgba(255, 72, 164, 0.18), 0 4px 12px rgba(255, 72, 164, 0.10);
  --radius-lg: 28px;
  --radius-md: 18px;
  --radius-sm: 12px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  font-family: "Quicksand", system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 18%, #ffd6ec 0%, transparent 50%),
    radial-gradient(circle at 88% 82%, #ffc1de 0%, transparent 55%),
    radial-gradient(circle at 50% 50%, #fff0f8 0%, #ffe6f3 50%, #ffd6ec 100%);
  background-attachment: fixed;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  letter-spacing: 0.1px;
}

a { color: var(--pink-600); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Sparkles & hearts decor */
.bg-decor {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}
.sparkle, .heart {
  position: absolute;
  font-size: 22px;
  color: var(--pink-300);
  opacity: 0.55;
  animation: floaty 6s ease-in-out infinite;
  text-shadow: 0 0 12px rgba(255, 126, 185, 0.45);
}
.sparkle.s1 { top: 8%;  left: 10%; font-size: 28px; }
.sparkle.s2 { top: 18%; left: 78%; font-size: 22px; animation-delay: 1.2s; }
.sparkle.s3 { top: 70%; left: 6%;  font-size: 30px; animation-delay: 2.4s; }
.sparkle.s4 { top: 88%; left: 88%; font-size: 24px; animation-delay: 3.6s; }
.heart.h1   { top: 38%; left: 92%; color: var(--pink-400); font-size: 18px; animation-delay: 0.5s; }
.heart.h2   { top: 60%; left: 50%; color: var(--pink-300); font-size: 16px; animation-delay: 1.7s; opacity: 0.4; }
.heart.h3   { top: 28%; left: 30%; color: var(--pink-300); font-size: 14px; animation-delay: 2.9s; opacity: 0.45; }

@keyframes floaty {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50%      { transform: translateY(-10px) rotate(8deg); }
}

/* Flash messages */
.flash-stack {
  position: fixed;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 50;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: min(420px, 92vw);
}
.flash {
  padding: 12px 16px;
  border-radius: var(--radius-md);
  font-weight: 600;
  background: white;
  box-shadow: var(--shadow);
  border: 1.5px solid var(--pink-200);
  color: var(--pink-700);
  text-align: center;
  animation: dropin 0.35s ease;
}
.flash-error { border-color: #ffb1cb; background: #fff0f6; }
@keyframes dropin {
  from { opacity: 0; transform: translateY(-12px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ===== LOGIN ===== */
.login-shell {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}
.login-card {
  width: min(420px, 100%);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
  border: 1.5px solid var(--pink-200);
  border-radius: var(--radius-lg);
  padding: 36px 32px 28px;
  box-shadow: var(--shadow);
  text-align: center;
}
.login-logo {
  width: 110px;
  height: 110px;
  margin: -90px auto 8px;
  background: white;
  border-radius: 50%;
  border: 3px solid var(--pink-200);
  display: grid;
  place-items: center;
  box-shadow: 0 10px 24px rgba(255, 72, 164, 0.20);
}
.login-logo img {
  width: 78%;
  height: 78%;
  object-fit: contain;
}
.login-title {
  font-family: "Pacifico", cursive;
  color: var(--pink-600);
  font-size: 30px;
  font-weight: 400;
  margin: 8px 0 0;
}
.login-title span { color: var(--pink-400); }
.login-subtitle {
  color: var(--pink-700);
  font-size: 14px;
  margin: 6px 0 24px;
  opacity: 0.85;
}
.login-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  text-align: left;
}
.login-foot {
  margin: 22px 0 0;
  font-size: 12px;
  color: var(--pink-400);
  font-style: italic;
}

/* ===== FIELDS ===== */
.field-block {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.field-label {
  font-weight: 600;
  font-size: 13px;
  color: var(--pink-700);
  letter-spacing: 0.2px;
}
.field-label em {
  color: var(--pink-500);
  font-style: normal;
  margin-left: 2px;
}
.field-block input,
.field-block textarea {
  font-family: inherit;
  font-size: 15px;
  color: var(--ink);
  background: white;
  border: 1.5px solid var(--pink-200);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  outline: none;
  transition: border-color 0.18s, box-shadow 0.18s, transform 0.18s;
  width: 100%;
}
.field-block textarea {
  resize: vertical;
  min-height: 140px;
  line-height: 1.55;
}
.field-block input::placeholder,
.field-block textarea::placeholder {
  color: var(--pink-300);
}
.field-block input:focus,
.field-block textarea:focus {
  border-color: var(--pink-400);
  box-shadow: 0 0 0 4px rgba(255, 126, 185, 0.22);
}

/* ===== BUTTONS ===== */
.btn-primary,
.btn-secondary,
.btn-ghost {
  font-family: inherit;
  font-weight: 700;
  font-size: 15px;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  padding: 13px 22px;
  transition: transform 0.15s, box-shadow 0.15s, background 0.18s, color 0.18s;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  justify-content: center;
}
.btn-primary {
  background: linear-gradient(135deg, var(--pink-400), var(--pink-600));
  color: white;
  box-shadow: 0 8px 20px rgba(255, 72, 164, 0.35);
  width: 100%;
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 12px 26px rgba(255, 72, 164, 0.45); }
.btn-primary:active { transform: translateY(0); }
.btn-glow { animation: pop 1.6s ease-in-out infinite; }
@keyframes pop {
  0%, 100% { transform: scale(1); opacity: 1; }
  50%      { transform: scale(1.25); opacity: 0.7; }
}
.btn-secondary {
  background: white;
  color: var(--pink-600);
  border: 1.5px solid var(--pink-300);
  box-shadow: 0 4px 12px rgba(255, 126, 185, 0.18);
}
.btn-secondary:hover { background: var(--pink-50); transform: translateY(-1px); }
.btn-ghost {
  background: transparent;
  color: var(--pink-700);
  padding: 8px 16px;
  font-size: 13px;
  border: 1.5px solid var(--pink-200);
}
.btn-ghost:hover { background: var(--pink-50); }

/* ===== TOPBAR ===== */
.topbar {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 28px;
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--pink-100);
}
.topbar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}
.topbar-brand img {
  width: 46px;
  height: 46px;
  object-fit: contain;
  filter: drop-shadow(0 4px 8px rgba(255, 72, 164, 0.25));
}
.topbar-title {
  font-family: "Pacifico", cursive;
  color: var(--pink-600);
  font-size: 20px;
}
.topbar-sub {
  color: var(--pink-700);
  font-size: 12px;
  opacity: 0.75;
}

/* ===== FORM PAGE ===== */
.form-shell {
  position: relative;
  z-index: 1;
  max-width: 920px;
  margin: 28px auto 80px;
  padding: 0 20px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}
.card {
  background: rgba(255, 255, 255, 0.94);
  border: 1.5px solid var(--pink-200);
  border-radius: var(--radius-lg);
  padding: 28px 28px;
  box-shadow: var(--shadow);
}
.card-head h1,
.card-head h2 {
  font-family: "Pacifico", cursive;
  color: var(--pink-600);
  margin: 0 0 4px;
  font-weight: 400;
}
.card-head h1 { font-size: 28px; }
.card-head h2 { font-size: 22px; }
.card-head .emoji { color: var(--pink-400); margin-left: 6px; }
.card-head p {
  color: var(--pink-700);
  margin: 0 0 22px;
  font-size: 14px;
  opacity: 0.85;
}

.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px 14px;
}
.col-span-2 { grid-column: span 2; }
.col-span-3 { grid-column: span 3; }
@media (max-width: 720px) {
  .grid { grid-template-columns: repeat(2, 1fr); }
  .col-span-2 { grid-column: span 2; }
  .col-span-3 { grid-column: span 2; }
}
@media (max-width: 480px) {
  .grid { grid-template-columns: 1fr; }
  .col-span-2 { grid-column: span 1; }
  .col-span-3 { grid-column: span 1; }
  .topbar { padding: 14px 16px; }
  .topbar-brand img { width: 38px; height: 38px; }
  .topbar-title { font-size: 17px; }
}

.actions {
  margin-top: 22px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
}
.actions .btn-primary { width: auto; }
.actions-spacer { flex: 1; }
.btn-pill {
  font-size: 13px;
  padding: 10px 18px;
}
.actions-note {
  margin: 12px 0 0;
  text-align: right;
  color: var(--pink-500);
  font-size: 12px;
  font-style: italic;
  opacity: 0.85;
}
@media (max-width: 600px) {
  .actions-spacer { display: none; }
  .actions { justify-content: stretch; }
  .actions > * { flex: 1 1 100%; }
  .actions-note { text-align: center; }
}

/* ===== RECETAS LIST ===== */
.recetas-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 320px;
  overflow-y: auto;
}
.recetas-list a {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: var(--pink-50);
  border: 1px solid var(--pink-100);
  transition: background 0.15s, transform 0.15s;
  text-decoration: none;
  color: var(--pink-700);
}
.recetas-list a:hover {
  background: var(--pink-100);
  transform: translateX(4px);
  text-decoration: none;
}
.recetas-list .filename {
  font-size: 13px;
  font-weight: 600;
  word-break: break-all;
}
.recetas-list .meta {
  font-size: 11px;
  color: var(--pink-500);
  white-space: nowrap;
}

/* ===== TOPBAR NAV ===== */
.topbar-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ===== CARD HEAD ROW (recetas section) ===== */
.card-head-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
}
.card-head-row > div { flex: 1; }
.card-head-row p { margin-bottom: 0; }

/* ===== FILTROS ===== */
.filters {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr auto;
  gap: 12px;
  align-items: end;
}
.filters .field-block { gap: 4px; }
.filter-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}
@media (max-width: 720px) {
  .filters {
    grid-template-columns: 1fr 1fr;
  }
  .filter-actions { grid-column: 1 / -1; justify-content: stretch; }
  .filter-actions > * { flex: 1; }
}

/* ===== RECETA CARDS ===== */
.receta-cards {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.receta-item {
  display: flex;
  gap: 16px;
  justify-content: space-between;
  align-items: stretch;
  padding: 14px 16px;
  background: var(--pink-50);
  border: 1px solid var(--pink-100);
  border-radius: var(--radius-md);
  transition: background 0.15s, border-color 0.15s, transform 0.15s;
}
.receta-item:hover {
  background: var(--pink-100);
  border-color: var(--pink-200);
}
.receta-item-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.receta-item-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
}
.receta-name {
  font-weight: 700;
  font-size: 16px;
  color: var(--pink-700);
  font-family: "Pacifico", cursive;
  font-weight: 400;
  line-height: 1.2;
}
.receta-when {
  font-size: 12px;
  color: var(--pink-500);
  white-space: nowrap;
}
.receta-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 2px;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: white;
  border: 1px solid var(--pink-200);
  color: var(--pink-700);
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 11px;
  font-weight: 600;
}
.chip-warn {
  background: #fff7e6;
  border-color: #ffd699;
  color: #b8650f;
}
.receta-line {
  font-size: 13px;
  color: var(--ink);
  line-height: 1.45;
  word-break: break-word;
}
.receta-line .lbl {
  color: var(--pink-600);
  font-weight: 700;
  margin-right: 4px;
}
.receta-line.receta-rx {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  white-space: pre-wrap;
}
.receta-line.receta-otro { color: var(--pink-700); font-style: italic; }

.receta-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: stretch;
  justify-content: flex-start;
  min-width: 130px;
}
.receta-actions .btn-pill {
  text-align: center;
  white-space: nowrap;
  width: 100%;
}
.btn-danger { color: #b8175f; }
.btn-danger:hover { background: #ffe2ec; }

@media (max-width: 600px) {
  .receta-item { flex-direction: column; }
  .receta-actions { flex-direction: row; min-width: 0; }
}

.empty {
  text-align: center;
  color: var(--pink-500);
  padding: 24px 8px;
  font-style: italic;
}

/* ===== FOOTER ===== */
.foot {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 20px 16px 28px;
  font-size: 12px;
  color: var(--pink-500);
  font-style: italic;
}
