@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Manrope:wght@700;800&display=swap');

:root {
    --ink: #241a38;
    --muted: #716a7d;
    --purple: #7551dc;
    --purple-dark: #5f3bc8;
    --purple-soft: #f0ebff;
    --yellow: #ffc94a;
    --rose: #ff6f91;
    --green: #28966a;
    --red: #cf4d62;
    --paper: #fffefd;
    --surface: #f8f6fc;
    --line: #e9e4f0;
    --shadow: 0 18px 50px rgba(48, 31, 83, .10);
    --radius: 20px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: 'DM Sans', Arial, sans-serif; line-height: 1.55; }
button, input, textarea { font: inherit; }
a { color: inherit; }
h1, h2, h3 { margin-top: 0; font-family: 'Manrope', 'DM Sans', sans-serif; line-height: 1.15; }
p { margin-top: 0; }
.site-shell { display: flex; min-height: 100vh; flex-direction: column; }
.site-main { flex: 1; }
.container { width: min(1160px, calc(100% - 40px)); margin-inline: auto; }
.narrow-container { width: min(880px, calc(100% - 40px)); }

.site-header { position: relative; z-index: 20; border-bottom: 1px solid rgba(117,81,220,.09); background: rgba(255,254,253,.92); backdrop-filter: blur(12px); }
.header-inner { display: flex; min-height: 74px; align-items: center; justify-content: space-between; gap: 24px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); font-family: 'Manrope', sans-serif; font-size: 18px; font-weight: 800; text-decoration: none; }
.brand-mark { display: grid; width: 38px; height: 38px; place-items: center; border-radius: 12px; background: var(--purple); box-shadow: 0 7px 16px rgba(117,81,220,.28); font-size: 20px; }
.brand-centered { justify-content: center; margin-bottom: 28px; }
.main-nav { display: flex; align-items: center; gap: 22px; }
.main-nav > a:not(.button), .nav-button { border: 0; background: none; color: var(--muted); cursor: pointer; font-weight: 600; text-decoration: none; }
.main-nav > a:hover, .nav-button:hover { color: var(--purple); }
.inline-form { display: inline; margin: 0; }

