@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;500;600;700&family=Great+Vibes&family=Lato:wght@300;400;700&display=swap');

:root {
    --gold: #b8882a;
    --gold-light: #d4a843;
    --ink: #3d2b1f;
    --text: #6b5240;
    --muted: #8c7355;
    --paper: #fffef9;
    --field: #f8f3ea;
    --cream: #faf7f2;
    --cream-deep: #f5edde;
    --danger: #d4183d;
}

* { box-sizing: border-box; }
html { min-height: 100%; scroll-behavior: smooth; }
body {
    min-height: 100%;
    margin: 0;
    background: linear-gradient(175deg, var(--cream) 0%, var(--cream-deep) 60%, var(--cream) 100%);
    color: var(--ink);
    font-family: Lato, Arial, sans-serif;
}
button, input, textarea { font: inherit; }
button { cursor: pointer; }
img { max-width: 100%; }

.page-shell { min-height: 100vh; background: linear-gradient(175deg, var(--cream) 0%, var(--cream-deep) 60%, var(--cream) 100%); }
.hero {
    position: relative;
    overflow: hidden;
    padding: 2.5rem 1rem 4rem;
    background: linear-gradient(180deg, var(--cream-deep) 0%, var(--cream) 100%);
    border-bottom: 1px solid rgba(184, 136, 42, .14);
}
.container { width: min(100%, 48rem); margin: 0 auto; }
.rule, .mini-divider { display: flex; align-items: center; justify-content: center; gap: .5rem; }
.rule::before, .rule::after { content: ""; width: clamp(5rem, 20vw, 8rem); height: 1px; }
.rule::before { background: linear-gradient(90deg, transparent, rgba(184, 136, 42, .5)); }
.rule::after { background: linear-gradient(90deg, rgba(184, 136, 42, .5), transparent); }
.rule span { width: .5rem; height: .5rem; border-radius: 50%; background: rgba(184, 136, 42, .55); }
.hero-grid { display: flex; flex-direction: column; align-items: center; gap: 2rem; margin-top: 2rem; }
.anniversary-mark { display: flex; flex-direction: column; align-items: center; gap: .75rem; }
.fifty-wrap { position: relative; }
.fifty-shadow, .fifty {
    display: block;
    color: var(--gold);
    font-family: "Great Vibes", cursive;
    font-size: clamp(5.5rem, 18vw, 9.25rem);
    line-height: .9;
}
.fifty-shadow {
    position: absolute;
    inset: 50% auto auto 50%;
    transform: translate(-50%, -50%);
    color: transparent;
    -webkit-text-stroke: 1.5px var(--gold);
    opacity: .16;
    pointer-events: none;
    user-select: none;
}
.anniversary-label, .eyebrow {
    color: var(--gold);
    font-size: .78rem;
    font-weight: 700;
    letter-spacing: .16em;
    text-transform: uppercase;
}
.names {
    margin: 2.5rem 0 0;
    text-align: center;
    color: var(--ink);
    font-family: "Playfair Display", serif;
    font-size: clamp(1.5rem, 6vw, 2.65rem);
    font-weight: 500;
    letter-spacing: .06em;
    line-height: 1.2;
}
.names span { color: var(--gold); }
.copy { width: min(100%, 28rem); margin: 1rem auto 0; color: var(--text); text-align: center; line-height: 1.65; }
.copy p { margin: 0 0 .75rem; }
.copy strong { color: var(--ink); }
.mini-divider { gap: .75rem; margin: 1rem 0; }
.mini-divider::before, .mini-divider::after { content: ""; flex: 1; height: 1px; }
.mini-divider::before { background: linear-gradient(90deg, transparent, rgba(184, 136, 42, .27)); }
.mini-divider::after { background: linear-gradient(90deg, rgba(184, 136, 42, .27), transparent); }
.mini-divider span { width: .4rem; height: .4rem; border-radius: 50%; background: rgba(184, 136, 42, .42); }

