:root {
    --ink: #20243a;
    --muted: #6d7184;
    --brand: #3d2a77;
    --brand2: #6b55b4;
    --line: #e4e5ee;
    --paper: #fff;
    --soft: #f6f5fb;
    --shadow: 0 16px 44px #20204412;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: #f8f8fc;
    color: var(--ink);
    font: 16px/1.5 system-ui, -apple-system, BlinkMacSystemFont,
        "Segoe UI", sans-serif;
}

body.is-submitting {
    overflow: hidden;
}

.topbar {
    min-height: 66px;
    padding: 0 max(22px, calc((100% - 1200px) / 2));
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    background: #fff;
    border-bottom: 1px solid var(--line);
    color: var(--muted);
    font-size: 14px;
}

.brand {
    font-weight: 850;
    letter-spacing: -.04em;
    font-size: 22px;
    color: var(--brand);
    text-decoration: none;
}

.wrap {
    max-width: 1200px;
    margin: 34px auto 70px;
    padding: 0 22px;
}

.eyebrow {
    font-size: 11px;
    letter-spacing: .16em;
    font-weight: 800;
    color: var(--brand2);
}

h1 {
    font-size: clamp(29px, 4vw, 42px);
    letter-spacing: -.04em;
    line-height: 1.1;
    margin: 9px 0 10px;
}

.intro {
    color: var(--muted);
    max-width: 760px;
    margin: 0 0 25px;
}

.creator-grid,
.confirm-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.04fr) minmax(340px, .96fr);
    gap: 24px;
    align-items: start;
}

.form-panel,
.preview-panel {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 20px;
    padding: 24px;
    box-shadow: var(--shadow);
    min-width: 0;
}

.form-panel h2,
.preview-panel h2 {
    font-size: 18px;
    margin: 0 0 16px;
    letter-spacing: -.02em;
}

.field-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.field-grid .full {
    grid-column: 1 / -1;
}

label {
    display: block;
    font-weight: 650;
    font-size: 13px;
    color: #36394f;
    margin: 0 0 14px;
}

input,
select,
textarea {
    display: block;
    width: 100%;
    margin-top: 7px;
    border: 1px solid #cfd1df;
    background: #fbfbfe;
    color: var(--ink);
    border-radius: 10px;
    padding: 11px 12px;
    font: inherit;
    font-size: 14px;
    min-height: 44px;
}

textarea {
    resize: vertical;
    min-height: 92px;
}

input:focus,
select:focus,
textarea:focus {
    outline: 3px solid #dcd4ff;
    border-color: var(--brand2);
}

.section-gap {
    margin-top: 25px !important;
    padding-top: 22px;
    border-top: 1px solid var(--line);
}

.weekday {
    display: block;
    color: var(--brand2);
    font-size: 12px;
    font-weight: 750;
    margin-top: 5px;
}

.upload-label {
    margin-top: 6px;
}

.hint {
    display: block;
    font-size: 12px;
    color: var(--muted);
    font-weight: 400;
    margin-top: 6px;
}

.field-title {
    font-size: 13px;
    font-weight: 750;
}

.palette {
    display: flex;
    gap: 9px;
    flex-wrap: wrap;
    margin: 12px 0 8px;
}

.color-dot {
    width: 31px;
    height: 31px;
    border-radius: 50%;
    border: 2px solid #c8cad7;
    background: var(--swatch);
    padding: 0;
    cursor: pointer;
    position: relative;
    box-shadow: inset 0 0 0 1px #ffffff80;
}

.color-dot.selected {
    outline: 3px solid var(--brand2);
    outline-offset: 3px;
    border-color: #fff;
}

.color-dot:focus-visible {
    outline: 3px solid var(--brand);
    outline-offset: 3px;
}

.form-actions {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
    margin-top: 23px;
}

.primary,
.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 12px 18px;
    border-radius: 11px;
    background: var(--brand);
    border: 0;
    color: #fff;
    text-decoration: none;
    font-weight: 750;
    font-size: 14px;
    cursor: pointer;
    transition: background-color .18s ease, opacity .18s ease;
}

.primary:hover,
.button:hover {
    background: #2f205e;
}

.primary:disabled,
.primary[aria-disabled="true"],
.button:disabled {
    cursor: wait;
    opacity: .75;
}

