@import url("https://fonts.googleapis.com/css2?family=Cormorant+Garamond:wght@400;500;600&family=Great+Vibes&display=swap");

@font-face {
    font-family: "Battley";
    src: url("/assets/fonts/Battley-RUS.woff") format("woff");
    font-weight: 400;
    font-style: normal;
}

@font-face {
    font-family: "Caravan";
    src: url("/assets/fonts/Caravan.otf") format("opentype");
    font-weight: 400;
    font-style: normal;
}

:root {
    color-scheme: light;
    --bg: #e8ddbf;
    --paper: #f5ecd4;
    --paper-shadow: #eadcb7;
    --border: rgba(98, 101, 61, 0.22);
    --text: #58603b;
    --text-strong: #454c2f;
    --muted: rgba(88, 96, 59, 0.72);
    --accent: #697244;
    --line: rgba(105, 114, 68, 0.22);
    --shadow: 0 24px 60px rgba(94, 83, 42, 0.15);
    --radius: 30px;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-5: 1.25rem;
    --space-6: 1.5rem;
    --space-8: 2rem;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: "Cormorant Garamond", Georgia, serif;
    background:
        radial-gradient(circle at top, rgba(255, 255, 255, 0.6), transparent 30%),
        linear-gradient(180deg, #efe5c6 0%, var(--bg) 100%);
    color: var(--text);
}

input,
select,
button {
    font: inherit;
}

textarea {
    font: inherit;
    resize: vertical;
}

button {
    cursor: pointer;
}

.invite-layout,
.admin-shell {
    width: min(100%, 760px);
    margin: 0 auto;
    padding: 20px 16px 40px;
}

.admin-shell {
    display: grid;
    gap: var(--space-4);
}

.admin-shell-auth {
    min-height: 100vh;
    display: grid;
    place-items: center;
}

.admin-shell-create {
    min-height: 100vh;
    display: grid;
    align-content: start;
}

.admin-card {
    background: rgba(250, 244, 226, 0.95);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: var(--space-5);
}

.admin-auth-card {
    width: min(100%, 420px);
}

.admin-create-card {
    max-width: 620px;
    width: 100%;
    margin: 0 auto;
}

.stack {
    display: grid;
    gap: var(--space-4);
}

.stack-tight {
    gap: var(--space-2);
}

.eyebrow {
    display: inline-block;
    margin-bottom: var(--space-3);
    color: var(--accent);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.16em;
}

h1,
h2,
p {
    margin: 0;
}

h1 {
    font-size: clamp(2rem, 6vw, 3.2rem);
    line-height: 0.95;
    margin-bottom: var(--space-4);
    color: var(--text-strong);
    font-weight: 600;
}

h2 {
    font-size: 1.35rem;
    margin-bottom: var(--space-3);
    color: var(--text-strong);
    font-weight: 600;
}

.lead,
.muted {
    color: var(--muted);
}

.form-grid {
    margin-top: var(--space-4);
}

.field {
    display: grid;
    gap: var(--space-2);
}

.field span {
    font-size: 0.95rem;
}

.field input,
.field select,
.field textarea {
    width: 100%;
    padding: 0.9rem 1rem;
    border: 2px solid var(--border);
    border-radius: 12px;
    background: rgba(255, 252, 244, 0.92);
    color: var(--text-strong);
}

.field small {
    color: var(--muted);
    font-size: 0.88rem;
}

button {
    border: 0;
    border-radius: 999px;
    padding: 0.95rem 1rem;
    background: var(--accent);
    color: #f9f4e6;
}

.button-link,
.button-secondary,
.button-danger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    width: 100%;
    padding: 0.72rem 1rem;
    border-radius: 999px;
    text-decoration: none;
    font: inherit;
    font-size: 1rem;
    line-height: 1;
}

.button-link {
    background: var(--accent);
    color: #f9f4e6;
}

.button-secondary {
    background: rgba(233, 224, 197, 0.82);
    color: var(--text-strong);
}

.button-danger {
    background: #875f4a;
    color: #fff7f0;
}

.guest-item {
    display: grid;
    gap: var(--space-3);
    padding: 1.1rem;
    border: 2px solid rgba(98, 101, 61, 0.18);
    border-radius: 22px;
    background: rgba(255, 250, 238, 0.96);
    box-shadow:
        0 10px 24px rgba(94, 83, 42, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.45);
}