.button { display: inline-flex; min-height: 48px; align-items: center; justify-content: center; gap: 10px; border: 0; border-radius: 12px; padding: 12px 19px; cursor: pointer; font-weight: 700; text-decoration: none; transition: transform .18s ease, box-shadow .18s ease, background .18s ease; }
.button:hover { transform: translateY(-1px); }
.button:disabled { cursor: wait; opacity: .65; transform: none; }
.button-primary { background: var(--purple); color: #fff; box-shadow: 0 10px 24px rgba(117,81,220,.24); }
.button-primary:hover { background: var(--purple-dark); box-shadow: 0 12px 28px rgba(117,81,220,.32); }
.button-soft { background: var(--purple-soft); color: var(--purple-dark); }
.button-soft:hover { background: #e8e0ff; }
.button-small { min-height: 38px; padding: 8px 14px; border-radius: 10px; font-size: 14px; }
.button-full { width: 100%; }
.text-link, .back-link { color: var(--purple-dark); font-weight: 700; text-decoration: none; }
.back-link { display: inline-block; margin-bottom: 22px; }
.text-button { border: 0; background: transparent; color: var(--purple-dark); cursor: pointer; font-weight: 700; }
.icon-button { display: grid; flex: 0 0 auto; width: 38px; height: 38px; place-items: center; border: 0; border-radius: 10px; background: #f1edf5; color: var(--muted); cursor: pointer; font-size: 22px; }
.icon-button:hover { background: #e8e1ef; color: var(--ink); }
.icon-button:disabled { opacity: .3; cursor: not-allowed; }
.icon-button.danger:hover { background: #ffe8ec; color: var(--red); }

.hero { position: relative; overflow: hidden; background: radial-gradient(circle at 75% 25%, #efe8ff 0, transparent 36%), linear-gradient(145deg, #fff 10%, #faf7ff 100%); }
.hero::before { position: absolute; inset: auto auto -180px -100px; width: 360px; height: 360px; border-radius: 50%; background: #fff2c9; content: ''; filter: blur(5px); opacity: .48; }
.hero-grid { display: grid; min-height: 610px; grid-template-columns: 1.05fr .95fr; align-items: center; gap: 70px; padding-block: 70px 80px; }
.eyebrow { display: inline-block; margin-bottom: 12px; color: var(--purple-dark); font-size: 13px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.hero h1 { margin-bottom: 22px; font-size: clamp(48px, 6vw, 78px); letter-spacing: -.055em; }
.hero h1 span { color: var(--purple); }
.hero-copy > p { max-width: 610px; color: var(--muted); font-size: 19px; }
.hero-actions { display: flex; align-items: center; gap: 24px; margin-top: 30px; }
.trust-row { display: flex; flex-wrap: wrap; gap: 12px 22px; margin-top: 30px; color: #5e5868; font-size: 13px; font-weight: 600; }
.hero-visual { position: relative; min-height: 430px; perspective: 1000px; }
.gift-card { position: absolute; display: flex; width: min(380px, 85%); height: 400px; flex-direction: column; align-items: center; justify-content: center; border-radius: 28px; box-shadow: 0 30px 70px rgba(53,35,88,.18); text-align: center; }
.gift-card-front { top: 10px; left: 8%; z-index: 2; border: 1px solid rgba(255,255,255,.7); background: rgba(255,255,255,.92); transform: rotate(-3deg); }
.gift-card-back { top: 28px; right: 0; background: var(--yellow); color: #503a0d; transform: rotate(8deg); }
.gift-card-back span { font-size: 60px; }
.gift-card-back strong { font-size: 28px; }
.mini-brand { position: absolute; top: 28px; color: var(--purple); font-size: 11px; font-weight: 800; letter-spacing: .14em; }
.big-gift { margin-bottom: 24px; font-size: 76px; filter: drop-shadow(0 12px 12px rgba(117,81,220,.18)); }
.gift-card-front > span { color: var(--muted); }
.gift-card-front > strong { margin-top: 5px; color: var(--purple-dark); font-family: 'Manrope'; font-size: 24px; }
.secret-line { width: 92px; height: 4px; margin-top: 30px; border-radius: 4px; background: var(--yellow); }
.confetti { position: absolute; z-index: 5; font-size: 24px; }
.c1 { top: 5%; left: 0; color: var(--rose); transform: rotate(20deg); }.c2 { top: 17%; right: 1%; color: var(--purple); }.c3 { bottom: 7%; left: 5%; color: var(--yellow); }.c4 { right: 8%; bottom: 2%; color: var(--rose); }

.how-it-works { padding: 86px 0 100px; }
.section-heading { margin-bottom: 42px; text-align: center; }
.section-heading h2 { font-size: 38px; }
.steps-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.steps-grid article { position: relative; overflow: hidden; min-height: 240px; border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; background: #fff; }
.step-number { position: absolute; top: 15px; right: 20px; color: #eee9f4; font-family: 'Manrope'; font-size: 48px; font-weight: 800; }
.step-icon { margin-bottom: 24px; font-size: 38px; }
.steps-grid h3 { margin-bottom: 10px; font-size: 20px; }
.steps-grid p { color: var(--muted); }

.page-section { padding: 52px 0 90px; }
.page-heading { margin: 0 auto 32px; text-align: center; }
.page-heading h1, .dashboard-heading h1, .wishlist-heading h1 { margin-bottom: 10px; font-size: clamp(34px, 5vw, 48px); letter-spacing: -.035em; }
.page-heading p, .dashboard-heading p, .wishlist-heading p { color: var(--muted); }
.form-card, .add-item-card, .delivery-panel { border: 1px solid var(--line); border-radius: 24px; background: #fff; box-shadow: var(--shadow); }
.form-card fieldset { margin: 0; border: 0; border-bottom: 1px solid var(--line); padding: 34px; }
.form-card legend { display: flex; align-items: center; gap: 12px; padding: 0; font-family: 'Manrope'; font-size: 19px; font-weight: 800; }
.form-card legend span { display: grid; width: 32px; height: 32px; place-items: center; border-radius: 50%; background: var(--purple-soft); color: var(--purple-dark); font-size: 14px; }
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; margin-top: 22px; }
label { display: flex; flex-direction: column; gap: 7px; color: #4e465b; font-size: 14px; font-weight: 700; }
label small { color: var(--muted); font-weight: 500; }
input, textarea { width: 100%; border: 1px solid #ded8e7; border-radius: 11px; outline: none; background: #fff; color: var(--ink); padding: 12px 14px; transition: border .18s, box-shadow .18s; }
input:focus, textarea:focus { border-color: var(--purple); box-shadow: 0 0 0 4px rgba(117,81,220,.10); }
input:disabled { background: #f3f1f6; color: var(--muted); }
textarea { resize: vertical; }
.full-column { grid-column: 1 / -1; }
.checkbox-label { flex-direction: row; align-items: center; gap: 12px; border-radius: 12px; background: var(--surface); padding: 14px; cursor: pointer; }
.checkbox-label input { width: 20px; height: 20px; accent-color: var(--purple); }
.checkbox-label span { display: flex; flex-direction: column; }
.field-help { margin: 18px 0; color: var(--muted); font-size: 14px; }
.participants-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 15px; }
.participant-row { display: grid; grid-template-columns: 34px 1fr 1.15fr 38px; align-items: center; gap: 10px; }
.participant-index { display: grid; width: 30px; height: 30px; place-items: center; border-radius: 50%; background: var(--surface); color: var(--muted); font-size: 13px; font-weight: 800; }
.form-submit-row { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 28px 34px; }
.form-submit-row > div { display: flex; flex-direction: column; font-size: 14px; }
.form-submit-row small { color: var(--muted); }

.flash-stack { margin-top: 16px; }
.alert { border-radius: 12px; padding: 13px 16px; font-weight: 600; }
.alert-error { border: 1px solid #f4c6ce; background: #fff0f3; color: #9f2f43; }
.alert-success { border: 1px solid #bee8d6; background: #ecfbf4; color: #176a4a; }
.info-banner { margin: 20px 0; border: 1px solid #d9cdfc; border-radius: 14px; background: var(--purple-soft); color: var(--purple-dark); padding: 16px 18px; }

.auth-section, .installer-shell { display: grid; min-height: calc(100vh - 150px); place-items: center; padding: 50px 20px; background: radial-gradient(circle at 30% 20%, #eee6ff, transparent 34%), var(--surface); }
.installer-body { min-height: 100vh; }
.installer-shell { min-height: 100vh; }
.auth-card { width: min(470px, 100%); border: 1px solid var(--line); border-radius: 24px; background: #fff; box-shadow: var(--shadow); padding: 38px; }
.auth-card h1 { margin-bottom: 10px; font-size: 34px; }
.muted { color: var(--muted); }
.stack-form { display: flex; flex-direction: column; gap: 17px; margin-top: 26px; }
.form-meta { display: flex; justify-content: flex-end; margin-top: -8px; }
.form-meta a, .auth-switch a { color: var(--purple-dark); font-weight: 700; }
.auth-switch { margin: 24px 0 0; color: var(--muted); text-align: center; }
.success-icon { display: grid; width: 64px; height: 64px; margin: 0 auto 20px; place-items: center; border-radius: 50%; background: #e3f8ef; color: var(--green); font-size: 32px; font-weight: 800; }
.install-checklist { display: flex; flex-direction: column; gap: 12px; margin: 26px 0; }
.install-checklist div { display: flex; align-items: center; gap: 12px; }
.install-checklist strong { display: grid; flex: 0 0 30px; height: 30px; place-items: center; border-radius: 50%; background: var(--purple-soft); color: var(--purple-dark); }
code { border-radius: 5px; background: #f0edf4; padding: 2px 5px; font-size: .9em; }

.dashboard-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 34px; }
.event-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.event-card { display: flex; align-items: center; gap: 18px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; padding: 22px; color: inherit; text-decoration: none; transition: transform .18s, box-shadow .18s, border .18s; }
.event-card:hover { transform: translateY(-2px); border-color: #d5c7fc; box-shadow: var(--shadow); }
.event-card-icon { display: grid; flex: 0 0 64px; height: 64px; place-items: center; border-radius: 17px; background: var(--purple-soft); font-size: 32px; }
.event-card-copy { min-width: 0; flex: 1; }
.event-card h2 { overflow: hidden; margin: 6px 0 3px; font-size: 20px; text-overflow: ellipsis; white-space: nowrap; }
.event-card p { margin: 0; color: var(--muted); font-size: 14px; }
.event-arrow { color: var(--purple); font-size: 24px; }
.tag { display: inline-flex; border-radius: 99px; background: var(--purple-soft); color: var(--purple-dark); padding: 5px 9px; font-size: 11px; font-weight: 800; text-transform: uppercase; }
.empty-state { border: 1px dashed #d9d1e4; border-radius: 24px; background: #fff; padding: 60px 20px; text-align: center; }
.empty-state > div { font-size: 52px; }
.empty-state h2 { margin: 14px 0 8px; }
.empty-state p { color: var(--muted); }
.empty-state.compact { border: 0; padding: 34px 15px; }

.event-hero { display: flex; min-height: 210px; align-items: center; justify-content: space-between; gap: 30px; overflow: hidden; border-radius: 26px; background: linear-gradient(120deg, #261744, #6842cd); color: #fff; padding: 36px 42px; }
.event-hero h1 { margin: 10px 0 8px; font-size: clamp(32px, 5vw, 50px); }
.event-hero p { max-width: 650px; margin: 0; color: #ded3fa; }
.event-hero .tag { background: rgba(255,255,255,.13); color: #fff; }
.event-hero-gift { font-size: 100px; transform: rotate(7deg); filter: drop-shadow(0 18px 20px rgba(0,0,0,.18)); }
.secret-result { display: flex; align-items: center; gap: 20px; margin: 22px 0 42px; border: 1px solid #ffe0a0; border-radius: var(--radius); background: #fff9e8; padding: 23px; }
.secret-icon { display: grid; flex: 0 0 62px; height: 62px; place-items: center; border-radius: 18px; background: #ffefbe; font-size: 30px; }
.secret-result span { color: #8f6c21; font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.secret-result h2 { margin: 4px 0; font-size: 24px; }
.secret-result h2 strong { color: var(--purple-dark); }
.secret-result p { margin: 0; color: var(--muted); font-size: 13px; }
.section-title-row { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin: 34px 0 20px; }
.section-title-row h2 { margin-bottom: 4px; }
.section-title-row p { margin: 0; color: var(--muted); }
.section-title-row > span { color: var(--muted); font-size: 14px; }
.people-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 13px; }
.person-card { display: flex; align-items: center; gap: 14px; border: 1px solid var(--line); border-radius: 16px; background: #fff; padding: 16px; }
.person-card-me { border-color: #d7cafa; background: #fcfaff; }
.avatar { display: grid; flex: 0 0 46px; height: 46px; place-items: center; border-radius: 14px; background: linear-gradient(135deg, var(--purple), #a887ff); color: #fff; font-family: 'Manrope'; font-size: 20px; font-weight: 800; }
.avatar-large { flex-basis: 76px; height: 76px; border-radius: 22px; font-size: 32px; }
.person-card-copy { min-width: 0; flex: 1; }
.person-card h3 { overflow: hidden; margin: 0 0 3px; font-size: 16px; text-overflow: ellipsis; white-space: nowrap; }
.person-card h3 small { border-radius: 6px; background: var(--purple-soft); color: var(--purple-dark); padding: 3px 6px; font-family: 'DM Sans'; font-size: 10px; }
.person-card p { margin: 0; color: var(--muted); font-size: 13px; }
.views-count { display: block; margin-top: 4px; color: var(--purple-dark); font-size: 11px; font-weight: 700; }
.delivery-panel { margin-top: 48px; padding: 4px 26px 20px; box-shadow: none; }
.delivery-list { border-top: 1px solid var(--line); }
.delivery-row { display: grid; grid-template-columns: 1fr auto 74px; align-items: center; gap: 18px; border-bottom: 1px solid var(--line); padding: 14px 0; }
.delivery-row:last-child { border-bottom: 0; }
.delivery-row > div { display: flex; min-width: 0; flex-direction: column; }
.delivery-row > div span { overflow: hidden; color: var(--muted); font-size: 13px; text-overflow: ellipsis; }
.email-error { display: block; margin-top: 6px; color: var(--red); font-size: 12px; font-weight: 600; overflow-wrap: anywhere; }
.status { border-radius: 99px; padding: 5px 10px; font-size: 11px; font-weight: 800; text-transform: uppercase; }
.status-sent { background: #e4f8ef; color: var(--green); }.status-failed { background: #ffe8ed; color: var(--red); }.status-pending { background: #fff4d6; color: #986e13; }

.wishlist-heading { display: flex; align-items: center; gap: 20px; margin-bottom: 28px; }
.wishlist-heading h1 { margin-bottom: 4px; }
.wishlist-heading p { margin: 0; }
.add-item-card { margin-bottom: 24px; padding: 28px; box-shadow: none; }
.add-item-card h2 { font-size: 20px; }
.wishlist-items { display: flex; flex-direction: column; gap: 12px; }
.wish-item { display: flex; align-items: flex-start; gap: 16px; border: 1px solid var(--line); border-radius: 16px; background: #fff; padding: 18px; }
.wish-icon { display: grid; flex: 0 0 42px; height: 42px; place-items: center; border-radius: 12px; background: #ffeaf0; color: var(--rose); font-size: 24px; }
.wish-item > div:nth-child(2) { flex: 1; }
.wish-item h3 { margin: 0 0 5px; font-size: 17px; }
.wish-item p { margin: 0 0 5px; color: var(--muted); }
.wish-item a { color: var(--purple-dark); font-size: 14px; font-weight: 700; }

.site-footer { border-top: 1px solid var(--line); background: var(--surface); color: var(--muted); font-size: 13px; }
.footer-inner { display: flex; min-height: 78px; align-items: center; justify-content: space-between; gap: 20px; }

@media (max-width: 820px) {
    .hero-grid { grid-template-columns: 1fr; gap: 25px; padding-top: 55px; text-align: center; }
    .hero-copy > p { margin-inline: auto; }
    .hero-actions, .trust-row { justify-content: center; }
    .hero-visual { width: min(500px, 100%); margin-inline: auto; }
    .steps-grid, .event-grid, .people-grid { grid-template-columns: 1fr; }
    .event-hero-gift { font-size: 70px; }
}

@media (max-width: 620px) {
    .container, .narrow-container { width: min(100% - 28px, 1160px); }
    .header-inner { min-height: 66px; }
    .brand { font-size: 16px; }
    .brand-mark { width: 34px; height: 34px; }
    .main-nav { gap: 10px; }
    .main-nav > a:not(.button) { display: none; }
    .main-nav .button { padding-inline: 11px; }
    .hero-grid { min-height: auto; padding-bottom: 55px; }
    .hero h1 { font-size: 46px; }
    .hero-copy > p { font-size: 17px; }
    .hero-actions { flex-direction: column; gap: 15px; }
    .hero-visual { min-height: 365px; }
    .gift-card { height: 340px; }
    .gift-card-front { left: 4%; }
    .how-it-works, .page-section { padding-block: 50px 65px; }
    .form-card fieldset, .form-submit-row, .auth-card { padding: 24px 20px; }
    .form-grid { grid-template-columns: 1fr; }
    .full-column { grid-column: auto; }
    .participant-row { grid-template-columns: 30px 1fr 38px; }
    .participant-row input[type="email"] { grid-column: 2 / 3; }
    .participant-row .icon-button { grid-column: 3; grid-row: 1 / 3; }
    .form-submit-row, .dashboard-heading { align-items: stretch; flex-direction: column; }
    .dashboard-heading .button { align-self: flex-start; }
    .event-hero { min-height: 190px; padding: 28px 24px; }
    .event-hero-gift { display: none; }
    .secret-result { align-items: flex-start; }
    .person-card { flex-wrap: wrap; }
    .person-card .button { width: 100%; }
    .delivery-row { grid-template-columns: 1fr auto; }
    .delivery-row form { grid-column: 2; }
    .wishlist-heading { align-items: flex-start; }
    .footer-inner { flex-direction: column; justify-content: center; padding-block: 20px; text-align: center; }
}
