/* CSS v2.0 */ 
:root {
    color-scheme: light;
    --primary: #FFFFFF;
    --secondary: #1d3557;
    --background: #000000;
    --text: #D8D8D8;
    --field-bg: #e9eef5;
    --field-bg-focus: #f4f7fb;
    --field-border: #395079;
    --field-border-focus: #5575af;
    --field-placeholder: #5a6a80;
}

* {
    box-sizing: border-box;
}


body {
    font-family: "Barlow", sans-serif;
    font-weight: 400;
    font-style: normal;
    margin: 0;
    background: var(--background);
    color: var(--text);
    background-image: url("/static/background.48b840e09a52.jpg");
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
}

a {
    color: #1d3557;
}

a:visited {
    color:#1d3557;
}

a.back-to-round,
a.back-to-round:visited {
    color: #FFFFFF;
    text-decoration: underline;
}


.container {
    max-width: 960px;
    margin: 0 auto;
    padding: 1.5rem;
}

.site-header {
    background: #1d3557;
    border-bottom: 1px solid #ddd;
}

.site-header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.brand-wrap {
    display: flex;
    align-items: flex-end;
    gap: 0.5rem;
    position: relative;
}

.brand {
    font-weight: 700;
    text-decoration: none;
    color: var(--primary) !important;
    font-size: 1.2rem;
}

.brand-icon {
    width: 86px;
    height: auto;
    position: absolute;
    left: -2rem;
    bottom: -1.5rem;
    transform: rotate(-6deg);
    filter: drop-shadow(0 6px 18px rgba(0, 0, 0, 0.45));
    pointer-events: none;
}

.main-nav a {
    margin-right: 1rem;
    text-decoration: none;
    color: var(--primary);
}

.main-nav a:last-child {
    margin-right: 0;
}

.main-nav .userdisplay {
    border: 2px solid #32517c;
    color: #fff;
    padding: 0.4rem 0.9rem;
    border-radius: 999px;
    display: inline-block;
    margin-right: 0.5rem;
}

.main-nav .navbutton {
    background-color: #32517c;
    color: #fff;
    padding: 0.4rem 0.9rem;
    border-radius: 999px;
    display: inline-block;
    margin-right: 0.5rem;
}

.main-nav .navbutton:last-child {
    margin-right: 0;
}

.language-switcher select {
    font: inherit;
    padding: 0.25rem;
}

.button {
    /* font: inherit keeps <button> from falling back to the browser's own
       13px system font, which made submit buttons visibly smaller than the
       <a class="button"> links sitting next to them. */
    font: inherit;
    font-weight: 600;
    line-height: 1.5;
    display: inline-block;
    padding: 0.6rem 1.2rem;
    border-radius: 6px;
    text-decoration: none;
    text-align: center;
    border: 1px solid transparent;
    cursor: pointer;
}

.button.primary {
    background: var(--secondary);
    color: white;
    border-color: var(--secondary);
}

.button.secondary {
    background: var(--primary);
    color: var(--secondary);
    border: 1px solid var(--secondary);
}

.button.danger {
    background: #c1121f;
    color: white;
    border-color: #c1121f;
}

.hero {
    text-align: center;
    padding: 4rem 0;
}

.hero h1 {
    font-size: 2.4rem;
    margin-bottom: 1rem;
    color:white;
    letter-spacing: -0.5%;
}

.hero p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
}

.features {
    display: grid;
    gap: 1.5rem;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    color: var(--secondary  );
}