.guest-item-copy {
    display: grid;
    gap: 0.2rem;
}

.guest-item-actions {
    gap: 0.85rem;
}

.guest-item-copy strong {
    font-size: 1.65rem;
    line-height: 0.95;
    color: var(--text-strong);
    font-weight: 600;
}

.guest-item-copy .muted {
    font-size: 0.8rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--accent);
}

code {
    display: block;
    width: 100%;
    overflow-wrap: anywhere;
    padding: var(--space-3);
    border-radius: 12px;
    background: rgba(233, 224, 197, 0.7);
    color: var(--text-strong);
}

.form-message {
    margin-bottom: var(--space-4);
    padding: 0.9rem 1rem;
    border-radius: 14px;
}

.form-message p + p {
    margin-top: 0.35rem;
}

.form-message-success {
    background: rgba(107, 115, 66, 0.1);
    border: 1px solid rgba(107, 115, 66, 0.2);
}

.form-message-error {
    background: rgba(122, 85, 67, 0.08);
    border: 1px solid rgba(122, 85, 67, 0.18);
}

.admin-toolbar {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    justify-content: space-between;
}

.toolbar-actions {
    display: grid;
    gap: 0.75rem;
}

.section-head {
    display: flex;
    gap: 1rem;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.action-group {
    display: grid;
    gap: 0.55rem;
}

.guest-comment {
    margin-top: 0.35rem;
    font-size: 1rem;
    line-height: 1.2;
    color: var(--text);
    opacity: 0.92;
}

.guest-meta {
    margin-top: 0.7rem;
    display: grid;
    gap: 0.25rem;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 1.2rem;
    line-height: 1.25;
    color: var(--muted);
}

.guest-meta-label {
    display: inline-block;
    margin-right: 0.2rem;
    font-weight: 400;
    color: inherit;
    font-size: 0.82rem;
}

.invitation-card {
    position: relative;
    min-height: calc(100vh - 40px);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 52px 30px 46px;
    overflow: hidden;
    border: 1px solid rgba(91, 96, 58, 0.18);
    border-radius: 36px;
    background:
        radial-gradient(circle at 20% 18%, rgba(255, 255, 255, 0.34), transparent 22%),
        radial-gradient(circle at 80% 82%, rgba(234, 220, 183, 0.3), transparent 26%),
        linear-gradient(180deg, rgba(255, 251, 240, 0.52), rgba(239, 226, 189, 0.2)),
        repeating-linear-gradient(
            0deg,
            rgba(255, 255, 255, 0.03) 0,
            rgba(255, 255, 255, 0.03) 2px,
            rgba(230, 216, 177, 0.05) 2px,
            rgba(230, 216, 177, 0.05) 4px
        ),
        var(--paper);
    box-shadow: var(--shadow);
}

.invitation-card::before,
.invitation-card::after {
    content: "";
    position: absolute;
    pointer-events: none;
}

.invitation-card::before {
    inset: 14px;
    border: 1px solid rgba(107, 115, 66, 0.13);
    border-radius: 28px;
}

.invitation-card::after {
    left: 24px;
    right: 24px;
    bottom: 24px;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(107, 115, 66, 0.26), transparent);
}

.invitation-card > * {
    position: relative;
    z-index: 1;
}

.invitation-card > div:first-child::before {
    content: "";
    position: absolute;
    top: -6px;
    left: 50%;
    width: 120px;
    height: 1px;
    transform: translateX(-50%);
    background: linear-gradient(90deg, transparent, var(--line), transparent);
}

.invite-decor {
    position: absolute;
    pointer-events: none;
    opacity: 1;
    background-color: #5c633c;
    -webkit-mask-repeat: no-repeat;
    -webkit-mask-position: center;
    -webkit-mask-size: contain;
    mask-repeat: no-repeat;
    mask-position: center;
    mask-size: contain;
}

.invite-decor-top {
    position: relative;
    display: block;
    width: 190px;
    height: 52px;
    margin: 30px auto 18px;
    inset: auto;
    opacity: 0.58;
    transform: none;
    background-color: #5c633c;
    -webkit-mask-image: url("/assets/decor/branch-top.svg");
    mask-image: url("/assets/decor/branch-top.svg");
}

