:root {
  --ink: #181111;
  --muted: #8b8380;
  --line: #e8e2df;
  --bg-soft: #faf7f5;
  --accent: #d9491f;
  --accent-dark: #b53a17;
  --accent-tint: #fbe9e2;
  --radius: 9px;
  --radius-lg: 16px;
  --shadow: 0 1px 2px rgba(24, 17, 17, 0.04), 0 4px 14px rgba(24, 17, 17, 0.06);
  --shadow-hover: 0 4px 10px rgba(24, 17, 17, 0.06), 0 10px 26px rgba(24, 17, 17, 0.1);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  font-family: Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: var(--bg-soft);
  margin: 0;
  -webkit-font-smoothing: antialiased;
}

button {
  font-family: inherit;
}

/* ---------- Landing / sign-in ---------- */

.split {
  display: flex;
  min-height: 100vh;
}

.split .pane {
  flex: 1;
  min-width: 0;
}

.split .left {
  background: #fff;
  display: flex;
  flex-direction: column;
  padding: 36px 44px;
}

.split .left .brand {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.split .left .mid {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  width: 100%;
  max-width: 380px;
  margin: 0 auto;
  padding: 28px 0;
}

.split .left h1 {
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -1px;
  line-height: 1.1;
  margin: 0 0 10px;
}

.split .left .sub {
  font-size: 15px;
  color: var(--muted);
  margin: 0 0 24px;
}

.split .left .foot {
  text-align: center;
  font-size: 12px;
  color: #b8b0ac;
}

.btn-google {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 12px;
  background: #fff;
  color: #3c4043;
  border: 1px solid rgba(0, 0, 0, 0.18);
  border-radius: var(--radius);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}

.btn-google:hover {
  background: #f7f7f7;
}

.message-error {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: var(--radius);
  background: rgba(214, 69, 46, 0.08);
  color: #c0392b;
  font-size: 13px;
  font-weight: 500;
}

.split .right {
  color: #fff;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 56px;
  background: radial-gradient(50% 44% at 14% 12%, rgba(224, 62, 45, 0.78) 0%, transparent 60%),
    radial-gradient(46% 42% at 88% 20%, rgba(244, 162, 61, 0.6) 0%, transparent 58%),
    radial-gradient(52% 50% at 80% 92%, rgba(74, 145, 90, 0.5) 0%, transparent 60%),
    radial-gradient(50% 48% at 28% 96%, rgba(196, 118, 56, 0.45) 0%, transparent 60%),
    linear-gradient(155deg, #231512 0%, #3a1e16 46%, #4a2416 100%);
}

.split .right::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image: radial-gradient(rgba(255, 255, 255, 0.13) 0.5px, transparent 0.6px),
    radial-gradient(rgba(0, 0, 0, 0.2) 0.5px, transparent 0.6px);
  background-size: 3px 3px, 3px 3px;
  background-position: 0 0, 1.5px 1.5px;
  mix-blend-mode: overlay;
  opacity: 0.6;
}

.split .right .inner {
  position: relative;
  z-index: 1;
  max-width: 460px;
}

.split .right h2 {
  font-size: 36px;
  font-weight: 800;
  letter-spacing: -1.2px;
  line-height: 1.1;
  margin: 0 0 16px;
}

.split .right .rsub {
  font-size: 16px;
  color: rgba(255, 255, 255, 0.85);
  line-height: 1.5;
  margin: 0 0 24px;
}

.rfeat {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 13px;
  margin: 0;
  padding: 0;
}

.rfeat li {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  font-size: 15px;
  color: rgba(255, 255, 255, 0.92);
}

.rfeat .emoji {
  flex-shrink: 0;
  font-size: 17px;
  line-height: 1.4;
}

@media (max-width: 860px) {
  .split {
    flex-direction: column;
    min-height: 0;
  }
  .split .left {
    padding: 28px 22px;
  }
  .split .left .mid {
    padding: 20px 0 6px;
  }
  .split .left h1 {
    font-size: 27px;
  }
  .split .right {
    padding: 38px 24px;
  }
  .split .right h2 {
    font-size: 27px;
  }
  .split .right .rsub {
    font-size: 15px;
  }
}

/* ---------- Signed-in app ---------- */

#app-shell {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 1.25rem 3rem;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.4rem 0;
  position: sticky;
  top: 0;
  background: var(--bg-soft);
  z-index: 10;
}

.topbar .brand-small {
  font-size: 21px;
  font-weight: 800;
  letter-spacing: -0.5px;
}

#auth-bar {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  font-size: 0.88rem;
  color: var(--muted);
}

/* Buttons */

button {
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease,
    transform 0.05s ease;
}

button:active {
  transform: scale(0.97);
}

button:disabled,
input:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.btn-primary {
  padding: 0.65rem 1.2rem;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(217, 73, 31, 0.28);
}

.btn-primary:hover {
  background: var(--accent-dark);
}

.btn-secondary {
  padding: 0.6rem 1.1rem;
  background: #fff;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
}

.btn-secondary:hover {
  background: var(--bg-soft);
  border-color: #d8d0cc;
}

/* Lists bar: tabs, new-list form, share panel */

#lists-bar {
  margin-bottom: 1.1rem;
}

.list-tabs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.list-tab {
  padding: 0.5rem 1rem;
  background: #fff;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
}

.list-tab:hover {
  background: var(--bg-soft);
  color: var(--ink);
}

.list-tab.active {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}

.list-tab.drop-target {
  background: var(--accent-tint);
  border-color: var(--accent);
  color: var(--accent-dark);
  box-shadow: 0 0 0 3px var(--accent-tint);
}

.list-tab-new {
  border-radius: 999px;
}

.new-list-form,
.invite-row {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.7rem;
}