.features div {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

.flash {
    margin-bottom: 1rem;
    padding: 0.8rem 1rem;
    border-radius: 6px;
    background: white;
    color: var(--secondary);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.flash-success {
    border-left: 4px solid #2a9d8f;
}

.flash-error {
    border-left: 4px solid #e63946;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}

.round-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1rem;
}

.round-card {
    background: white;
    padding: 1rem;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
    color: var(--secondary);
}

.round-card h2 {
    margin-top: 0;
}

.participant-list {
    list-style: none;
    padding: 0;
    margin: 0;
    color: var(--secondary);
}

.participant-list li {
    background: white;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 999px;
    background: #f0f0f0;
    font-size: 0.8rem;
}

.badge-success {
    background: #1e5e46;
    color: white;
}

.badge-warning {
    background: #720c0c;
    color: white;
}

.badge-muted {
    background: #313142;
    color: white;
}

.form-grid {
    display: grid;
    gap: 1rem;
}

.form-control label {
    display: block;
    margin-bottom: 0.4rem;
}

.form-control input,
.form-control textarea,
.form-control select {
    /* Form controls do not inherit the page font on their own, so without
       this they fall back to the browser's system font. */
    font: inherit;
    width: 100%;
    padding: 0.6rem;
    border-radius: 6px;
    border: 2px solid var(--field-border);
    background: var(--field-bg);
    color: var(--secondary);
}

/* Checkboxes and radios are not text fields: keep the native control (and
   its intrinsic size) rather than stretching a tinted box across the row. */
.form-control input[type="checkbox"],
.form-control input[type="radio"] {
    width: auto;
    padding: 0;
    background: none;
    border: none;
    accent-color: var(--secondary);
}

.form-control textarea {
    resize: vertical;
}

.form-control input::placeholder,
.form-control textarea::placeholder {
    color: var(--field-placeholder);
    opacity: 1;
}

/* The resting border is already the dark navy, so focus cannot be signalled
   by turning it navy any more — and a navy ring is invisible against the
   near-black page. A lighter blue reads against both the dark pages and the
   white auth card. */
.form-control input:focus,
.form-control textarea:focus,
.form-control select:focus {
    outline: none;
    background: var(--field-bg-focus);
    border-color: var(--field-border-focus);
    box-shadow: 0 0 0 3px rgba(85, 117, 175, 0.45);
}

.form-control.has-error input,
.form-control.has-error textarea,
.form-control.has-error select {
    border-color: #e63946;
}

.error {
    color: #e63946;
    margin-top: 0.25rem;
}

.wishlist {
    list-style: none;
    padding: 0;
    display: grid;
    gap: 1rem;
    color: var(--secondary);

}

.wishlist li {
    background: white;
    padding: 1rem;
    border-radius: 8px;
    display: flex;
    justify-content: flex-start;
    align-items: flex-start;
    gap: 1rem;
}

.wishlist li.completed {
    opacity: 0.7;
}

.wishlist-actions {
    display: flex;
    gap: 0.5rem;
}

.wishlist-thumb {
    flex: 0 0 15%;
    max-width: 15%;
}

.wishlist-thumb img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    object-fit: cover;
}

.wishlist-info {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.wishlist-action {
    margin-left: auto;
    align-self: flex-start;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.wishlist-action button,
.wishlist-action a {
    white-space: nowrap;
}

.join_round {
    color: #2a9d8f;
}

.wishlist:not(.own) li.completed .wishlist-info h2,
.wishlist:not(.own) li.completed .wishlist-info p,
.wishlist:not(.own) li.completed .wishlist-info a {
    text-decoration: line-through;
    color: #6c757d;
}

.auth-card {
    max-width: 420px;
    margin: 2rem auto;
    padding: 2rem;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    color: var(--secondary);
}

.auth-card .status-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    margin-bottom: 1rem;
    border-radius: 50%;
    background: rgba(29, 53, 87, 0.08);
    font-size: 2rem;
}

.auth-card .hint {
    margin-top: 1rem;
    padding: 0.75rem 1rem;
    background: rgba(29, 53, 87, 0.06);
    border-radius: 8px;
    color: rgba(29, 53, 87, 0.8);
    line-height: 1.5;
}

.auth-card .action-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

.auth-card .action-row .button {
    flex: 1 1 160px;
    text-align: center;
}

.social-logins {
    margin-bottom: 1.5rem;
}

.provider-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.provider-list li {
    flex: 1 1 12rem;
}

.provider-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    width: 100%;
    padding: 0.65rem 1rem;
    border: 1px solid #dadce0;
    border-radius: 6px;
    background: #fff;
    color: #3c4043;
    font-weight: 600;
    text-decoration: none;
}

.provider-button:hover,
.provider-button:focus-visible {
    background: #f8f9fa;
    border-color: #c6c9cd;
}

.provider-mark {
    flex: none;
}

/* Provider buttons on the landing hero, which sits on the dark background
   image rather than a white card. */
.hero-social {
    max-width: 24rem;
    margin: 1.75rem auto 0;
}

.hero-social .hero-social-label {
    margin: 0 0 0.75rem;
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.85);
}