.invite-decor-bottom {
     display: none;
    right: 16px;
    bottom: 18px;
    width: 190px;
    height: 62px;
    transform: rotate(2deg);
    opacity: 0.3;
    -webkit-mask-image: url("/assets/decor/branch-bottom.svg");
    mask-image: url("/assets/decor/branch-bottom.svg");
}

.invite-decor-left {
    top: 18px;
    left: 15px;
    width: 246px;
    height: 282px;
    opacity: 0.06;
    transform: rotate(0deg);
    -webkit-mask-image: url("/assets/decor/ornament-left.svg");
    mask-image: url("/assets/decor/ornament-left.svg");
}

.invite-decor-right {
    display: none;
    right: -24px;
    bottom: 136px;
    width: 96px;
    height: 128px;
    opacity: 0.11;
    -webkit-mask-image: url("/assets/decor/ornament-right.svg");
    mask-image: url("/assets/decor/ornament-right.svg");
}

.invite-kicker {
    margin-top: 30px;
    text-align: center;
    font-size: 1rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    font-weight: 600;
}

.invite-names {
    /*margin-top: 4px;*/
    text-align: center;
    font-family: "Caravan", "Great Vibes", "Brush Script MT", cursive;
    font-size: clamp(3.9rem, 15vw, 6.1rem);
    line-height: 0.88;
    font-weight: 400;
    color: #485030;
    text-wrap: balance;
}

.couple-story {
    margin-top: 3.2rem;
    display: grid;
    gap: 0.9rem;
}

.couple-story-title {
    text-align: center;
    font-size: 1.05rem;
    line-height: 1.1;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--text-strong);
}

.couple-photos {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: 250px;
    padding: 0.6rem 0 0.4rem;
}

.couple-photo {
    margin: 0;
    position: relative;
    width: min(40vw, 150px);
    filter: drop-shadow(0 12px 18px rgba(94, 83, 42, 0.14));
}

.couple-photo-left {
    transform: translateX(14px) rotate(-8deg);
    z-index: 2;
}

.couple-photo-right {
    margin-left: -12px;
    transform: translateX(-14px) translateY(24px) rotate(9deg);
    z-index: 1;
}

.couple-photo-frame {
    aspect-ratio: 3 / 4;
    position: relative;
    overflow: hidden;
    padding: 0.7rem 0.7rem 2.2rem;
    border-radius: 6px;
    border: 1px solid rgba(91, 96, 58, 0.18);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.7), rgba(247, 240, 220, 0.95)),
        var(--paper);
    box-shadow:
        0 10px 24px rgba(94, 83, 42, 0.08),
        inset 0 0 0 10px #fffaf0,
        inset 0 -34px 0 rgba(255, 250, 240, 0.98);
}

.couple-photo-frame img {
    position: absolute;
    top: 0.7rem;
    right: 0.7rem;
    bottom: 2.2rem;
    left: 0.7rem;
    display: block;
    width: calc(100% - 1.4rem);
    height: calc(100% - 2.9rem);
    object-fit: cover;
    border-radius: 2px;
}


.couple-photo figcaption {
    position: absolute;
    left: 0.7rem;
    right: 0.7rem;
    bottom: 0.3rem;
    text-align: center;
    font-family: "Caravan", "Great Vibes", "Brush Script MT", cursive;
    font-size: 2.2rem;
    line-height: 1;
    color: var(--text-strong);
    z-index: 1;
    pointer-events: none;
}
/*.couple-photo figcaption {
    margin-top: -2.35rem;
    text-align: center;
    font-family: "Caravan", "Great Vibes", "Brush Script MT", cursive;
    font-size: 1.7rem;
    line-height: 1;
    color: var(--text-strong);
    position: relative;
    z-index: 1;
    pointer-events: none;
}*/

.invite-copy {
    max-width: 25rem;
    margin: 34px auto 0;
    text-align: center;
    font-size: 1.3rem;
    line-height: 1.38;
    letter-spacing: 0.01em;
    color: var(--text-strong);
}

.invite-date {
    margin-top: 40px;
    text-align: center;
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: center;
    gap: 0.3rem 0.6rem;
    color: var(--text-strong);
    text-transform: uppercase;
}

