@import url('https://fonts.googleapis.com/css2?family=Amiri:wght@400;700&family=Cormorant+Garamond:wght@500;600;700&family=Inter:wght@400;500;600&display=swap');

:root {
  --bg: #f4ece1;
  --card: #fffaf3;
  --ink: #3b2a26;
  --muted: #8a7466;
  --line: #e6d8c4;
  --gold: #8e2433;
  --gold-dark: #6c1825;
  --danger: #b0473f;
  --radius: 16px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, system-ui, sans-serif;
  line-height: 1.5;
}

.wrap { max-width: 560px; margin: 0 auto; padding: 32px 16px 64px; }

h1, h2, .serif { font-family: 'Cormorant Garamond', Georgia, serif; font-weight: 600; }
h1 { font-size: 2.2rem; margin: 0 0 4px; line-height: 1.15; }
h2 { font-size: 1.5rem; margin: 0 0 12px; }
.sub { color: var(--muted); margin: 0 0 24px; }
.center { text-align: center; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 20px;
  box-shadow: 0 4px 24px rgba(60, 40, 20, 0.05);
}

label { display: block; font-size: 0.85rem; font-weight: 600; margin: 16px 0 6px; }
label .opt { font-weight: 400; color: var(--muted); }

input[type=text], input[type=url], input[type=date], input[type=time], textarea {
  width: 100%;
  padding: 12px 14px;
  font: inherit;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
}
input:focus { outline: 2px solid var(--gold); outline-offset: 1px; border-color: transparent; }

.row { display: flex; gap: 12px; }
.row > * { flex: 1; min-width: 0; }

.drop {
  display: flex; align-items: center; justify-content: center; flex-direction: column;
  border: 2px dashed var(--line); border-radius: 12px; padding: 20px; cursor: pointer;
  color: var(--muted); text-align: center; min-height: 120px; overflow: hidden;
}
.drop:hover { border-color: var(--gold); }
.drop img { max-width: 100%; max-height: 280px; border-radius: 8px; }
.drop input { display: none; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 20px; font: inherit; font-weight: 600; border-radius: 10px;
  border: 1px solid var(--gold); background: var(--gold); color: #fff;
  cursor: pointer; text-decoration: none;
}
.btn:hover { background: var(--gold-dark); border-color: var(--gold-dark); }
.btn:disabled { opacity: 0.6; cursor: default; }
.btn.ghost { background: transparent; color: var(--gold-dark); }
.btn.ghost:hover { background: #f6e7e2; }
.btn.block { width: 100%; margin-top: 24px; }
.btns { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 16px; }

.error { color: var(--danger); font-size: 0.9rem; margin-top: 12px; min-height: 1.2em; }

.poster { width: 100%; border-radius: 12px; display: block; margin-bottom: 20px; }
.when { color: var(--gold-dark); font-weight: 600; letter-spacing: 0.02em; }

.qr { width: 240px; max-width: 100%; display: block; margin: 8px auto; border-radius: 8px; }
.link {
  font-size: 0.85rem; color: var(--muted); word-break: break-all;
  background: var(--bg); padding: 8px 12px; border-radius: 8px; margin-top: 8px;
}

.count { font-size: 2.6rem; font-family: 'Cormorant Garamond', serif; font-weight: 700; color: var(--gold-dark); line-height: 1; }
.guests { list-style: none; padding: 0; margin: 16px 0 0; }
.guests li {
  display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line);
}
.guests .n { color: var(--muted); font-size: 0.8rem; width: 24px; text-align: right; }
.guests .name { flex: 1; font-weight: 500; overflow-wrap: anywhere; }
.guests .time { color: var(--muted); font-size: 0.8rem; white-space: nowrap; }
.guests button { border: 0; background: none; color: var(--muted); cursor: pointer; font-size: 1.1rem; padding: 4px 6px; }
.guests button:hover { color: var(--danger); }
.empty { color: var(--muted); text-align: center; padding: 16px 0 0; }

.done { font-size: 3rem; line-height: 1; margin-bottom: 8px; }
.myevents a { display: block; padding: 10px 0; border-top: 1px solid var(--line); color: var(--ink); text-decoration: none; }
.myevents a:hover { color: var(--gold-dark); }
.myevents small { color: var(--muted); }
.hidden { display: none !important; }

textarea { resize: vertical; min-height: 84px; line-height: 1.5; }
[lang=ar] { font-family: 'Amiri', serif; font-size: 1.1rem; }
.section-title {
  font-size: 0.72rem; letter-spacing: 0.2em; text-transform: uppercase; color: var(--gold);
  margin: 0 0 4px; font-weight: 600;
}
.card > .section-title + label { margin-top: 8px; }
.hint { font-size: 0.8rem; color: var(--muted); margin-top: 6px; }
.check { display: flex; align-items: center; gap: 8px; font-weight: 400; margin-top: 10px; }
.sticky-save { position: sticky; bottom: 0; padding: 12px 0 16px; background: linear-gradient(transparent, var(--bg) 35%); }
.sticky-save .btn { width: 100%; }

.stats { display: flex; gap: 12px; margin-top: 12px; }
.stat { flex: 1; text-align: center; padding: 12px; border-radius: 12px; background: var(--bg); }
.stat .count { font-size: 2.2rem; }
.stat small { display: block; color: var(--muted); font-size: 0.75rem; letter-spacing: 0.1em; text-transform: uppercase; }
.stat.no .count { color: var(--muted); }
.tabs { display: flex; gap: 6px; margin-top: 16px; }
.tab { flex: 1; padding: 8px; border: 1px solid var(--line); background: #fff; border-radius: 999px; font: inherit; font-size: 0.85rem; cursor: pointer; color: var(--muted); }
.tab.active { background: var(--gold); border-color: var(--gold); color: #fff; }
.badge { font-size: 0.7rem; padding: 2px 8px; border-radius: 999px; background: #f6e2df; color: var(--gold); white-space: nowrap; }
.badge.no { background: #eee8df; color: var(--muted); }
.count { font-variant-numeric: lining-nums tabular-nums; }
.guests .name { min-width: 45%; overflow-wrap: break-word; }
@media (max-width: 480px) {
  .guests .time { display: none; }
}
.stat .sub-stat { letter-spacing: 0; text-transform: none; font-size: 0.75rem; margin-top: 2px; }
