:root {
    --sage: #879b82;
    --sage-deep: #586c56;
    --ice-blue: #cbdde1;
    --ice-blue-deep: #7999a1;
    --silver: #b7b9b8;
    --cream: #fbf7ef;
    --warm-white: #fffdf9;
    --ink: #3f4740;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    color: var(--ink);
    background: var(--cream);
    font-family: var(--theme-body-font, Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif);
}

:root[data-wedster-theme] :is(h1, h2, h3, h4, .lead-copy, .invitation-salutation, [class$="-nav"] strong) {
    font-family: var(--theme-heading-font) !important;
}

:root[data-wedster-theme] :is([class$="-card"], [class*="-card "], [class$="-panel"], [class*="-panel "]) {
    border-radius: var(--theme-radius) !important;
}

.welcome-shell {
    position: relative;
    display: grid;
    min-height: 100svh;
    place-items: center;
    overflow: hidden;
    padding: 1.25rem;
    background:
        radial-gradient(circle at 50% 15%, rgb(203 221 225 / 42%), transparent 32rem),
        linear-gradient(155deg, var(--warm-white), var(--cream));
}

.welcome-card {
    position: relative;
    z-index: 1;
    width: min(100%, 44rem);
    padding: clamp(2.5rem, 8vw, 5rem) clamp(1.5rem, 7vw, 4.5rem);
    border: 1px solid rgb(183 185 184 / 70%);
    border-radius: 1.5rem;
    background: rgb(255 253 249 / 88%);
    box-shadow: 0 1.5rem 4rem rgb(63 71 64 / 10%);
    backdrop-filter: blur(0.75rem);
}

.eyebrow {
    color: var(--sage-deep);
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.22em;
    text-transform: uppercase;
}

h1 {
    margin: 0.7rem 0;
    color: var(--sage-deep);
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(3rem, 13vw, 6.8rem);
    font-weight: 400;
    letter-spacing: -0.055em;
    line-height: 0.95;
}

.ornament {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
    margin: 1.5rem auto;
    color: var(--ice-blue-deep);
}

.ornament span {
    width: 3.5rem;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--silver));
}

.ornament span:last-child {
    background: linear-gradient(90deg, var(--silver), transparent);
}

.ornament i {
    font-style: normal;
}

.lead-copy {
    max-width: 31rem;
    margin: 0 auto;
    color: #657067;
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(1.05rem, 4vw, 1.25rem);
    line-height: 1.7;
}

.primary-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-top: 2rem;
    padding: 0.82rem 1.25rem;
    border: 1px solid var(--sage-deep);
    border-radius: 999px;
    color: var(--warm-white);
    background: var(--sage-deep);
    font-size: 0.95rem;
    font-weight: 650;
    text-decoration: none;
    transition: transform 160ms ease, background 160ms ease;
}

.primary-action:hover,
.primary-action:focus-visible {
    color: white;
    background: #485c47;
    transform: translateY(-1px);
}

.primary-action:disabled {
    cursor: wait;
    opacity: 0.65;
    transform: none;
}

.auth-shell,
.dashboard-shell,
.management-shell,
.invitation-shell {
    min-height: 100svh;
    padding: 1.25rem;
    background:
        radial-gradient(circle at 100% 0%, rgb(203 221 225 / 55%), transparent 26rem),
        var(--cream);
}

.auth-shell {
    display: grid;
    place-items: center;
}

.auth-card,
.dashboard-card {
    width: min(100%, 31rem);
    padding: clamp(1.5rem, 6vw, 3rem);
    border: 1px solid rgb(183 185 184 / 65%);
    border-radius: 1.35rem;
    background: var(--warm-white);
    box-shadow: 0 1.2rem 3.5rem rgb(63 71 64 / 9%);
}

.invitation-shell {
    position: relative;
    display: grid;
    min-height: 100svh;
    place-items: center;
    overflow: hidden;
    padding: 1.25rem;
}

.invitation-card {
    position: relative;
    z-index: 1;
    width: min(100%, 36rem);
    padding: clamp(2rem, 7vw, 4rem);
    border: 1px solid rgb(183 185 184 / 65%);
    border-radius: 1.5rem;
    background: rgb(255 253 249 / 94%);
    box-shadow: 0 1.5rem 4rem rgb(63 71 64 / 10%);
    text-align: center;
}

.invitation-title,
.management-title {
    margin: 0.55rem 0 1rem;
    font-size: clamp(2.35rem, 10vw, 4.6rem);
}

.invitation-salutation {
    color: var(--sage-deep);
    font-family: Georgia, "Times New Roman", serif;
    font-size: 1.35rem;
}

.invitation-copy,
.section-copy {
    color: #667068;
    line-height: 1.65;
}