.polaroid { position: relative; display: inline-block; flex-shrink: 0; transform: rotate(var(--tilt, -2deg)); }
.tape {
    position: absolute;
    top: -.7rem;
    left: 50%;
    z-index: 2;
    width: 3rem;
    height: 1.25rem;
    border-radius: .125rem;
    transform: translateX(-50%);
    background: linear-gradient(135deg, #f5dfa0 0%, #efd07a 50%, #f5dfa0 100%);
    box-shadow: 0 1px 3px rgba(0, 0, 0, .12);
    opacity: .6;
}
.polaroid-card {
    padding: .5rem .5rem 1.75rem;
    background: #fff;
    border: 1px solid rgba(0, 0, 0, .08);
    box-shadow: 0 6px 24px rgba(61, 43, 31, .18), 0 1px 4px rgba(0, 0, 0, .08);
}
.polaroid-img, .polaroid-placeholder {
    width: var(--photo-w, 13.75rem);
    height: var(--photo-h, 12.5rem);
    object-fit: cover;
    object-position: center top;
    display: block;
}
.polaroid-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    background: linear-gradient(135deg, #f5edde 0%, #ede5d8 100%);
    color: rgba(184, 136, 42, .6);
    font-size: .72rem;
    letter-spacing: .08em;
    text-transform: uppercase;
}
.caption { margin: .25rem 0 0; color: var(--muted); text-align: center; font-family: "Great Vibes", cursive; font-size: .95rem; }

.notice {
    width: min(100% - 2rem, 48rem);
    margin: 2rem auto 0;
    padding: 1.25rem;
    display: flex;
    gap: 1rem;
    background: linear-gradient(135deg, #fffdf5, #fff8e6);
    border: 1.5px solid rgba(184, 136, 42, .4);
    border-radius: 1rem;
    box-shadow: 0 0 0 4px rgba(184, 136, 42, .04);
}
.notice-icon, .section-icon, .success-icon { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.notice-icon { width: 2.5rem; height: 2.5rem; margin-top: .1rem; border: 1.5px solid rgba(184, 136, 42, .33); border-radius: 50%; background: rgba(184, 136, 42, .13); color: var(--gold); }
.notice p { margin: 0; color: var(--text); font-size: .92rem; line-height: 1.55; }
.notice strong { color: var(--ink); }

.form-wrap { width: min(100% - 2rem, 48rem); margin: 0 auto; padding: 2rem 0 4rem; }
.form-grid { display: grid; grid-template-columns: 1fr; gap: 1.5rem; }
.section-card {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    padding: 1.5rem;
    background: var(--paper);
    border: 1px solid rgba(184, 136, 42, .2);
    border-radius: 1rem;
    box-shadow: 0 2px 20px rgba(61, 43, 31, .07);
}
.section-head { display: flex; flex-direction: column; align-items: center; gap: .75rem; text-align: center; }
.section-icon {
    width: 3.5rem;
    height: 3.5rem;
    border: 1.5px solid rgba(184, 136, 42, .33);
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(212, 168, 67, .13), rgba(184, 136, 42, .13));
    color: var(--gold);
}
.section-head h2 { margin: 0; color: var(--gold); font-size: 1rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.section-head p { margin: .2rem 0 0; color: var(--muted); font-size: .9rem; }
.soft-line { align-self: center; width: 4rem; height: 1px; background: linear-gradient(90deg, transparent, rgba(184, 136, 42, .33), transparent); }
.field { display: flex; flex-direction: column; gap: .5rem; }
.field label { color: var(--gold); font-size: .78rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.required { color: var(--danger); }
.guest-fields { display: grid; grid-template-columns: 1fr; gap: 1rem; }
.choice-stack { display: flex; flex-direction: column; gap: .5rem; }
.choice {
    width: 100%;
    min-height: 3rem;
    padding: .8rem 1rem;
    color: var(--muted);
    text-align: left;
    background: #fffef9;
    border: 1px solid rgba(184, 136, 42, .2);
    border-radius: .75rem;
    transition: border .2s, box-shadow .2s, background .2s, color .2s;
}
.choice.active { color: var(--ink); font-weight: 700; background: linear-gradient(135deg, rgba(184, 136, 42, .09), rgba(212, 168, 67, .06)); border: 1.5px solid var(--gold); box-shadow: 0 0 0 3px rgba(184, 136, 42, .08); }
.choice-mark { margin-right: .45rem; color: var(--gold); }
.text-input, .message-input {
    width: 100%;
    padding: .8rem 1rem;
    color: var(--ink);
    background: var(--field);
    border: 1px solid rgba(184, 136, 42, .2);
    border-radius: .75rem;
    outline: none;
    transition: border .2s, box-shadow .2s;
}
.text-input:focus, .message-input:focus { border-color: rgba(184, 136, 42, .55); box-shadow: 0 0 0 3px rgba(184, 136, 42, .08); }
.counter { display: inline-flex; align-items: center; align-self: flex-start; overflow: hidden; border: 1px solid rgba(184, 136, 42, .27); border-radius: .75rem; }
.counter button { width: 3rem; height: 3rem; color: var(--gold); background: rgba(184, 136, 42, .07); border: 0; }
.counter button:hover { background: rgba(184, 136, 42, .13); }
.counter span { width: 3.5rem; text-align: center; color: var(--ink); font-family: "Playfair Display", serif; font-size: 1.15rem; font-weight: 700; }
.age-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .65rem; }
.age-input { min-width: 0; }
.textarea-wrap { position: relative; }
.message-input { min-height: 10rem; resize: vertical; line-height: 1.6; }
.char-count { position: absolute; right: .85rem; bottom: .8rem; color: var(--muted); font-size: .75rem; }
.char-count.warn { color: var(--danger); }
.helper { margin: -.2rem 0 0; color: var(--muted); font-size: .82rem; }
.upload-box {
    width: 100%;
    margin-top: .25rem;
    padding: 2rem 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    text-align: center;
    color: var(--muted);
    background: var(--field);
    border: 1.5px dashed rgba(184, 136, 42, .33);
    border-radius: .75rem;
}
.upload-box:hover { border-color: var(--gold); background: rgba(184, 136, 42, .04); }
.upload-box strong { color: var(--muted); font-weight: 400; }
.upload-box small { color: #b0956e; }
.hidden-file { display: none; }
.preview { position: relative; display: inline-block; margin-top: .25rem; }
.preview .polaroid-card { padding-bottom: 1.25rem; }
.change-photo { display: block; margin-top: .75rem; padding: 0; color: var(--muted); text-decoration: underline; background: none; border: 0; font-size: .8rem; }
.submit-row { margin-top: 2rem; }
.submit-button {
    width: 100%;
    min-height: 3.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .75rem;
    color: var(--paper);
    background: linear-gradient(135deg, var(--gold-light), var(--gold) 50%, #9a6e1a);
    border: 0;
    border-radius: 1rem;
    box-shadow: 0 4px 20px rgba(184, 136, 42, .33);
    font-weight: 700;
    letter-spacing: .18em;
    text-transform: uppercase;
    transition: box-shadow .2s, transform .2s;
}
.submit-button:hover { transform: translateY(-1px); box-shadow: 0 6px 28px rgba(184, 136, 42, .45); }
.submit-button:disabled { cursor: wait; opacity: .7; transform: none; }
.form-error { margin: 0 0 1rem; padding: .85rem 1rem; color: #7f1026; background: #fff3f5; border: 1px solid rgba(212, 24, 61, .25); border-radius: .75rem; }

.footer { padding: 3.5rem 1rem; text-align: center; background: linear-gradient(180deg, var(--cream-deep) 0%, #ede5d8 100%); border-top: 1px solid rgba(184, 136, 42, .14); }
.footer-content { width: min(100%, 42rem); margin: 2.5rem auto 0; display: flex; flex-direction: column; align-items: center; gap: 2rem; }
.footer h2 { margin: 0; color: var(--gold); font-family: "Great Vibes", cursive; font-size: clamp(3rem, 12vw, 4rem); font-weight: 400; }
.footer p { margin: .75rem auto 0; max-width: 20rem; color: var(--text); line-height: 1.55; }
.footer-note { margin-top: 2rem; color: #b0956e; font-size: .82rem; }
.success-page { min-height: 100vh; padding: 2rem 1rem; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1.25rem; text-align: center; background: linear-gradient(160deg, var(--cream) 0%, var(--cream-deep) 100%); }
.success-icon { width: 5rem; height: 5rem; color: #fff; background: linear-gradient(135deg, var(--gold-light), var(--gold)); border-radius: 50%; }
.success-page h1 { margin: 0; color: var(--ink); font-family: "Playfair Display", serif; font-size: 2rem; font-weight: 500; }
.success-page p { margin: 0; max-width: 22rem; color: var(--muted); line-height: 1.6; }
.success-note { width: min(100%, 24rem); padding: 1rem 1.5rem; background: rgba(184, 136, 42, .07); border: 1px solid rgba(184, 136, 42, .2); border-radius: .75rem; }

#blazor-error-ui { color-scheme: light only; background: #ffffe0; bottom: 0; box-shadow: 0 -1px 2px rgba(0, 0, 0, .2); display: none; left: 0; padding: .6rem 1.25rem .7rem; position: fixed; width: 100%; z-index: 1000; }
#blazor-error-ui .dismiss { cursor: pointer; position: absolute; right: .75rem; top: .5rem; }

.admin-page { min-height: 100vh; padding: 2rem 1rem; background: #f7f3ec; }
.admin-shell { width: min(100%, 72rem); margin: 0 auto; }
.admin-header { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1.5rem; }
.admin-header h1 { margin: 0; color: var(--ink); font-family: "Playfair Display", serif; font-size: clamp(2rem, 5vw, 3rem); font-weight: 600; }
.admin-login { width: min(100%, 28rem); display: flex; flex-direction: column; gap: .8rem; padding: 1.25rem; background: var(--paper); border: 1px solid rgba(184, 136, 42, .2); border-radius: 1rem; box-shadow: 0 2px 20px rgba(61, 43, 31, .07); }
.admin-login label { color: var(--gold); font-size: .85rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.admin-refresh { padding: .65rem 1rem; color: var(--gold); background: var(--paper); border: 1px solid rgba(184, 136, 42, .3); border-radius: .75rem; font-weight: 700; }
.admin-stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: .75rem; margin-bottom: 1.25rem; }
.admin-stats div { padding: 1rem; background: var(--paper); border: 1px solid rgba(184, 136, 42, .18); border-radius: .75rem; }
.admin-stats strong { display: block; color: var(--ink); font-family: "Playfair Display", serif; font-size: 2rem; line-height: 1; }
.admin-stats span { color: var(--muted); font-size: .85rem; text-transform: uppercase; letter-spacing: .08em; }
.admin-empty { padding: 1rem; color: var(--muted); background: var(--paper); border: 1px solid rgba(184, 136, 42, .18); border-radius: .75rem; }
.admin-list { display: flex; flex-direction: column; gap: 1rem; }
.admin-card { display: grid; grid-template-columns: 1fr; gap: 1rem; padding: 1rem; background: var(--paper); border: 1px solid rgba(184, 136, 42, .18); border-radius: 1rem; box-shadow: 0 2px 16px rgba(61, 43, 31, .06); }
.admin-card-top { display: flex; justify-content: space-between; gap: 1rem; }
.admin-card h2 { margin: 0; color: var(--ink); font-family: "Playfair Display", serif; font-size: 1.35rem; }
.admin-card-top p { margin: .2rem 0 0; color: var(--muted); font-size: .85rem; }
.admin-badge { align-self: flex-start; padding: .35rem .65rem; border-radius: 999px; font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.admin-badge.yes { color: #2f5f37; background: #eaf5ec; }
.admin-badge.no { color: #7f1026; background: #fff0f3; }
.admin-meta { display: flex; flex-wrap: wrap; gap: .5rem; margin: .75rem 0; color: var(--muted); font-size: .85rem; }
.admin-meta span { padding: .3rem .55rem; background: #f8f3ea; border-radius: 999px; }
.admin-message { margin: 0; color: var(--text); line-height: 1.65; white-space: pre-wrap; }
.admin-photo { display: block; align-self: start; overflow: hidden; border-radius: .75rem; border: 1px solid rgba(184, 136, 42, .18); background: #f8f3ea; }
.admin-photo img { display: block; width: 100%; max-height: 18rem; object-fit: cover; }

@media (min-width: 768px) {
    .hero-grid { flex-direction: row; justify-content: center; gap: 3rem; }
    .anniversary-mark { align-items: flex-end; }
    .form-grid { grid-template-columns: 1fr 1fr; }
    .section-card { padding: 2rem; }
    .footer-content { flex-direction: row; justify-content: center; gap: 3rem; text-align: left; }
    .guest-fields { grid-template-columns: 1fr 1fr; }
    .admin-stats { grid-template-columns: repeat(6, 1fr); }
    .admin-card { grid-template-columns: minmax(0, 1fr) 14rem; }
}

@media (max-width: 420px) {
    .section-card { padding: 1.25rem; }
    .submit-button { letter-spacing: .12em; }
    .polaroid-img, .polaroid-placeholder { width: min(13.75rem, 70vw); }
}