.divider {
    text-align: center;
    margin: 1.5rem 0;
    position: relative;
    font-size: 0.85rem;
    color: #6c757d;
}

.divider span {
    background: white;
    padding: 0 0.5rem;
    position: relative;
    z-index: 1;
}

.divider::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    border-top: 1px solid #ddd;
    transform: translateY(-50%);
    z-index: 0;
}

.alt-link {
    margin-top: 1rem;
    font-size: 0.9rem;
}

.alt-link a {
    color: var(--secondary);
    text-decoration: none;
}

.lightstyle {
    color: white;
    text-decoration: underline;
}

@media (max-width: 600px) {
    .site-header .container {
        flex-direction: column;
        align-items: flex-start;
    }

    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .wishlist li {
        flex-direction: column;
        align-items: flex-start;
    }

    .wishlist-thumb {
        max-width: 100%;
        width: 100%;
    }

    .wishlist-action {
        margin-left: 0;
        align-self: stretch;
        flex-direction: column;
        width: 100%;
    }
}

/* Footer with the legal links Meta and the GDPR both expect to find. */
.site-footer {
    margin-top: 3rem;
    padding: 1.5rem 0;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    font-size: 0.9rem;
}

.site-footer .container {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    flex-wrap: wrap;
}

.site-footer a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
}

.site-footer a:hover,
.site-footer a:focus-visible {
    text-decoration: underline;
}

.legal-page {
    background: white;
    color: var(--secondary);
    border-radius: 8px;
    padding: 2rem;
    margin: 2rem auto;
    max-width: 48rem;
    line-height: 1.6;
}

.legal-page h2 {
    margin-top: 2rem;
}

.legal-page .legal-updated {
    color: #6c757d;
    font-size: 0.9rem;
}

/* Invite page: autocomplete over people from earlier parties */
.participant-search {
    position: relative;
    margin-bottom: 1.5rem;
}

.participant-search small {
    display: block;
    margin-top: 0.4rem;
    opacity: 0.8;
}

.autocomplete-results {
    list-style: none;
    margin: 0.25rem 0 0;
    padding: 0.25rem;
    background: white;
    color: var(--secondary);
    border-radius: 8px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
    max-height: 18rem;
    overflow-y: auto;
    position: absolute;
    left: 0;
    right: 0;
    z-index: 20;
}

.autocomplete-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.6rem 0.75rem;
    border-radius: 6px;
    cursor: pointer;
}

.autocomplete-option:hover,
.autocomplete-option.is-active {
    background: #eef2f7;
}

.autocomplete-option.is-unavailable {
    cursor: default;
    opacity: 0.6;
}

.autocomplete-option.is-unavailable:hover {
    background: transparent;
}

.autocomplete-who {
    display: flex;
    flex-direction: column;
}

.autocomplete-who small {
    opacity: 0.7;
}

.autocomplete-action {
    font-weight: 600;
    white-space: nowrap;
}

.autocomplete-status {
    margin: 0.5rem 0 0;
}

.staged-recipients h3 {
    margin-bottom: 0.5rem;
}