.invite-date-day,
.invite-date-year {
    font-size: clamp(2.8rem, 11vw, 4rem);
    line-height: 0.95;
    letter-spacing: 0.02em;
    font-weight: 500;
}

.invite-date-month {
    font-size: clamp(1.55rem, 5.8vw, 2.35rem);
    line-height: 1;
    letter-spacing: 0.08em;
    font-weight: 500;
}

.invite-date-tail {
    font-size: clamp(1.1rem, 4.2vw, 1.6rem);
    line-height: 1;
    letter-spacing: 0.08em;
    font-weight: 500;
}

.invite-schedule {
    margin-top: 1.8rem;
    display: grid;
    gap: 1.8rem;
}

.invite-schedule-title {
    text-align: center;
    font-family: "Caravan", "Great Vibes", "Brush Script MT", cursive;
    font-size: clamp(2.4rem, 10vw, 3.6rem);
    line-height: 0.9;
    color: var(--text-strong);
}

.schedule-card {
    display: grid;
    gap: 0.2rem;
    padding: 1rem 1rem 1.05rem;
    border: 2px solid rgba(98, 101, 61, 0.18);
    border-radius: 22px;
    background: rgba(255, 250, 238, 0.72);
    text-align: center;
}

.schedule-time {
    font-size: 2rem;
    line-height: 1;
    color: var(--text-strong);
}

.schedule-event {
    margin-top: 0.2rem;
    font-size: 1.15rem;
    line-height: 1.15;
    color: var(--text-strong);
}

.schedule-place {
    margin-top: 0.15rem;
    font-size: 0.95rem;
    line-height: 1.15;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--accent);
}

.schedule-address {
    margin-top: 0.2rem;
    font-size: 1rem;
    line-height: 1.2;
    color: var(--text);
}

.schedule-link {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: fit-content;
    margin: 0.45rem auto 0;
    padding: 0.58rem 0.95rem;
    border: 2px solid rgba(98, 101, 61, 0.22);
    border-radius: 999px;
    color: var(--text-strong);
    text-decoration: none;
    font-size: 0.92rem;
    line-height: 1;
}

.dresscode-card {
    margin-top: 1rem;
    display: grid;
    gap: 0.65rem;
    padding: 1rem 0.95rem 1.05rem;
    border: 2px solid rgba(98, 101, 61, 0.18);
    border-radius: 24px;
    background: rgba(255, 250, 238, 0.74);
    text-align: center;
}

.rsvp-card {
    margin-top: 1rem;
    display: grid;
    gap: 0.9rem;
    padding: 1rem 0.95rem 1.05rem;
    border: 2px solid rgba(98, 101, 61, 0.18);
    border-radius: 24px;
    background: rgba(255, 250, 238, 0.74);
}

.rsvp-title {
    text-align: center;
    font-size: 1.2rem;
    line-height: 1.15;
    color: var(--text-strong);
}

.rsvp-choice-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.65rem;
}

.rsvp-choice-group .is-active {
    box-shadow: 0 10px 24px rgba(94, 83, 42, 0.12);
}

.rsvp-yes-fields {
    display: grid;
    gap: 0.75rem;
}

.rsvp-yes-fields[hidden] {
    display: none;
}

.rsvp-summary {
    display: grid;
    gap: 0.45rem;
    padding: 1rem;
    border-radius: 18px;
    background: rgba(255, 252, 244, 0.85);
    border: 1px solid rgba(98, 101, 61, 0.18);
}

.rsvp-summary p {
    line-height: 1.3;
}

.dresscode-title {
    font-size: 1.2rem;
    line-height: 1.1;
    color: var(--text-strong);
}

.dresscode-copy {
    font-size: 1rem;
    line-height: 1.2;
    color: var(--text);
}

.dresscode-palette {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.6rem 0.45rem;
    justify-items: center;
    margin-top: 0.25rem;
}

.dresscode-swatch {
    display: block;
    width: 100%;
    max-width: 46px;
    aspect-ratio: 1;
    border-radius: 999px;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.38),
        0 6px 14px rgba(94, 83, 42, 0.08);
}

