/* ================================================================
   Recetas de Mi Corazón — Paleta ciruelo
   ================================================================ */
:root {
  --p1:          #4A1942;   /* Ciruelo oscuro — principal */
  --p1-dark:     #35112E;   /* Hover del principal */
  --p2:          #855C75;   /* Malva — secundario */
  --p3:          #D9BFC5;   /* Rosa suave — acentos claros */
  --bg:          #FAF5F7;   /* Fondo página */
  --bg-card:     #FFFFFF;
  --bg-sidebar:  #F5ECF0;
  --text:        #1A0818;
  --text-muted:  #5C3A4E;
  --text-hint:   #9A7080;
  --border:      #E8D0D8;
  --border-med:  #C8A8B8;
  /* Texto SOBRE fondos oscuros (#4A1942) */
  --on-dark:     #F5EAF0;   /* Texto principal sobre oscuro */
  --on-dark-dim: #C8A0B8;   /* Texto secundario/apagado sobre oscuro */
  --font-serif:  'Georgia', 'Times New Roman', serif;
  --font-sans:   'Helvetica Neue', 'Helvetica', Arial, sans-serif;
  --radius:      6px;
  --radius-lg:   10px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html  { font-size: 16px; scroll-behavior: smooth; }
img   { max-width: 100%; display: block; }
a     { color: var(--p1); text-decoration: none; }
a:hover { text-decoration: underline; }
body  {
  font-family:    var(--font-sans);
  background:     var(--bg);
  color:          var(--text);
  line-height:    1.6;
  min-height:     100vh;
  display:        flex;
  flex-direction: column;
}
main { flex: 1; }

/* ── Admin bar ───────────────────────────────────────────────── */
.admin-bar {
  background:   var(--p1);
  color:        var(--on-dark);       /* ← Claro sobre oscuro */
  padding:      0 28px;
  height:       40px;
  display:      flex;
  align-items:  center;
  gap:          12px;
  font-size:    12px;
  font-weight:  400;
  letter-spacing: .2px;
  border-top:   3px solid var(--p2);
}
.admin-bar strong { color: #FFFFFF; font-weight: 600; }
.admin-bar .dot   { color: var(--p3); }
.admin-bar span[style*="opacity"] { color: var(--on-dark-dim); opacity: 1 !important; }
.admin-bar .spacer { margin-left: auto; display: flex; gap: 8px; }

.btn-admin {
  background:    rgba(245,234,240,.12);
  color:         var(--on-dark);
  border:        1px solid rgba(245,234,240,.25);
  padding:       4px 14px;
  border-radius: var(--radius);
  font-size:     11px;
  font-family:   var(--font-sans);
  cursor:        pointer;
  text-decoration: none;
  display:       inline-flex;
  align-items:   center;
  gap:           5px;
  transition:    background .15s;
}
.btn-admin:hover {
  background: rgba(245,234,240,.22);
  color: #FFFFFF;
  text-decoration: none;
}
.btn-admin.primary {
  background:   var(--p2);
  border-color: var(--p2);
  color:        #FFFFFF;
}
.btn-admin.primary:hover { background: #6E4A60; }

/* ── Nav ─────────────────────────────────────────────────────── */
.site-nav {
  background:    var(--bg-card);
  border-bottom: 3px solid var(--p1);
  padding:       0 28px;
  height:        62px;
  display:       flex;
  align-items:   center;
  justify-content: space-between;
  position:      sticky;
  top:           0;
  z-index:       100;
}
.site-logo {
  font-family:   var(--font-serif);
  font-size:     23px;
  font-weight:   700;
  color:         var(--text);
  letter-spacing: -.5px;
  text-decoration: none;
  line-height:   1.15;
}
.site-logo span { color: var(--p1); }
.site-logo em {
  display:     block;
  font-style:  normal;
  font-size:   9px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color:       var(--p2);
  font-family: var(--font-sans);
  font-weight: 500;
  margin-top:  1px;
}
.nav-links { display: flex; align-items: center; gap: 22px; font-size: 13px; }
.nav-links a { color: var(--text-muted); transition: color .15s; }
.nav-links a:hover { color: var(--p1); text-decoration: none; }
.btn-login {
  background:   var(--p1);
  color:        #FFFFFF !important;
  padding:      8px 18px;
  border-radius: var(--radius);
  font-size:    12px;
  letter-spacing: .6px;
  text-transform: uppercase;
  font-weight:  600;
  transition:   background .15s;
}
.btn-login:hover { background: var(--p1-dark) !important; text-decoration: none; }
.nav-user { font-size: 13px; color: var(--text-muted); }

/* ── Hero ────────────────────────────────────────────────────── */
.hero { display: grid; grid-template-columns: 1fr 1fr;
  border-bottom: 1px solid var(--border); min-height: 320px; }
.hero-text { padding: 48px 44px 44px; display: flex; flex-direction: column;
  justify-content: center; gap: 14px; }
.hero-eyebrow { font-size: 10px; letter-spacing: 2.5px; text-transform: uppercase;
  color: var(--p2); font-weight: 700; }
.hero-title { font-family: var(--font-serif); font-size: 38px; line-height: 1.1;
  letter-spacing: -1px; }
.hero-desc { font-size: 14px; color: var(--text-muted); line-height: 1.7; max-width: 340px; }
.hero-meta { display: flex; gap: 16px; font-size: 13px; color: var(--text-hint); flex-wrap: wrap; }
.hero-cta { margin-top: 6px; display: inline-block; background: var(--p1); color: white;
  padding: 11px 24px; border-radius: var(--radius); font-size: 12px;
  letter-spacing: .8px; text-transform: uppercase; font-weight: 600; width: fit-content;
  transition: background .15s; }
.hero-cta:hover { background: var(--p1-dark); text-decoration: none; }
.hero-image { position: relative; overflow: hidden; aspect-ratio: 1/1; align-self: stretch;
  background: linear-gradient(135deg, var(--p3) 0%, var(--p2) 60%, var(--p1) 100%);
  display: flex; align-items: center; justify-content: center; }
.hero-image .food-emoji { font-size: 100px; opacity: .6; transform: rotate(-8deg); }
.hero-image-uploaded { position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; object-position: center; }
.hero-badge { position: absolute; top: 14px; left: 14px; }

/* ── Badges ──────────────────────────────────────────────────── */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px;
  border-radius: 4px; font-size: 10px; font-weight: 700; letter-spacing: .4px;
  text-transform: uppercase; white-space: nowrap; }
.badge-pub  { background: #EFE0F0; color: #3A0E34; }
.badge-vip  { background: var(--p3); color: var(--p1); }
.badge-link { background: #F5E8F0; color: #6A2A58; }
.badge-priv { background: #F0E8EC; color: #7A4060; }

/* ── Tags ────────────────────────────────────────────────────── */
.tag-pill { display: inline-block; background: var(--bg-sidebar);
  color: var(--text-muted); border: 1px solid var(--border); padding: 4px 12px;
  border-radius: 20px; font-size: 12px; text-decoration: none;
  transition: all .15s; white-space: nowrap; }
.tag-pill:hover { background: var(--p1); color: white; border-color: var(--p1); text-decoration: none; }
.tag-pill.active { background: var(--p1); color: white; border-color: var(--p1); }
.tags-row { display: flex; flex-wrap: wrap; gap: 6px; }
.tag-strip { padding: 10px 28px; border-bottom: 1px solid var(--border);
  background: var(--bg); overflow-x: auto; }
.tag-strip .tags-row { flex-wrap: nowrap; }

/* ── Filter bar ──────────────────────────────────────────────── */
.filter-bar { display: flex; align-items: center; gap: 10px; padding: 14px 28px;
  border-bottom: 1px solid var(--border); background: var(--bg); flex-wrap: wrap; }
.filter-bar input[type=text], .filter-bar select { padding: 8px 12px;
  border: 1px solid var(--border); border-radius: var(--radius);
  font-size: 13px; font-family: var(--font-sans); background: var(--bg-card); color: var(--text); }
.filter-bar input[type=text] { flex: 1; min-width: 140px; }
.filter-bar input:focus, .filter-bar select:focus { outline: none; border-color: var(--p1); }
.filter-bar button { padding: 8px 18px; background: var(--p1); color: white;
  border: none; border-radius: var(--radius); font-size: 13px;
  font-family: var(--font-sans); cursor: pointer; transition: background .15s; }
.filter-bar button:hover { background: var(--p1-dark); }

/* ── Section ─────────────────────────────────────────────────── */
.section { padding: 32px 28px; }
.section-header { display: flex; align-items: baseline; justify-content: space-between;
  margin-bottom: 22px; padding-bottom: 12px; border-bottom: 2px solid var(--p1); }
.section-title { font-family: var(--font-serif); font-size: 22px; letter-spacing: -.3px; }
.section-link { font-size: 12px; color: var(--p1); }

/* ── Recipe grid ─────────────────────────────────────────────── */
.recipe-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(220px,1fr)); gap: 20px; }
.recipe-card { background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); overflow: hidden;
  transition: transform .2s, box-shadow .2s; text-decoration: none; color: inherit; display: block; }
.recipe-card:hover { transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(74,25,66,.12); text-decoration: none; }

/* Imagen SIEMPRE cuadrada */
.recipe-card-img { aspect-ratio: 1/1; width: 100%; position: relative; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--p3) 0%, var(--p2) 100%); }
.recipe-card-img img { position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; object-position: center; }
.recipe-card-img .food-emoji { font-size: 52px; opacity: .65; }
.recipe-card-badge { position: absolute; top: 8px; right: 8px; }
.recipe-card-body { padding: 13px 15px 15px; }
.recipe-card-cat { font-size: 10px; text-transform: uppercase; letter-spacing: 1.2px;
  color: var(--p2); font-weight: 700; margin-bottom: 4px; }
