/* Secret Santa – charte motion4ever (Poppins, bleu #0062ff, corail #fc7157, marine #263238) */

:root {
    --blue: #0062ff;
    --blue-dark: #2761f6;
    --blue-light: #f2f7ff;
    --coral: #fc7157;
    --navy: #263238;
    --grey: #6b7280;
    --border: #e5e7eb;
    --white: #fff;
    --success: #12805c;
    --radius: 12px;
    --shadow: 4px 4px 0 var(--navy);
    --shadow-hover: 6px 6px 0 var(--navy);
}

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

html {
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    font-family: "Poppins", "Helvetica Neue", Arial, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: var(--navy);
    background: var(--blue-light);
}

h1,
h2 {
    margin: 0 0 .5em;
    line-height: 1.2;
    font-weight: 800;
}

h1 {
    font-size: clamp(2rem, 6vw, 3.25rem);
}

h2 {
    font-size: 1.35rem;
    font-weight: 600;
}

a {
    color: var(--blue);
}

[hidden] {
    display: none !important;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

/* ---------- Mise en page ---------- */

.container {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 16px 48px;
    flex: 1;
}

.container--narrow {
    max-width: 920px;
}

.site-header {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1100px;
    width: 100%;
    margin: 0 auto;
    padding: 24px 16px;
}

.brand img {
    display: block;
    height: 40px;
    width: auto;
}

.site-footer {
    position: relative;
    z-index: 1;
    padding: 24px 16px;
    text-align: center;
    font-size: .875rem;
}

.site-footer a {
    color: var(--grey);
    text-decoration: none;
}

.site-footer a:hover {
    color: var(--blue);
}

/* ---------- Boutons ---------- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .4em;
    padding: .75em 1.4em;
    border: 2px solid var(--navy);
    border-radius: var(--radius);
    font: inherit;
    font-weight: 600;
    line-height: 1.2;
    color: var(--navy);
    background: var(--white);
    box-shadow: var(--shadow);
    cursor: pointer;
    text-decoration: none;
    transition: transform .15s ease, box-shadow .15s ease, background-color .15s ease;
}

.btn:hover:not(:disabled) {
    transform: translate(-2px, -2px);
    box-shadow: var(--shadow-hover);
}

.btn:active:not(:disabled) {
    transform: translate(2px, 2px);
    box-shadow: 1px 1px 0 var(--navy);
}

.btn:disabled {
    opacity: .5;
    cursor: not-allowed;
}

.btn--primary {
    color: var(--white);
    background: var(--blue);
}

.btn--accent {
    color: var(--white);
    background: var(--coral);
}

.btn--danger:hover:not(:disabled) {
    background: #ffe9e5;
}

.btn--ghost {
    box-shadow: 2px 2px 0 var(--navy);
}

.btn--ghost:hover:not(:disabled) {
    box-shadow: 3px 3px 0 var(--navy);
}

.btn--small {
    padding: .45em .9em;
    font-size: .875rem;
}

.btn--icon {
    padding: .45em .6em;
    font-size: 1rem;
}

.btn--block {
    width: 100%;
}

/* ---------- Cartes ---------- */

.card {
    margin-bottom: 28px;
    padding: 28px;
    border: 2px solid var(--navy);
    border-radius: var(--radius);
    background: var(--white);
    box-shadow: var(--shadow);
}

.card--center {
    text-align: center;
}

.card__head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.card__head h2 {
    margin: 0;
}

/* ---------- Accueil ---------- */

.hero {
    padding: 24px 0 32px;
    text-align: center;
}

.hero__kicker {
    display: inline-block;
    margin: 0 0 12px;
    padding: .25em .9em;
    border-radius: 999px;
    font-weight: 600;
    color: var(--white);
    background: var(--coral);
}

.hero h1 {
    color: var(--navy);
}

.event-meta {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    margin: 16px 0 0;
    padding: 0;
    list-style: none;
}

.event-meta li {
    padding: .4em 1em;
    border: 2px solid var(--navy);
    border-radius: 999px;
    background: var(--white);
}

.lead {
    margin: 0 0 24px;
    text-align: center;
    font-size: 1.1rem;
}

.waiting {
    max-width: 560px;
    margin: 0 auto;
}

.waiting__icon {
    font-size: 4rem;
    animation: wobble 2.4s ease-in-out infinite;
}

.tiles {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 20px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.tile {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 28px 16px 22px;
    border: 2px solid var(--navy);
    border-radius: var(--radius);
    font: inherit;
    color: var(--navy);
    background: var(--white);
    box-shadow: var(--shadow);
    cursor: pointer;
    transition: transform .15s ease, box-shadow .15s ease;
}

.tile:hover,
.tile:focus-visible {
    transform: translate(-3px, -3px) rotate(-1deg);
    box-shadow: 7px 7px 0 var(--navy);
    outline: none;
}

.tile__avatar {
    display: grid;
    place-items: center;
    width: 64px;
    height: 64px;
    border: 2px solid var(--navy);
    border-radius: 50%;
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--white);
    background: var(--blue);
}

.tile--c1 .tile__avatar {
    background: var(--coral);
}

.tile--c2 .tile__avatar {
    color: var(--navy);
    background: var(--blue-light);
}

.tile__name {
    font-size: 1.1rem;
    font-weight: 600;
    word-break: break-word;
}

.tile__seen {
    position: absolute;
    top: 10px;
    right: 10px;
    display: grid;
    place-items: center;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    font-size: .8rem;
    font-weight: 800;
    color: var(--white);
    background: var(--success);
}

/* ---------- Fenêtre de révélation ---------- */

.modal {
    position: fixed;
    inset: 0;
    z-index: 10;
    display: grid;
    place-items: center;
    padding: 16px;
}

.modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(38, 50, 56, .7);
    animation: fade-in .2s ease;
}