.invitee-list {
    display: grid;
    gap: 0.5rem;
    margin: 1.25rem 0 1.75rem;
    padding: 0;
    list-style: none;
}

.invitee-list li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.7rem 0.9rem;
    border-radius: 0.75rem;
    background: rgb(203 221 225 / 30%);
    text-align: left;
}

.invitee-list small {
    color: #69736b;
}

.invitation-remember {
    display: inline-flex;
    margin-top: 0.5rem;
    text-align: left;
}

.management-shell {
    padding: clamp(1.25rem, 4vw, 3rem);
}

.management-grid {
    display: grid;
    max-width: 80rem;
    margin: 0 auto;
    gap: 1.5rem;
}

.management-panel,
.group-overview {
    padding: clamp(1.25rem, 4vw, 2.25rem);
    border: 1px solid rgb(183 185 184 / 65%);
    border-radius: 1.35rem;
    background: var(--warm-white);
    box-shadow: 0 1rem 3rem rgb(63 71 64 / 7%);
}

.management-title {
    font-size: clamp(2rem, 8vw, 3.4rem);
}

.success-note {
    border-color: rgb(135 155 130 / 45%);
    color: var(--sage-deep);
    background: rgb(135 155 130 / 15%);
}

.guest-editor-list {
    display: grid;
    gap: 1rem;
}

.guest-editor {
    position: relative;
    padding: 1.1rem;
    border: 1px solid #d9dcda;
    border-radius: 1rem;
    background: #fcfaf5;
}

.guest-editor legend {
    float: none;
    width: auto;
    margin: 0 0 0.8rem;
    color: var(--sage-deep);
    font-family: Georgia, "Times New Roman", serif;
    font-size: 1.15rem;
}

.remove-person {
    position: absolute;
    top: 0.7rem;
    right: 0.75rem;
    border: 0;
    color: #707771;
    background: transparent;
    font-size: 1.5rem;
    line-height: 1;
}

.remove-person:disabled {
    opacity: 0.25;
}

.guest-options {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1.25rem;
    margin-top: 1rem;
}

.form-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 1.5rem;
}

.overview-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.overview-heading strong {
    color: var(--sage-deep);
}

.empty-state {
    padding: 2rem 1rem;
    color: #747c75;
    text-align: center;
}

.group-card {
    padding: 1rem 0;
    border-top: 1px solid #e1e2df;
}

.group-card h2 {
    margin: 0;
    color: var(--sage-deep);
    font-family: Georgia, "Times New Roman", serif;
    font-size: 1.35rem;
}

.group-card-heading {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.75rem;
}

.text-action {
    padding: 0.15rem;
    border: 0;
    color: var(--sage-deep);
    background: transparent;
    font-size: 0.82rem;
    font-weight: 650;
    text-decoration: underline;
    text-decoration-color: rgb(88 108 86 / 35%);
    text-underline-offset: 0.2rem;
}

.text-action:hover,
.text-action:focus-visible {
    color: #354b35;
    text-decoration-color: currentColor;
}

.text-action-danger {
    color: #945f5a;
}

.text-action:disabled {
    cursor: wait;
    opacity: 0.5;
}

.group-card > p {
    margin: 0.35rem 0 0.8rem;
    color: #747c75;
    font-size: 0.9rem;
}

.chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.guest-chip,
.status-badge {
    display: inline-flex;
    padding: 0.3rem 0.55rem;
    border-radius: 999px;
    font-size: 0.75rem;
}

.guest-chip {
    color: #536057;
    background: rgb(203 221 225 / 45%);
}

.contact-list {
    margin-top: 0.9rem;
}

.contact-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding-top: 0.65rem;
}

.contact-actions {
    display: flex;
    flex: 0 0 auto;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.35rem 0.55rem;
}

.contact-row strong,
.contact-row small {
    display: block;
}

.contact-row small {
    color: #7a817b;
}

.status-badge {
    flex: 0 0 auto;
    color: var(--sage-deep);
    background: rgb(135 155 130 / 16%);
}

@media (min-width: 992px) {
    .management-grid {
        grid-template-columns: minmax(0, 1.65fr) minmax(19rem, 0.75fr);
        align-items: start;
    }

    .group-overview {
        position: sticky;
        top: 2rem;
        max-height: calc(100svh - 4rem);
        overflow-y: auto;
    }
}

.back-link {
    display: inline-block;
    margin-bottom: 2rem;
    color: #667068;
    font-size: 0.9rem;
    text-decoration: none;
}

.back-link:hover {
    color: var(--sage-deep);
}