.recipe-card-title { font-family: var(--font-serif); font-size: 16px; line-height: 1.3;
  color: var(--text); margin-bottom: 8px; }
.recipe-card-meta { display: flex; gap: 10px; font-size: 11px; color: var(--text-hint); }
.cook-count { font-size: 11px; color: var(--text-hint); margin-top: 4px; }

/* VIP lock */
.recipe-card-locked .recipe-card-img::after { content: ''; position: absolute; inset: 0;
  backdrop-filter: blur(5px); background: rgba(74,25,66,.3); }
.lock-icon { position: absolute; inset: 0; display: flex; align-items: center;
  justify-content: center; z-index: 2; }
.lock-circle { width: 38px; height: 38px; background: rgba(255,255,255,.92);
  border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 17px; }

/* ── Recipe page ─────────────────────────────────────────────── */
.recipe-page { max-width: 860px; margin: 0 auto; padding: 44px 28px; }
.recipe-page-eyebrow { font-size: 11px; text-transform: uppercase; letter-spacing: 1.5px;
  color: var(--p2); font-weight: 700; margin-bottom: 10px; }
.recipe-page-title { font-family: var(--font-serif); font-size: 40px; line-height: 1.1;
  letter-spacing: -1.5px; margin-bottom: 16px; }
.recipe-page-desc { font-size: 16px; color: var(--text-muted); line-height: 1.7;
  max-width: 560px; margin-bottom: 20px; }
