/* Wedding colour scheme - change these to re-theme the whole page */
:root {
    --cream:        #F4EDDF;  /* PRIMARY: Pantone 11-0103 TCX Cream White */
    --espresso:       #3B2A22;  /* Rich Espresso: buttons, borders, headings */
    --espresso-text:  #4A372D;  /* slightly softer espresso for body text */
    --espresso-light: #5C4436;  /* button hover (mocha) */
    --emerald:        #0F4D3A;  /* text and headings (9.6:1 on ivory) */
    --emerald-dark:   #0A2E23;  /* button hover */
    --royal:          #9B1B30;  /* royal red: headings and links (8.0:1 on ivory) */
    --royal-text:     #7A1726;  /* deeper royal red: body text (10.4:1) */
    --royal-dark:     #5E0F1C;  /* button hover (burgundy) */
    --gold:         #C9A45C;  /* decorative lines and borders only - too light for text */
    --gold-text:    #6B5226;  /* deep gold for text, e.g. NAME labels (7.2:1 on ivory) */
    --gold-light:   #E6CF9A;
    --ivory:        #FFFDF6;  /* card background */
    --champagne:    #F5ECD7;
}

body {
    /* background: var(--emerald-dark); */
    background: var(--cream);
    font-family: 'IM Fell English', Georgia, serif;
    min-height: 100vh;
    min-height: 100dvh;   /* phones: ignore the address bar so short pages don't scroll */
    padding: 2rem 1rem;

    /* Sticky footer: the page is at least the full window height, laid out
       top-to-bottom, and the footer's margin-top: auto pushes it to the bottom */
    margin: 0;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
}

/* Soft gold and red glows behind the card */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background: /* https://www.w3schools.com/cssref/func_radial-gradient.php */
     radial-gradient(ellipse at 20% 10%, rgba(201, 164, 92, 0.15) 0%, transparent 55%), /* gold glow */
     radial-gradient(ellipse at 80% 90%, rgba(155, 27, 48, 0.08) 0%, transparent 55%);
    z-index: 0;
}

.mainPage {
    padding: 2.5rem 2.2rem;
    /* background: linear-gradient(160deg, var(--ivory) 0%, var(--champagne) 100%); */
    background: var(--ivory);
    /* color: var(--emerald); */
    color: var(--royal-text);
    border: 1px solid var(--gold);
    /* outline: 1px solid var(--gold-light); */   /* thin double gold frame */
    outline-offset: -10px;
    border-radius: 6px;
    box-shadow: 0 12px 40px rgba(60, 50, 30, 0.12);
    text-align: center;   /* centre everything inside the main page */

    max-width: 860px;
    width: 100%;              /* fill up to max-width inside the flex layout */
    box-sizing: border-box;
    margin: 0 auto;
    position: relative;
    z-index: 5;
}

.mainPage h1,
.mainPage h2 {
    color: var(--royal);
    font-weight: normal;
    letter-spacing: 0.08em;
}

/* Small gold line under the main heading */

.mainPage h1::after {
    content: '';
    display: block;
    width: 80px;
    height: 1px;
    margin: 0.8rem auto 0;
    background: var(--gold);
}


/* Labels sit on their own line, so the textbox goes underneath */
.mainPage label {
    display: block;
    margin-bottom: 0.5rem;
}

/* Textboxes blend in with the main page background */
.mainPage input[type="text"] {
    display: block;
    width: 100%;
    max-width: 400px;
    box-sizing: border-box;
    margin: 0 auto 1rem;
    padding: 0.6rem 0.8rem;
    background: transparent;
    border: 1px solid var(--gold);
    border: 1px solid var(--royal);
    border-radius: 4px;
    color: inherit;
    font: inherit;
}

.mainPage input[type="text"]:focus {
    outline: none;
    border-color: var(--royal);
    box-shadow: 0 0 0 3px rgba(201, 164, 92, 0.35); /* gold glow */
    box-shadow: 0 0 0 3px rgba(155, 27, 48, 0.20);
}

/* Buttons: royal red with gold edge */
.mainPage button {
    margin: 0.3rem;
    padding: 0.7rem 1.6rem;
    background: var(--royal);
    color: var(--ivory);
    border: 1px solid var(--gold);
    border: 1px solid var(--royal);
    border-radius: 4px;
    font: inherit;
    letter-spacing: 0.04em;
    cursor: pointer;
}

.mainPage button:hover {
    background: var(--royal-dark);
    color: var(--gold-light);
}

/* The "Back" button looks like a plain link */
.mainPage button.link {
    background: none;
    border: none;
    color: var(--royal);
    text-decoration: underline;
}

.mainPage a {
    color: var(--royal);
}


.mainPage a:hover {
    color: var(--gold-text);
}