.new-list-form input,
.invite-row input {
  flex: 1;
  padding: 0.55rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  font-size: 0.92rem;
}

.invite-row select {
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  font-size: 0.9rem;
}

.list-share-toggle {
  margin-top: 0.7rem;
}

#list-share-panel {
  margin-top: 0.9rem;
  padding: 1.1rem 1.3rem;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

#list-share-panel h3 {
  margin: 0 0 0.8rem;
  font-size: 0.95rem;
  font-weight: 700;
}

.member-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.member-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 0.7rem;
  background: var(--bg-soft);
  border-radius: var(--radius);
  font-size: 0.88rem;
}

.member-email {
  flex: 1;
  font-weight: 600;
}

.member-role {
  color: var(--muted);
}

.readonly-notice {
  color: var(--muted);
  font-size: 0.88rem;
  margin: 0.6rem 0 0;
}

.list-membership {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.list-membership-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
}

.list-membership-row input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
}

/* Add-recipe form + filters */

#add-form {
  display: flex;
  gap: 0.6rem;
}

#url-input,
#search-input,
#tag-filter,
.tag-editor input,
.edit-form textarea {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  font-size: 0.95rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

#url-input:focus,
#search-input:focus,
#tag-filter:focus,
.tag-editor input:focus,
.edit-form textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-tint);
}

#url-input {
  flex: 1;
  padding: 0.65rem 0.9rem;
}

#filters {
  display: flex;
  gap: 0.6rem;
  margin: 1.1rem 0 1.4rem;
}

#search-input {
  flex: 1;
  padding: 0.6rem 0.9rem;
}

#tag-filter {
  padding: 0.6rem 0.9rem;
}

/* Recipe cards */

#recipes {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.recipe {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 1.1rem 1.3rem;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: box-shadow 0.18s ease, border-color 0.18s ease;
}

.recipe:hover {
  box-shadow: var(--shadow-hover);
  border-color: #ece4e0;
}

.recipe.dragging {
  opacity: 0.4;
}

.recipe .thumb {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.recipe .thumb img {
  width: 64px;
  height: 64px;
  object-fit: cover;
  border-radius: 10px;
  flex-shrink: 0;
}

.recipe .thumb h2 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.2px;
}

.recipe .details {
  display: none;
}

.recipe.expanded .details {
  display: block;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}

.recipe.expanded .details img {
  max-width: 100%;
  max-height: 260px;
  border-radius: var(--radius);
  margin-bottom: 0.75rem;
}

.recipe .meta {
  color: var(--muted);
  font-size: 0.88rem;
}

.link-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin: 0.75rem 0;
}

.btn-whatsapp {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.45rem 0.9rem;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
}

.btn-whatsapp:hover {
  background: var(--bg-soft);
  border-color: #d8d0cc;
}

.btn-whatsapp svg {
  color: #25d366;
  flex-shrink: 0;
}

.recipe .details h3 {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
  margin: 1.2rem 0 0.6rem;
}

.recipe .details h3:first-child {
  margin-top: 0;
}

.recipe .details ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.recipe .details ul li {
  position: relative;
  padding-left: 1.3rem;
  padding-bottom: 0.5rem;
  line-height: 1.45;
}

.recipe .details ul li::before {
  content: "";
  position: absolute;
  left: 0.15rem;
  top: 0.55rem;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

.recipe .details ol {
  list-style: none;
  counter-reset: step;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.recipe .details ol li {
  counter-increment: step;
  position: relative;
  padding-left: 2.3rem;
  line-height: 1.5;
  min-height: 1.7rem;
}

.recipe .details ol li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0;
  width: 1.6rem;
  height: 1.6rem;
  border-radius: 50%;
  background: var(--accent-tint);
  color: var(--accent-dark);
  font-size: 0.78rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.card-actions {
  float: right;
  display: flex;
  gap: 0.3rem;
}

.recipe button.delete {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  background: none;
  border: none;
  border-radius: 8px;
  color: var(--muted);
  cursor: pointer;
}

.recipe button.delete:hover {
  background: var(--accent-tint);
  color: var(--accent-dark);
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0.5rem 0;
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: var(--accent-tint);
  color: var(--accent-dark);
  border: none;
  border-radius: 999px;
  padding: 0.2rem 0.7rem;
  font-size: 0.78rem;
  font-weight: 600;
}

.tag button {
  border: none;
  background: none;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  font-size: 0.95rem;
  color: inherit;
  opacity: 0.7;
}

.tag button:hover {
  opacity: 1;
}

.tag-editor {
  display: flex;
  gap: 0.5rem;
  margin: 0.6rem 0;
}

.tag-editor input {
  flex: 1;
  padding: 0.45rem 0.7rem;
}

.tag-editor button {
  padding: 0.45rem 0.9rem;
  background: #fff;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
}

.tag-editor button:hover {
  background: var(--bg-soft);
}

.details .actions {
  margin-top: 1rem;
  display: flex;
  gap: 0.5rem;
}

.edit-form label {
  display: block;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-top: 1rem;
  margin-bottom: 0.5rem;
}

.edit-form textarea {
  width: 100%;
  min-height: 100px;
  padding: 0.65rem 0.8rem;
  font-family: inherit;
  font-size: 0.92rem;
}

#preview {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 1.3rem 1.4rem;
  margin: 0 0 1.4rem;
  background: #fff;
  box-shadow: var(--shadow);
}

#preview:empty {
  display: none;
  border: none;
  padding: 0;
  margin: 0;
}

#preview h2 {
  margin-top: 0;
  font-size: 1.25rem;
  letter-spacing: -0.3px;
}

#preview .actions {
  margin-top: 1.1rem;
  display: flex;
  gap: 0.5rem;
}