.secondary {
    background: #fff;
    color: var(--brand);
    border: 1px solid #cfc9e8;
}

.secondary:hover {
    background: #f4f1ff;
    color: var(--brand);
}

.text-link {
    color: var(--brand);
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
}

.preview-panel {
    position: sticky;
    top: 18px;
}

.preview-heading {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 20px;
}

.preview-heading h2 {
    margin: 0;
}

.preview-heading p {
    margin: 1px 0 0;
    color: var(--muted);
    font-size: 12px;
}

.live-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #36b37e;
    box-shadow: 0 0 0 4px #36b37e20;
}

.single-card {
    background: var(--card-bg, #fff);
    border: 1px solid #d5d5df;
    border-radius: 13px;
    padding: 24px 22px 16px;
    min-height: 440px;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-shadow: 0 12px 25px #1d214018;
    transition: background-color .18s ease;
}

.card-message {
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(18px, 2.1vw, 25px);
    line-height: 1.3;
    text-align: center;
    white-space: pre-line;
    overflow-wrap: anywhere;
    width: 100%;
    margin: 5px 0 17px;
    min-height: 35px;
}

.card-photo-wrap {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 0 17px;
    min-height: 85px;
    max-height: 180px;
}

.card-photo-wrap img {
    display: block;
    max-width: 100%;
    max-height: 180px;
    object-fit: contain;
    border-radius: 7px;
}

.photo-placeholder {
    border: 1px dashed #a8aabb;
    border-radius: 9px;
    color: #777b8e;
    text-align: center;
    padding: 24px;
    width: 100%;
    font-size: 13px;
}

.demo-card {
    width: min(100%, 330px);
    background: linear-gradient(135deg, #243d6b, #13294b);
    color: #fff;
    border-radius: 12px;
    padding: 14px 16px;
    box-shadow: 0 8px 18px #10234630;
    margin-top: auto;
}

.demo-brand {
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .02em;
}

.demo-number {
    font-size: clamp(13px, 1.7vw, 17px);
    letter-spacing: .08em;
    margin: 15px 0 7px;
    white-space: nowrap;
}

.demo-amount {
    font-size: 28px;
    font-weight: 850;
    line-height: 1.1;
}

.demo-disclaimer {
    font-size: 8px;
    font-weight: 800;
    letter-spacing: .04em;
    margin-top: 8px;
}

.demo-expiry {
    font-size: 9px;
    color: #dce6ff;
    margin-top: 5px;
}

.card-footer {
    font-weight: 850;
    font-size: 13px;
    color: #24345b;
    margin-top: 18px;
    text-align: center;
    white-space: nowrap;
}

.preview-note {
    font-size: 12px;
    color: var(--muted);
    margin: 14px 0 0;
}

.error {
    padding: 12px 14px;
    background: #fff0f0;
    color: #8a2020;
    border: 1px solid #f0bcbc;
    border-radius: 10px;
    margin: 15px 0;
}

.summary {
    display: grid;
    grid-template-columns: 150px 1fr;
    gap: 12px 15px;
    margin: 0;
}

.summary dt {
    color: var(--muted);
    font-size: 13px;
}

.summary dd {
    margin: 0;
    font-size: 14px;
    font-weight: 650;
    overflow-wrap: anywhere;
}

.summary + * {
    margin-top: 24px;
}

.confirm-grid .form-actions form {
    margin: 0;
}

.recipient-wrap {
    max-width: 800px;
    text-align: center;
}

.success-mark {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: #e4f8ed;
    color: #16804b;
    display: grid;
    place-items: center;
    font-size: 26px;
    font-weight: 800;
    margin: 0 auto 16px;
}

.recipient-card {
    max-width: 460px;
    margin: 25px auto;
}

.recipient-card .single-card {
    min-height: 490px;
}

.recipient-meta {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 13px;
    padding: 15px;
    text-align: left;
}

.recipient-meta p {
    margin: 4px 0;
}

.demo-warning {
    color: #8b5b12;
    background: #fff6df;
    border-radius: 10px;
    padding: 11px;
    font-size: 12px;
}

.center-actions {
    display: flex;
    justify-content: center;
    gap: 18px;
    align-items: center;
    flex-wrap: wrap;
    margin-top: 20px;
}

.order-reference {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
    margin: 18px auto 20px;
    padding: 14px 16px;
    max-width: 560px;
    background: #fff;
    border: 1px solid #dcd5f0;
    border-radius: 13px;
    box-shadow: 0 8px 22px #2020440b;
}

.order-reference span {
    color: var(--muted);
    font-size: 13px;
}

.order-reference strong {
    font-size: 17px;
    letter-spacing: .02em;
    color: var(--brand);
    overflow-wrap: anywhere;
}

.order-reference p {
    flex-basis: 100%;
    margin: 0;
    font-size: 13px;
}

.status-success {
    border-color: #b7e5c8;
    background: #f5fff8;
}

.status-warning {
    border-color: #f0d6a2;
    background: #fffaf0;
}

.copy-reference {
    border: 1px solid #cfc9e8;
    background: #f6f3ff;
    color: var(--brand);
    border-radius: 8px;
    padding: 7px 10px;
    font: inherit;
    font-size: 12px;
    font-weight: 750;
    cursor: pointer;
}

.copy-reference:hover {
    background: #eae4ff;
}

.copy-reference:focus-visible {
    outline: 3px solid #dcd4ff;
    outline-offset: 2px;
}

/* Full-screen submission overlay */
.submission-overlay {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 22px;
    background: rgba(24, 15, 55, .82);
    backdrop-filter: blur(4px);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity .18s ease, visibility .18s ease;
}

.submission-overlay.is-visible {
    opacity: 1;
    visibility: visible;
    pointer-events: all;
}

.submission-box {
    width: min(100%, 390px);
    padding: 30px 25px;
    border-radius: 20px;
    background: #fff;
    color: var(--ink);
    box-shadow: 0 24px 80px #0004;
    text-align: center;
}

.submission-box h2 {
    margin: 18px 0 7px;
    color: var(--brand);
    font-size: 22px;
}

.submission-box p {
    margin: 0;
    color: var(--muted);
    font-size: 14px;
}

.submission-spinner {
    width: 58px;
    height: 58px;
    margin: 0 auto;
    border: 5px solid #e8e2fb;
    border-top-color: var(--brand2);
    border-right-color: #a98fe8;
    border-radius: 50%;
    animation: gift-email-spin .8s linear infinite;
}

@keyframes gift-email-spin {
    to {
        transform: rotate(360deg);
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
    }
}

@media (max-width: 850px) {
    .creator-grid,
    .confirm-grid {
        grid-template-columns: 1fr;
    }

    .preview-panel {
        position: static;
        grid-row: 1;
    }

    .form-panel {
        grid-row: 2;
    }

    .single-card {
        min-height: 380px;
    }

    .preview-panel {
        padding: 18px;
    }

    .wrap {
        margin-top: 24px;
    }
}

@media (max-width: 520px) {
    .topbar {
        min-height: 58px;
        padding: 0 16px;
    }

    .brand {
        font-size: 19px;
    }

    .topbar span:last-child {
        font-size: 12px;
    }

    .wrap {
        padding: 0 12px;
    }

    .form-panel,
    .preview-panel {
        padding: 17px;
        border-radius: 15px;
    }

    .field-grid {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .field-grid .full {
        grid-column: auto;
    }

    .summary {
        grid-template-columns: 1fr;
        gap: 3px;
    }

    .summary dd {
        margin-bottom: 9px;
    }

    .single-card {
        min-height: 345px;
        padding: 19px 14px 13px;
    }

    .demo-card {
        padding: 12px;
    }

    .demo-number {
        font-size: 13px;
    }

    .card-photo-wrap {
        max-height: 140px;
    }

    .card-photo-wrap img {
        max-height: 140px;
    }

    .form-actions .primary {
        width: 100%;
    }

    .submission-box {
        padding: 25px 18px;
    }
    
    
/* Restore rounded corners throughout Quick & Easy */
.form-panel,
.preview-panel,
.single-card,
.demo-card,
.submission-box {
    border-radius: 18px;
}

input,
select,
textarea {
    border-radius: 10px;
}

button,
.button,
a.button {
    border-radius: 12px;
}

.color-dot {
    border-radius: 50%;
}

.error {
    border-radius: 12px;
}

@media (max-width: 600px) {
    .form-panel,
    .preview-panel,
    .single-card {
        border-radius: 14px;
    }
}
}