.modal__dialog {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 440px;
    padding: 36px 28px 28px;
    border: 2px solid var(--navy);
    border-radius: var(--radius);
    text-align: center;
    background: var(--white);
    box-shadow: 6px 6px 0 var(--navy);
    animation: pop-in .25s ease;
}

.modal__close {
    position: absolute;
    top: 8px;
    right: 12px;
    border: 0;
    font-size: 1.8rem;
    line-height: 1;
    color: var(--grey);
    background: none;
    cursor: pointer;
}

.step--password input {
    margin: 8px 0 4px;
}

.form-error {
    min-height: 1.5em;
    margin: 4px 0 12px;
    font-size: .9rem;
    font-weight: 500;
    color: #d93a1f;
}

.shake {
    animation: shake .4s ease;
}

.confetti {
    position: fixed;
    inset: 0;
    z-index: 11;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

/* Paquet cadeau en CSS */
.gift {
    position: relative;
    width: 140px;
    height: 140px;
    margin: 10px auto 0;
}

.gift__box,
.gift__lid {
    position: absolute;
    left: 50%;
    border: 2px solid var(--navy);
    background:
        linear-gradient(90deg, transparent 42%, var(--blue) 42%, var(--blue) 58%, transparent 58%),
        var(--coral);
}

.gift__box {
    bottom: 0;
    width: 120px;
    height: 90px;
    margin-left: -60px;
    border-radius: 0 0 8px 8px;
}

.gift__lid {
    bottom: 88px;
    width: 136px;
    height: 30px;
    margin-left: -68px;
    border-radius: 6px;
    transform-origin: 0 100%;
}

.gift__lid::before,
.gift__lid::after {
    content: "";
    position: absolute;
    bottom: 100%;
    width: 30px;
    height: 24px;
    border: 4px solid var(--blue);
    border-radius: 50% 50% 0 50%;
}

.gift__lid::before {
    left: 36px;
    transform: rotate(-20deg);
}

.gift__lid::after {
    right: 36px;
    border-radius: 50% 50% 50% 0;
    transform: rotate(20deg);
}

.gift.is-shaking {
    animation: gift-shake .5s ease-in-out 3;
}

.gift.is-open .gift__lid {
    animation: lid-off .6s ease-in forwards;
}

.gift.is-open .gift__box {
    animation: box-down .6s ease-in .2s forwards;
}

.reveal-text {
    opacity: 0;
    transform: scale(.6);
}

.reveal-text.is-visible {
    animation: name-in .6s cubic-bezier(.2, 1.6, .4, 1) forwards;
}

.step--reveal.is-done .gift {
    display: none;
}

.reveal-text p {
    margin: 0 0 6px;
}

.reveal-name {
    margin: 8px 0 16px !important;
    font-size: clamp(2rem, 9vw, 2.75rem);
    font-weight: 800;
    line-height: 1.15;
    color: var(--blue);
    word-break: break-word;
}

.reveal-hint {
    font-size: .95rem;
    color: var(--grey);
}

/* Neige */
.snow {
    position: fixed;
    inset: 0;
    z-index: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

/* ---------- Formulaires ---------- */

label {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: .875rem;
    font-weight: 600;
}

input[type="text"],
input[type="password"],
input[type="date"],
select {
    width: 100%;
    min-width: 0;
    padding: .65em .85em;
    border: 2px solid var(--navy);
    border-radius: 8px;
    font: inherit;
    font-weight: 400;
    color: var(--navy);
    background: var(--white);
}

input:focus,
select:focus {
    outline: 3px solid rgba(0, 98, 255, .35);
    outline-offset: 1px;
    border-color: var(--blue);
}

fieldset {
    display: contents;
    margin: 0;
    padding: 0;
    border: 0;
}

fieldset:disabled input,
fieldset:disabled .btn {
    opacity: .55;
}

.stack {
    display: grid;
    gap: 16px;
}

.grid-form {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    align-items: end;
    gap: 16px;
    margin-bottom: 20px;
}

.grid-form--exclusion {
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
}

.grid-form--exclusion .checkbox {
    grid-column: 1 / 3;
}

.grid-form__text {
    font-weight: 500;
    color: var(--grey);
    text-align: center;
}

.checkbox {
    flex-direction: row;
    align-items: center;
    gap: 8px;
    font-weight: 500;
}

.checkbox input {
    width: 18px;
    height: 18px;
    accent-color: var(--blue);
}

.input-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.inline {
    display: inline;
    margin: 0;
}

/* ---------- Administration ---------- */

.card--auth {
    max-width: 440px;
    margin: 24px auto;
}

.admin-title {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 20px;
}

.admin-title h1 {
    margin: 0;
    font-size: clamp(1.75rem, 5vw, 2.5rem);
}

.badge {
    display: inline-block;
    padding: .35em .9em;
    border: 2px solid var(--navy);
    border-radius: 999px;
    font-size: .85rem;
    font-weight: 600;
    background: var(--white);
}

.badge--locked {
    color: var(--white);
    background: var(--navy);
}

.count {
    display: inline-grid;
    place-items: center;
    min-width: 1.8em;
    height: 1.8em;
    margin-left: 4px;
    padding: 0 .4em;
    border-radius: 999px;
    font-size: .8rem;
    color: var(--white);
    background: var(--blue);
    vertical-align: middle;
}

.notice {
    margin: 0 0 24px;
    padding: 14px 18px;
    border-left: 5px solid var(--coral);
    border-radius: 8px;
    background: #fff1ee;
}

.help {
    margin: -4px 0 16px;
    color: var(--grey);
}

.empty {
    margin: 0;
    color: var(--grey);
    font-style: italic;
}

.flash {
    margin-bottom: 24px;
    padding: 14px 18px;
    border: 2px solid var(--navy);
    border-radius: var(--radius);
    font-weight: 500;
    box-shadow: var(--shadow);
}

.flash--success {
    background: #e3f7ee;
}

.flash--error {
    background: #ffe9e5;
}

.table-wrap {
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table th,
.table td {
    padding: 12px 8px;
    border-bottom: 1px solid var(--border);
    text-align: left;
    vertical-align: middle;
}

.table th {
    font-size: .8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .03em;
    color: var(--grey);
}

.table .input-group input {
    max-width: 180px;
    padding: .4em .6em;
}

.strong {
    font-weight: 600;
}

.right {
    text-align: right !important;
}

.status {
    font-size: .875rem;
    color: var(--grey);
}

.status--ok {
    font-weight: 600;
    color: var(--success);
}

.chips {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: .4em .6em .4em 1em;
    border: 2px solid var(--navy);
    border-radius: 999px;
    font-weight: 500;
    background: var(--blue-light);
}

.chip__arrow {
    font-weight: 800;
    color: var(--coral);
}

.chip__remove {
    width: 26px;
    height: 26px;
    border: 0;
    border-radius: 50%;
    font-size: 1.1rem;
    line-height: 1;
    color: var(--navy);
    background: transparent;
    cursor: pointer;
}

.chip__remove:hover {
    color: var(--white);
    background: var(--coral);
}

.actions {
    margin-bottom: 20px;
}

.pairs {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 10px;
    margin: 0 0 24px;
    padding: 0;
    list-style: none;
}

.pairs li {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--blue-light);
}

.pairs__arrow {
    color: var(--coral);
    white-space: nowrap;
}

.validate-box {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 18px;
    border: 2px dashed var(--coral);
    border-radius: var(--radius);
    background: #fff7f5;
}

.validate-box p {
    margin: 0;
    font-weight: 500;
}

/* ---------- Animations ---------- */

@keyframes fade-in {
    from { opacity: 0; }
}

@keyframes pop-in {
    from { opacity: 0; transform: scale(.9) translateY(10px); }
}

@keyframes shake {
    20%, 60% { transform: translateX(-8px); }
    40%, 80% { transform: translateX(8px); }
}

@keyframes wobble {
    0%, 100% { transform: rotate(0); }
    25% { transform: rotate(-8deg); }
    75% { transform: rotate(8deg); }
}

@keyframes gift-shake {
    0%, 100% { transform: rotate(0); }
    20% { transform: rotate(-9deg) scale(1.03); }
    40% { transform: rotate(8deg); }
    60% { transform: rotate(-6deg) scale(1.05); }
    80% { transform: rotate(5deg); }
}

@keyframes lid-off {
    to { transform: translate(60px, -140px) rotate(55deg); opacity: 0; }
}

@keyframes box-down {
    to { transform: translateY(30px) scale(.8); opacity: 0; }
}

@keyframes name-in {
    to { opacity: 1; transform: scale(1); }
}

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

/* ---------- Mobile ---------- */

@media (max-width: 640px) {
    .card {
        padding: 20px 16px;
    }

    .tiles {
        grid-template-columns: repeat(2, 1fr);
        gap: 14px;
    }

    .tile {
        padding: 22px 10px 18px;
    }

    .grid-form--exclusion {
        grid-template-columns: 1fr;
    }

    .grid-form--exclusion .checkbox {
        grid-column: auto;
    }

    .grid-form__text {
        text-align: left;
    }

    .validate-box .btn {
        width: 100%;
    }
}