/* Imagen individual CUADRADA */
.recipe-page-image { width: 100%; aspect-ratio: 1/1; object-fit: cover;
  object-position: center; border-radius: var(--radius-lg); margin-bottom: 36px; display: block; }
.recipe-stats { display: flex; gap: 28px; flex-wrap: wrap; padding: 18px 0;
  border-top: 2px solid var(--p1); border-bottom: 1px solid var(--border); margin-bottom: 36px; }
.recipe-stat { text-align: center; }
.recipe-stat-val { font-family: var(--font-serif); font-size: 22px; font-weight: 700;
  display: block; color: var(--p1); }
.recipe-stat-label { font-size: 11px; text-transform: uppercase; letter-spacing: .8px; color: var(--text-hint); }
.recipe-body { display: grid; grid-template-columns: 1fr 2fr; gap: 48px; }
.recipe-ingredients h2, .recipe-instructions h2 { font-family: var(--font-serif); font-size: 18px;
  margin-bottom: 16px; padding-bottom: 8px; border-bottom: 3px solid var(--p3); display: inline-block; }
.recipe-ingredients ul { list-style: none; display: flex; flex-direction: column; }
.recipe-ingredients li { font-size: 15px; padding: 9px 0; border-bottom: 1px solid var(--border);
  display: flex; align-items: flex-start; gap: 8px; }
.recipe-ingredients li::before { content: '—'; color: var(--p2); font-weight: 700; flex-shrink: 0; margin-top: 1px; }
.recipe-instructions ol { list-style: none; display: flex; flex-direction: column;
  gap: 20px; counter-reset: step; }
.recipe-instructions li { display: flex; gap: 16px; counter-increment: step; }
.recipe-instructions li::before { content: counter(step); min-width: 32px; height: 32px;
  background: var(--p1); color: white; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; flex-shrink: 0; margin-top: 2px; }