/* RSVP summary */
.mainPage dt {
    margin-top: 0.8rem;
    color: var(--gold-text);
    font-weight: bold;
    font-size: 0.85rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.mainPage dd {
    margin-left: 0;
}

/* Errors get a box so they stand out from the normal text */
.mainPage .error {
    display: inline-block;
    padding: 0.6rem 1rem;
    color: #8E1B2C;
    background: #F9E6E8;
    border: 1px solid #8E1B2C;
    border-radius: 4px;
}

/* Footer: always at the bottom of the page, centred, same colour as the text */
footer {
    margin-top: auto;      /* pushes it to the bottom */
    padding-top: 2rem;
    text-align: center;
    color: var(--royal-text);
    font-size: 0.9rem;
    position: relative;
    z-index: 5;            /* sit above the background glow */
}

/* Party details, shown under the guest's RSVP */
.eventDetails {
    margin: 2rem auto 1rem;
    padding-top: 1.5rem;
    max-width: 640px;   /* wide enough for the two dress code pictures */
    border-top: 1px solid var(--gold);   /* thin gold divider */
}

/* Dress code mood boards: men on the left, women on the right (not clickable) */
.dressCodeImages {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-top: 1.5rem;
}

.dressCodeImages figure {
    margin: 0;
}

.dressCodeImages img {
    display: block;
    width: 100%;
    height: auto;
    border: 1px solid var(--gold);
    border-radius: 6px;
    box-shadow: 0 6px 20px rgba(60, 50, 30, 0.15);
    pointer-events: none;   /* clicks and drags do nothing */
    user-select: none;
}

.dressCodeImages figcaption {
    margin-top: 0.4rem;
    color: var(--gold-text);
    font-weight: bold;
    font-size: 0.85rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

/* "Good to know" note: one paragraph per line, with space between them */
.mainPage .notes p {
    margin: 0 0 0.9rem;
    line-height: 1.5;
}

.mainPage .notes p:last-child {
    margin-bottom: 0;
}

/* "Already RSVP'd? Enter your PIN" - a click-to-open box on the name screen */
.pinBox {
    margin: 0.5rem auto 1rem;
    max-width: 400px;
}

.pinBox summary {
    cursor: pointer;
    font-size: 0.9rem;
    text-decoration: underline;
    margin-bottom: 0.8rem;
}

.pinBox input[type="text"] {
    max-width: 160px;
    text-align: center;
    letter-spacing: 0.4em;
}

.mainPage dd.pinNote {
    font-size: 0.85rem;
    font-style: italic;
    margin-bottom: 0.5rem;
}

/* Green "Your RSVP has been updated" message */
.mainPage .success {
    display: inline-block;
    padding: 0.6rem 1rem;
    color: #1E5631;
    background: #E6F2E8;
    border: 1px solid #1E5631;
    border-radius: 4px;
}

/* Outline button, for "I can't make it anymore" */
.mainPage button.secondary {
    background: transparent;
    color: var(--royal);
    border: 1px solid var(--royal);
}

.mainPage button.secondary:hover {
    background: var(--royal);
    color: var(--ivory);
}

/* Small italic help text under a label */
.mainPage .hint {
    margin: -0.2rem auto 0.8rem;
    max-width: 440px;
    font-size: 0.85rem;
    font-style: italic;
}

/* Plus one boxes: text box with round + and - buttons beside it */
.plusOnes {
    margin-bottom: 1rem;
}

.plusOneRow {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    max-width: 490px;
    margin: 0 auto 0.6rem;
}

.mainPage .plusOneRow input[type="text"] {
    min-width: 0;         /* lets the box shrink on narrow phones instead of pushing the buttons off */
    flex: 1;
    margin: 0;
}

.mainPage button.iconButton {
    flex: none;
    width: 2.4rem;
    height: 2.4rem;
    margin: 0;
    padding: 0;
    border-radius: 50%;
    font-size: 1.3rem;
    line-height: 1;
}

/* the minus is an outline so + stands out as the main action */
.mainPage button.iconButton.remove {
    background: transparent;
    color: var(--royal);
    border: 1px solid var(--royal);
}

.mainPage button.iconButton.remove:hover {
    background: var(--royal);
    color: var(--ivory);
}

/* + is greyed out once the maximum number of boxes is reached */
.mainPage button.iconButton:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

/* Long names or addresses wrap instead of stretching the card */
.mainPage {
    overflow-wrap: anywhere;
}

/* ---------------------------------------------------------------
   PHONES (screens 600px wide or less)
   --------------------------------------------------------------- */
@media (max-width: 600px) {
    body {
        padding: 1rem 0.75rem;
    }

    /* less padding so the content gets more of the screen */
    .mainPage {
        padding: 1.8rem 1.1rem;
    }

    .mainPage h1 {
        font-size: 1.5rem;
        margin-top: 0;
    }

    /* bigger + and - so they're easy to tap (44px is the recommended size) */
    .mainPage button.iconButton {
        width: 2.75rem;
        height: 2.75rem;
    }

    /* main buttons: a bit more room for thumbs */
    .mainPage button {
        padding: 0.8rem 1.4rem;
    }

    /* mood boards one above the other, so the outfits are big enough to see */
    .dressCodeImages {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    footer {
        padding-top: 1.5rem;
    }
}

/* The invitation heading wraps over a few lines, so keep it neat */
.mainPage h1 {
    line-height: 1.3;
    max-width: 640px;
    margin-left: auto;
    margin-right: auto;
}

/* Form steps: the gold line moves from under the main heading to under "RSVP" */
.mainPage h1.noLine::after {
    display: none;
}

.mainPage h2.withLine::after {
    content: '';
    display: block;
    width: 80px;
    height: 1px;
    margin: 0.8rem auto 0;
    background: var(--gold);
}