.auth-title,
.dashboard-title {
    margin: 0.55rem 0 1rem;
    font-size: clamp(2.3rem, 10vw, 4rem);
}

.auth-copy {
    margin-bottom: 2rem;
    color: #667068;
    line-height: 1.65;
}

.form-label,
.form-check-label {
    font-size: 0.95rem;
    font-weight: 600;
}

.form-control,
.form-check-input {
    border-color: #c9cdca;
}

.form-control:focus,
.form-check-input:focus {
    border-color: var(--ice-blue-deep);
    box-shadow: 0 0 0 0.22rem rgb(121 153 161 / 18%);
}

.form-check-input:checked {
    border-color: var(--sage-deep);
    background-color: var(--sage-deep);
}

.code-input {
    padding: 0.75rem 1rem;
    font-size: clamp(1.7rem, 8vw, 2.5rem);
    font-weight: 650;
    letter-spacing: 0.3em;
    text-align: center;
}

.dashboard-shell {
    padding: clamp(1.25rem, 5vw, 3rem);
}

.dashboard-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 70rem;
    margin: 0 auto 3rem;
    gap: 1rem;
}

.dashboard-nav strong {
    display: block;
    margin-top: 0.2rem;
    color: var(--sage-deep);
    font-family: Georgia, "Times New Roman", serif;
    font-size: 1.4rem;
}

.secondary-action {
    padding: 0.6rem 0.9rem;
    border: 1px solid #bcc1bd;
    border-radius: 999px;
    color: var(--ink);
    background: rgb(255 253 249 / 65%);
}

.dashboard-link {
    display: inline-flex;
    margin: 1rem 0 0 0.5rem;
    text-decoration: none;
}

.dashboard-card {
    width: min(100%, 70rem);
    margin: 0 auto;
}

.dashboard-welcome {
    margin-bottom: 1rem;
}

.dashboard-rsvps {
    width: min(100%, 70rem);
    margin: 0 auto;
}

.dashboard-section-heading {
    padding: 1.25rem 0.25rem 0.75rem;
}

.dashboard-section-heading h2 {
    margin: 0.35rem 0;
    color: var(--sage-deep);
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(1.8rem, 7vw, 2.7rem);
    font-weight: 400;
}

.dashboard-section-heading p {
    max-width: 40rem;
    margin: 0;
    color: #687269;
    line-height: 1.55;
}

.dashboard-rsvp-grid {
    display: grid;
    gap: 1rem;
}

.dashboard-rsvp-card {
    display: grid;
    padding: 1.25rem;
    border: 1px solid rgb(183 185 184 / 65%);
    border-radius: 1.2rem;
    background: var(--warm-white);
    box-shadow: 0 1rem 3rem rgb(63 71 64 / 7%);
    gap: 1rem;
}

.dashboard-rsvp-group {
    color: var(--ice-blue-deep);
    font-size: 0.7rem;
    font-weight: 750;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.dashboard-rsvp-card h3 {
    margin: 0.25rem 0 0.4rem;
    color: var(--sage-deep);
    font-family: Georgia, "Times New Roman", serif;
    font-size: 1.55rem;
    font-weight: 400;
}

.dashboard-rsvp-card p {
    margin: 0.15rem 0 0;
    color: #6f7971;
    font-size: 0.82rem;
}

.dashboard-rsvp-counts {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.dashboard-rsvp-counts span {
    padding: 0.4rem 0.6rem;
    border-radius: 999px;
    color: #5e6961;
    background: rgb(203 221 225 / 35%);
    font-size: 0.72rem;
}

.dashboard-rsvp-action {
    width: 100%;
    margin-top: 0;
}

@media (min-width: 768px) {
    .dashboard-rsvp-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.botanical {
    position: absolute;
    width: 13rem;
    height: 24rem;
    opacity: 0.22;
    transform: rotate(-18deg);
    background:
        radial-gradient(ellipse at 25% 20%, var(--sage) 0 9%, transparent 10%),
        radial-gradient(ellipse at 70% 34%, var(--ice-blue-deep) 0 8%, transparent 9%),
        radial-gradient(ellipse at 30% 52%, var(--sage) 0 10%, transparent 11%),
        radial-gradient(ellipse at 72% 69%, var(--silver) 0 8%, transparent 9%),
        linear-gradient(78deg, transparent 49%, var(--sage-deep) 50% 51%, transparent 52%);
}

.botanical-left {
    left: -5rem;
    bottom: -5rem;
}

.botanical-right {
    top: -6rem;
    right: -5rem;
    transform: rotate(162deg);
}

@media (min-width: 768px) {
    .welcome-shell {
        padding: 3rem;
    }

    .botanical {
        width: 20rem;
        height: 35rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition: none !important;
    }
}