.recipe-instructions li p { font-size: 15px; line-height: 1.7; padding-top: 4px; }
.recipe-tags { margin-top: 32px; }
.private-notes { background: #FAF0F4; border: 1px solid var(--p3);
  border-radius: var(--radius); padding: 18px 20px; margin-top: 32px; }
.private-notes h3 { font-size: 13px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .8px; color: var(--p2); margin-bottom: 8px; }
.private-notes p { font-size: 14px; color: var(--text-muted); line-height: 1.6; }

/* ── Login / Registro ────────────────────────────────────────── */
.login-wrap { min-height: 60vh; display: flex; align-items: center;
  justify-content: center; padding: 40px 20px; }
.login-card { background: var(--bg-card); border: 1px solid var(--border);
  border-top: 4px solid var(--p1); border-radius: var(--radius-lg);
  padding: 40px 44px; width: 100%; max-width: 380px; }
.login-card h1 { font-family: var(--font-serif); font-size: 26px; margin-bottom: 6px; }
.login-card .subtitle { font-size: 14px; color: var(--text-muted); margin-bottom: 28px; }

/* ── Forms ───────────────────────────────────────────────────── */
.form-group { margin-bottom: 18px; }
.form-group label { display: block; font-size: 12px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .6px; color: var(--text-muted); margin-bottom: 6px; }
.form-group input[type=text], .form-group input[type=email],
.form-group input[type=password], .form-group input[type=number],
.form-group textarea, .form-group select { width: 100%; padding: 9px 13px;
  border: 1px solid var(--border); border-radius: var(--radius);
  font-size: 14px; font-family: var(--font-sans); background: var(--bg-card); color: var(--text);
  transition: border-color .15s; }
.form-group input:focus, .form-group textarea:focus, .form-group select:focus {
  outline: none; border-color: var(--p1); box-shadow: 0 0 0 3px rgba(74,25,66,.1); }
.form-group textarea { resize: vertical; min-height: 120px; line-height: 1.6; }
.form-hint { font-size: 11px; color: var(--text-hint); margin-top: 4px; }
.btn-submit { width: 100%; padding: 12px; background: var(--p1); color: white;
  border: none; border-radius: var(--radius); font-size: 14px; font-family: var(--font-sans);
  font-weight: 700; cursor: pointer; transition: background .15s; letter-spacing: .3px; }
.btn-submit:hover { background: var(--p1-dark); }

/* ── Visibility selector ─────────────────────────────────────── */
.vis-selector { display: flex; flex-direction: column; gap: 8px; }
.vis-option { display: flex; align-items: flex-start; gap: 12px; padding: 12px 14px;
  border: 2px solid var(--border); border-radius: var(--radius); cursor: pointer; transition: all .15s; }