.recipient-list {
    list-style: none;
    padding: 0;
    margin: 0 0 1rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.recipient {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: white;
    color: var(--secondary);
    border-radius: 999px;
    padding: 0.35rem 0.5rem 0.35rem 0.9rem;
}

.recipient-remove {
    border: none;
    background: #eef2f7;
    color: var(--secondary);
    border-radius: 999px;
    width: 1.5rem;
    height: 1.5rem;
    line-height: 1;
    cursor: pointer;
    font-size: 1rem;
}

.recipient-remove:hover {
    background: #c1121f;
    color: white;
}

/* Round detail: who is invited, who accepted */
.participant-who {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.participant-invited strong {
    font-weight: 500;
    word-break: break-all;
}

.participant-note {
    opacity: 0.7;
    font-size: 0.9rem;
}

.participants .muted {
    font-size: 0.9rem;
    opacity: 0.8;
}

.field-intro {
    display: block;
    margin-bottom: 0.4rem;
    opacity: 0.8;
}

/* Each action sits in its own block-level <form>, which used to break the row.
   Equal grid columns keep the buttons on one line and all the same width;
   auto-fit drops to fewer columns instead of overflowing on narrow screens. */
.round-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
    align-items: stretch;
    gap: 0.75rem;
    /* Wide enough that the longest label ("Archive this Secret Santa Party",
       219px at this font) still fits one line in a three-column row. */
    max-width: 50rem;
    margin-top: 1rem;
}

.round-actions form {
    margin: 0;
    display: flex;
}

.round-actions .button {
    width: 100%;
    padding-left: 1rem;
    padding-right: 1rem;
}

.round-actions > p {
    grid-column: 1 / -1;
    margin: 0;
}

/* Invite link: read-only field plus a copy button */
.copy-row {
    display: flex;
    align-items: stretch;
    gap: 0.5rem;
}

.copy-row input {
    flex: 1 1 auto;
    min-width: 0;
}

.copy-button {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    /* White rather than the tinted field colour: the icon carries its own
       near-white disc, which vanishes against white. */
    background: #fff;
    padding: 0.6rem 0.9rem;
}

.copy-button img {
    display: block;
    width: 20px;
    height: 20px;
}

.copy-feedback {
    display: block;
    margin-top: 0.4rem;
}

/* An author-level display:block beats the UA stylesheet's [hidden] rule, so
   the attribute has to be honoured explicitly or the element never hides. */
.copy-feedback[hidden] {
    display: none;
}

.copy-feedback.is-error {
    color: #ffb3ba;
}

.invite-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.invite-actions form {
    margin: 0;
}

/* The row buttons sit beside body text, so they step down from the 45px
   page-level buttons without changing the font. */
.button-small {
    padding: 0.3rem 0.75rem;
    font-size: 0.9rem;
}

/* A disabled button must not look like a live one. Without this the Draw lots
   button rendered identically whether or not it could be used, so clicking it
   simply did nothing. */
.button:disabled,
.button[disabled] {
    opacity: 0.45;
    cursor: not-allowed;
}

.start-blockers {
    grid-column: 1 / -1;
    margin: 0;
    font-size: 0.95rem;
}

.start-blockers p {
    margin: 0 0 0.25rem;
}

.start-blockers ul {
    margin: 0;
    padding-left: 1.2rem;
}

.confirm-card {
    background: white;
    color: var(--secondary);
    border-radius: 12px;
    padding: 2rem;
    margin: 2rem auto;
    max-width: 40rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.confirm-card h1 {
    margin-top: 0;
}

.confirm-warning {
    font-weight: 600;
    font-size: 1.1rem;
}

.confirm-pending {
    background: rgba(29, 53, 87, 0.06);
    border-left: 4px solid #c1121f;
    border-radius: 6px;
    padding: 0.85rem 1rem;
    margin-bottom: 0.5rem;
}

.confirm-pending-note {
    margin-top: 0;
}

.confirm-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

.confirm-actions form {
    margin: 0;
}

/* ---------------------------------------------------------------------------
   Error pages (404 / 403 / 400).
   These extend base.html, so they get the real header, footer and language
   switcher — the point of the exercise being that a wrong address should
   still look like the site rather than like nginx's grey default.
   The 500 page cannot use any of this: see templates/500.html.
   --------------------------------------------------------------------------- */
.error-page {
    text-align: center;
    padding: 3.5rem 0 4.5rem;
    max-width: 36rem;
    margin: 0 auto;
}

/* Decorative, and aria-hidden in the markup: the heading already says what
   happened, so a screen reader announcing "four hundred and four" first adds
   nothing. */
.error-code {
    font-size: 5rem;
    font-weight: 700;
    line-height: 1;
    margin: 0 0 0.5rem;
    color: var(--primary);
    opacity: 0.35;
    letter-spacing: -0.03em;
}

.error-page h1 {
    font-size: 2.1rem;
    margin: 0 0 1rem;
    color: var(--primary);
    letter-spacing: -0.01em;
}

.error-lead {
    font-size: 1.1rem;
    line-height: 1.55;
    margin: 0 0 2rem;
}

.error-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    flex-wrap: wrap;
}

@media (max-width: 480px) {
    .error-code { font-size: 3.5rem; }
    .error-page h1 { font-size: 1.6rem; }
    .error-actions .button { width: 100%; }
}
