/* ══════════════════════════════════════════════════════
   BIRTHDAY CARD TOOL  –  "מה קרה ביום שנולדתם?"
   ══════════════════════════════════════════════════════ */

/* ── Wrapper section ── */
.birthday-tool {
  margin: 36px 0 40px;
}

/* ── Input panel ── */
.bday-panel {
  background: var(--ink);
  border-top: 3px solid var(--gold);
  box-shadow: 0 12px 40px rgba(20,17,10,.18), 0 3px 10px rgba(20,17,10,.1);
  overflow: hidden;
}

.bday-intro {
  padding: 26px 28px 22px;
  border-bottom: 1px solid rgba(255,255,255,.07);
}
.bday-badge {
  display: inline-block;
  background: var(--gold);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .1em;
  padding: 3px 10px;
  margin-bottom: 12px;
}
.bday-h2 {
  font-family: var(--serif);
  font-size: clamp(20px, 3vw, 28px);
  font-weight: 900;
  color: var(--bg);
  margin: 0 0 7px;
  line-height: 1.2;
}
.bday-sub {
  font-family: var(--sans);
  font-size: 12.5px;
  color: rgba(255,255,255,.48);
  margin: 0;
  line-height: 1.55;
}

/* ── Form ── */
.bday-form {
  padding: 20px 28px 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.bday-selects {
  display: flex;
  gap: 8px;
  direction: rtl;
}
.bday-select {
  flex: 1;
  min-width: 0;
  background: rgba(255,255,255,.07);
  border: 1.5px solid rgba(255,255,255,.14);
  color: var(--bg);
  font-family: var(--sans);
  font-size: 14px;
  padding: 10px 12px;
  cursor: pointer;
  transition: border-color .13s, background .13s;
  direction: rtl;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23c9a84c'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: left 10px center;
  padding-left: 28px;
}
.bday-select:focus {
  outline: none;
  border-color: var(--gold);
  background-color: rgba(255,255,255,.1);
}
.bday-select option { background: #1a1612; color: #faf7f0; }

.bday-submit {
  width: 100%;
  background: var(--gold);
  color: var(--ink);
  border: none;
  cursor: pointer;
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 900;
  letter-spacing: .04em;
  padding: 13px 24px;
  transition: background .13s;
}
.bday-submit:hover { background: color-mix(in srgb, var(--gold) 82%, #fff 18%); }
.bday-submit:disabled { opacity: .5; cursor: default; }

/* ── Loading state ── */
.bday-loading {
  background: var(--bg);
  padding: 28px 28px 24px;
  display: none;
  direction: rtl;
}
.bday-loading.visible { display: block; }

.bday-step-msg {
  font-family: var(--serif);
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
  margin: 0 0 8px;
}
.bday-eta {
  font-family: var(--sans);
  font-size: 12px;
  color: var(--ink3);
  margin: 0 0 16px;
}
.bday-progress-track {
  width: 100%;
  height: 6px;
  background: var(--bg3);
  overflow: hidden;
}
.bday-progress-fill {
  height: 100%;
  background: linear-gradient(to left, var(--gold), color-mix(in srgb, var(--gold) 60%, var(--red)));
  transition: width .6s ease;
  width: 0%;
}
.bday-steps-list {
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.bday-step-item {
  font-family: var(--sans);
  font-size: 11.5px;
  color: rgba(30,26,20,.4);
  display: flex;
  align-items: center;
  gap: 8px;
}
.bday-step-item.done  { color: #1a7a40; }
.bday-step-item.active { color: var(--ink); font-weight: 700; }
.bday-step-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
  background: currentColor;
  opacity: .35;
}
.bday-step-item.done  .bday-step-dot { opacity: 1; }
.bday-step-item.active .bday-step-dot { opacity: 1; animation: bday-pulse .9s ease infinite; }
@keyframes bday-pulse {
  0%,100% { opacity: 1; transform: scale(1); }
  50%      { opacity: .5; transform: scale(1.4); }
}

/* ── Error state ── */
.bday-error {
  display: none;
  padding: 16px 28px;
  background: #faf0f0;
  border-top: 2px solid #8b1c1c;
  font-family: var(--sans);
  font-size: 13px;
  color: #4a0e0e;
  direction: rtl;
}
.bday-error.visible { display: block; }

/* ════════════════════════════════════════════════════════
   CARD PREVIEW
   ════════════════════════════════════════════════════════ */
.bday-result {
  display: none;
  margin-top: 24px;
}
.bday-result.visible { display: block; }

/* Card frame – 9:16 look, capped width */
.bday-card-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 16px;
}
.bday-card {
  width: 100%;
  max-width: 400px;
  aspect-ratio: 9 / 16;
  background: var(--ink);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  direction: rtl;
  box-shadow: 0 20px 60px rgba(20,17,10,.35), 0 4px 16px rgba(20,17,10,.2);
}

/* Gold top bar */
.bday-card::before {
  content: '';
  display: block;
  height: 4px;
  flex-shrink: 0;
  background: linear-gradient(to left, transparent, var(--gold) 30%, color-mix(in srgb,var(--gold) 80%,#fff) 50%, var(--gold) 70%, transparent);
}
/* Gold bottom bar */
.bday-card::after {
  content: '';
  display: block;
  height: 2px;
  flex-shrink: 0;
  background: linear-gradient(to left, transparent, var(--gold) 30%, var(--gold) 70%, transparent);
  margin-top: auto;
}

.bday-card-logo {
  padding: 16px 20px 0;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.bday-card-logo-img {
  height: 22px;
  width: auto;
  filter: invert(1) brightness(0.9) sepia(0.2) saturate(3) hue-rotate(5deg);
}
.bday-card-logo-text {
  font-family: var(--serif);
  font-size: 12px;
  font-weight: 700;
  color: var(--gold);
  opacity: .8;
}

.bday-card-body {
  flex: 1;
  padding: 14px 20px 0;
  display: flex;
  flex-direction: column;
  gap: 0;
  overflow: hidden;
}

.bday-card-pretitle {
  font-family: var(--sans);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .12em;
  color: var(--gold);
  opacity: .75;
  margin-bottom: 4px;
}
.bday-card-date {
  font-family: var(--serif);
  font-size: clamp(28px, 8vw, 52px);
  font-weight: 900;
  color: var(--bg);
  line-height: 1.05;
  margin-bottom: 6px;
}
.bday-card-year {
  font-family: var(--sans);
  font-size: clamp(13px, 3.5vw, 18px);
  font-weight: 400;
  color: rgba(255,255,255,.55);
  margin-bottom: 18px;
}

.bday-card-divider {
  height: 1px;
  background: linear-gradient(to left, transparent, rgba(201,168,76,.4) 30%, rgba(201,168,76,.4) 70%, transparent);
  margin-bottom: 18px;
  flex-shrink: 0;
}

.bday-card-event-label {
  font-family: var(--sans);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: .14em;
  color: var(--gold);
  margin-bottom: 7px;
}
.bday-card-event-headline {
  font-family: var(--serif);
  font-size: clamp(15px, 4.2vw, 22px);
  font-weight: 700;
  color: var(--bg);
  line-height: 1.35;
  margin-bottom: 20px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.bday-card-facts-label {
  font-family: var(--sans);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: .14em;
  color: rgba(201,168,76,.65);
  margin-bottom: 8px;
}
.bday-card-facts {
  display: flex;
  flex-direction: column;
  gap: 7px;
  flex: 1;
  overflow: hidden;
}
.bday-card-fact {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}
.bday-card-fact-year {
  flex-shrink: 0;
  font-family: var(--sans);
  font-size: 9.5px;
  font-weight: 700;
  color: var(--gold);
  opacity: .7;
  min-width: 32px;
  margin-top: 2px;
}
.bday-card-fact-text {
  font-family: var(--sans);
  font-size: clamp(10px, 2.8vw, 13px);
  color: rgba(255,255,255,.7);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.bday-card-footer {
  padding: 12px 20px 10px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid rgba(255,255,255,.06);
}
.bday-card-url {
  font-family: var(--sans);
  font-size: 9px;
  color: rgba(255,255,255,.28);
  letter-spacing: .06em;
}
.bday-card-cta {
  font-family: var(--sans);
  font-size: 9px;
  color: rgba(201,168,76,.6);
  letter-spacing: .04em;
}

/* ── Action buttons under card ── */
.bday-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  direction: rtl;
}
.bday-action-btn {
  flex: 1;
  min-width: 120px;
  padding: 11px 16px;
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  text-align: center;
  transition: background .13s, color .13s;
  border: 1.5px solid var(--ink);
  background: var(--ink);
  color: var(--bg);
}
.bday-action-btn:hover { background: color-mix(in srgb, var(--ink) 82%, var(--gold) 18%); }
.bday-action-btn.outline {
  background: transparent;
  color: var(--ink);
  border-color: var(--rule-lt);
}
.bday-action-btn.outline:hover { border-color: var(--ink); }
.bday-action-link {
  display: block;
  width: 100%;
  margin-top: 6px;
  text-align: center;
  font-family: var(--sans);
  font-size: 12px;
  color: var(--ink3);
  text-decoration: none;
  direction: rtl;
}
.bday-action-link:hover { color: var(--ink); text-decoration: underline; }

/* ── Dark mode ── */
html[data-theme="dark"] .bday-loading { background: var(--bg2); }
html[data-theme="dark"] .bday-progress-track { background: var(--bg3); }
html[data-theme="dark"] .bday-error { background: color-mix(in srgb, #8b1c1c 15%, var(--bg2) 85%); }
html[data-theme="dark"] .bday-action-btn.outline { border-color: var(--rule-lt); color: var(--bg); }
html[data-theme="dark"] .bday-action-link { color: var(--ink3); }

/* ── Mobile ── */
@media (max-width: 500px) {
  .bday-intro { padding: 20px 18px 16px; }
  .bday-form  { padding: 16px 18px 20px; }
  .bday-card  { max-width: 100%; }
}