.swatch-peach { background: #F4C7A0; }
.swatch-vanilla-one { background: #F5E9B9; }
.swatch-vanilla-two { background: #ffd3e8; }
.swatch-soft-olive { background: #D5D6AE; }
.swatch-stone-sage { background: #D0D2C5; }
.swatch-mist-teal { background: #AEC1BB; }
.swatch-powder-sky { background: #CADCF0; }
.swatch-dusty-rose { background: #DEC9DA; }

.invite-signoff {
    margin-top: 44px;
    text-align: center;
}

.invite-signoff p {
    font-size: 1.35rem;
}

.invite-couple {
    margin-top: 12px;
    font-family: "Caravan", "Great Vibes", "Brush Script MT", cursive;
    font-size: clamp(3.2rem, 13vw, 4.9rem);
    line-height: 0.9;
    color: var(--text-strong);
}

.font-preview {
    margin-top: 2rem;
    display: grid;
    gap: 0.8rem;
}

.font-preview-title {
    text-align: center;
    font-size: 0.82rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--muted);
}

.font-preview-card {
    display: grid;
    gap: 0.45rem;
    padding: 1rem 1.1rem;
    border: 2px solid rgba(98, 101, 61, 0.18);
    border-radius: 20px;
    background: rgba(255, 250, 238, 0.78);
}

.font-preview-label {
    font-size: 0.78rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--accent);
}

.font-preview-names,
.font-preview-couple {
    text-align: center;
    color: var(--text-strong);
}

.font-preview-names {
    font-size: clamp(2.4rem, 10vw, 3.8rem);
    line-height: 0.9;
}

.font-preview-couple {
    font-size: clamp(2rem, 8vw, 3.2rem);
    line-height: 0.92;
}

.font-preview-card-caravan .font-preview-names,
.font-preview-card-caravan .font-preview-couple {
    font-family: "Caravan", "Great Vibes", cursive;
}

.font-preview-card-great-vibes .font-preview-names,
.font-preview-card-great-vibes .font-preview-couple {
    font-family: "Great Vibes", "Brush Script MT", cursive;
}

.font-preview-card-battley .font-preview-names,
.font-preview-card-battley .font-preview-couple {
    font-family: "Battley", "Caravan", "Great Vibes", cursive;
}

.font-preview-card-cormorant .font-preview-names,
.font-preview-card-cormorant .font-preview-couple {
    font-family: "Cormorant Garamond", Georgia, serif;
}

.invite-note {
    margin-top: 20px;
    text-align: center;
    font-size: 0.95rem;
    color: var(--muted);
}

@media (min-width: 768px) {
    .invite-layout,
    .admin-shell {
        padding-top: 32px;
    }

    .guest-item {
        grid-template-columns: 1fr auto;
        align-items: center;
    }

    .guest-item-actions {
        grid-template-columns: 1fr 220px;
    }

    .toolbar-actions {
        grid-auto-flow: column;
        align-items: center;
    }

    .invitation-card {
        min-height: 920px;
        max-width: 640px;
        margin: 0 auto;
        padding: 68px 58px 58px;
    }

    .invite-decor-top {
        width: 220px;
        height: 60px;
    }

    .invite-decor-bottom {
        width: 210px;
        height: 66px;
    }

    .invite-decor-left {
        width: 112px;
        height: 146px;
        left: 18px;
        top: 22px;
    }

    .invite-decor-right {
        width: 112px;
        height: 140px;
        right: -18px;
    }

    .couple-story {
        margin-top: 1.2rem;
    }

    .couple-story-title {
        font-size: 1.1rem;
    }

    .couple-photos {
        min-height: 250px;
    }

    .couple-photo {
        width: 170px;
    }
}

@media (max-width: 767px) {
    .admin-shell {
        padding: 14px 12px 28px;
        gap: 0.85rem;
    }

    .admin-card {
        padding: 1rem;
        border-radius: 24px;
    }

    .admin-toolbar {
        gap: 0.85rem;
    }

    .toolbar-actions {
        width: 100%;
        grid-template-columns: 1fr 1fr;
    }

    .guest-item {
        padding: 1rem;
        gap: 0.9rem;
    }

    .guest-item-copy strong {
        font-size: 1.5rem;
    }

    .action-group {
        grid-template-columns: 1fr 1fr 1fr;
    }
}