.vis-option:hover { border-color: var(--border-med); }
.vis-option input[type=radio] { margin-top: 3px; accent-color: var(--p1); }
.vis-option.selected { border-color: var(--p1); background: #FBF0F4; }
.vis-option-title { font-size: 14px; font-weight: 700; margin-bottom: 2px; }
.vis-option-desc { font-size: 12px; color: var(--text-hint); }

/* ── Alert ───────────────────────────────────────────────────── */
.alert { padding: 12px 16px; border-radius: var(--radius); font-size: 14px; margin-bottom: 18px; }
.alert-ok  { background: #EFE0F0; color: #3A0E34; border: 1px solid var(--p3); }
.alert-err { background: #FFE0E8; color: #7A0A28; border: 1px solid #E8A0B0; }

/* ── Admin ───────────────────────────────────────────────────── */
.admin-wrap { max-width: 1000px; margin: 0 auto; padding: 36px 28px; }
.admin-page-title { font-family: var(--font-serif); font-size: 28px; letter-spacing: -.5px;
  margin-bottom: 28px; padding-bottom: 14px; border-bottom: 2px solid var(--p1);
  display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.admin-table th { text-align: left; padding: 10px 14px; border-bottom: 2px solid var(--p1);
  font-size: 11px; text-transform: uppercase; letter-spacing: .8px; color: var(--p1); font-weight: 700; }
.admin-table td { padding: 12px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.admin-table tr:hover td { background: var(--bg-sidebar); }
.recipe-title-cell { font-family: var(--font-serif); font-size: 15px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.btn-sm { padding: 5px 12px; font-size: 12px; border-radius: var(--radius); font-family: var(--font-sans);
  cursor: pointer; text-decoration: none; display: inline-flex; align-items: center;
  gap: 4px; border: 1px solid; transition: all .15s; }
.btn-edit  { color: var(--text-muted); border-color: var(--border); background: white; }
.btn-edit:hover { border-color: var(--p1); color: var(--p1); text-decoration: none; }
.btn-del   { color: #7A0A28; border-color: #E8A0B0; background: #FFE8EC; }
.btn-del:hover  { background: #FFD0D8; text-decoration: none; }
.btn-view  { color: #3A0E34; border-color: var(--p3); background: #F5EAF0; }
.btn-view:hover { background: var(--p3); text-decoration: none; }
.btn-copy  { color: #6A2A58; border-color: #C8A0B8; background: #F5E0EC; }
.btn-copy:hover { background: #EDD0E0; text-decoration: none; }
.admin-form { display: grid; grid-template-columns: 2fr 1fr; gap: 28px; align-items: start; }
.form-card { background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 22px 24px; margin-bottom: 18px; }
.form-card-title { font-size: 12px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .8px; color: var(--p1); margin-bottom: 16px; padding-bottom: 10px;
  border-bottom: 1px solid var(--border); }
.form-row   { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; }
.token-box { background: var(--bg-sidebar); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 10px 14px; font-size: 12px;
  font-family: monospace; color: var(--text-muted); word-break: break-all; margin-top: 8px; }

/* ── Stat cards ──────────────────────────────────────────────── */
.stat-card { background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 18px; text-align: center;
  border-top: 3px solid var(--p1); }
.stat-val { font-family: var(--font-serif); font-size: 36px; font-weight: 700;
  line-height: 1; color: var(--p1); }
.stat-label { font-size: 11px; text-transform: uppercase; letter-spacing: .8px;
  color: var(--text-hint); margin-top: 4px; }

/* ── Empty / Error ───────────────────────────────────────────── */
.empty-state { text-align: center; padding: 60px 20px; color: var(--text-hint); }
.empty-state-icon { font-size: 56px; margin-bottom: 14px; opacity: .6; }
.empty-state h2 { font-family: var(--font-serif); font-size: 22px;
  color: var(--text-muted); margin-bottom: 8px; }
.error-page { display: flex; flex-direction: column; align-items: center;
  justify-content: center; min-height: 60vh; text-align: center; padding: 40px; }
.error-page .code { font-family: var(--font-serif); font-size: 90px; font-weight: 700;
  color: var(--border-med); line-height: 1; margin-bottom: 8px; }
.error-page h1 { font-family: var(--font-serif); font-size: 26px; margin-bottom: 10px; }
.error-page p { color: var(--text-muted); margin-bottom: 24px; }

/* ── Footer ──────────────────────────────────────────────────── */
.site-footer {
  background:   var(--p1);
  color:        var(--on-dark);       /* ← Claro sobre oscuro */
  border-top:   3px solid var(--p2);
  padding:      24px 28px;
  text-align:   center;
  font-size:    12px;
  margin-top:   auto;
  letter-spacing: .3px;
}
.site-footer a { color: var(--p3); }
.site-footer a:hover { color: white; }

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 760px) {
  .hero { grid-template-columns: 1fr; }
  .hero-image { order: -1; }
  .hero-title { font-size: 28px; }
  .recipe-body { grid-template-columns: 1fr; }
  .admin-form { display: block; }
  .form-row, .form-row-3 { grid-template-columns: 1fr; }
  .section, .admin-wrap { padding: 20px 16px; }
  .site-nav { padding: 0 16px; }
  .hidden-mobile { display: none; }
  .filter-bar { padding: 12px 16px; }
  .tag-strip { padding: 8px 16px; }
  .recipe-page { padding: 28px 16px; }
  .recipe-page-title { font-size: 28px; }
  .login-card { padding: 28px 24px; }
}

/* ── Print ───────────────────────────────────────────────────── */
@media print {
  .btn-print, .admin-bar, .site-nav, .filter-bar, .tag-strip,
  .site-footer, .btn-sm, .btn-admin, .recipe-actions { display: none !important; }
  body { background: white; color: black; }
  .recipe-page-title { font-size: 22pt; }
  .recipe-stats { border-color: #ccc; }
  .recipe-instructions li::before { background: #555; }
}
