/* =============================================================
   css/app.css — Système de design "Destinations"
   Palette : teal/emerald · Typographie : Outfit + DM Serif
   ============================================================= */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&family=DM+Serif+Display:ital@0;1&display=swap');

/* ── Variables ─────────────────────────────────────────────── */
:root {
    --teal-50:  #f0fdfa;
    --teal-100: #ccfbf1;
    --teal-200: #99f6e4;
    --teal-500: #14b8a6;
    --teal-600: #0d9488;
    --teal-700: #0f766e;
    --teal-800: #115e59;
    --teal-900: #134e4a;

    --sand-50:  #fafaf9;
    --sand-100: #f5f5f4;
    --sand-200: #e7e5e4;
    --sand-400: #a8a29e;
    --sand-600: #57534e;
    --sand-800: #292524;

    --radius-card: 1.25rem;
    --shadow-card: 0 4px 24px rgba(15, 118, 110, 0.08),
                   0 1px 3px rgba(0,0,0,.06);
    --shadow-hover: 0 8px 32px rgba(15, 118, 110, 0.15),
                    0 2px 8px rgba(0,0,0,.08);
}

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

body {
    font-family: 'Outfit', system-ui, sans-serif;
    color: var(--sand-800);
    -webkit-font-smoothing: antialiased;
}

/* ── Fond application ──────────────────────────────────────── */
.app-bg {
    background:
        radial-gradient(ellipse 80% 60% at 20% -10%, rgba(20,184,166,.12) 0%, transparent 60%),
        radial-gradient(ellipse 60% 50% at 85% 110%, rgba(16,185,129,.08) 0%, transparent 55%),
        linear-gradient(160deg, #f0fdfa 0%, #fafaf9 50%, #ecfdf5 100%);
    min-height: 100vh;
}

/* ── Logo / Titre hero ─────────────────────────────────────── */
.app-logo {
    width: 80px; height: 80px;
    background: linear-gradient(135deg, var(--teal-600), var(--teal-800));
    border-radius: 22px;
    display: flex; align-items: center; justify-content: center;
    font-size: 2.5rem;
    box-shadow: 0 8px 32px rgba(15,118,110,.25), 0 2px 8px rgba(0,0,0,.1);
}
.app-title {
    font-family: 'DM Serif Display', Georgia, serif;
    font-size: clamp(2rem, 6vw, 2.8rem);
    color: var(--teal-800);
    letter-spacing: -0.02em;
    margin: 0;
}
.app-subtitle {
    color: var(--sand-400);
    font-size: .95rem;
    font-weight: 400;
    letter-spacing: 0.04em;
    margin-top: .25rem;
}

/* ── Card ──────────────────────────────────────────────────── */
.card {
    background: #fff;
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-card);
    padding: 1.5rem;
    border: 1px solid rgba(20,184,166,.08);
}
@media (min-width: 640px) { .card { padding: 2rem; } }

/* ── Section title ─────────────────────────────────────────── */
.section-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--sand-600);
    letter-spacing: .04em;
    text-transform: uppercase;
    font-size: .8rem;
    margin-bottom: .75rem;
}

/* ── Boutons ───────────────────────────────────────────────── */
.btn-primary {
    background: linear-gradient(135deg, var(--teal-600), var(--teal-800));
    color: #fff;
    font-weight: 600;
    padding: .75rem 1.5rem;
    border-radius: .75rem;
    border: none;
    cursor: pointer;
    transition: transform .15s, box-shadow .15s, filter .15s;
    display: inline-flex; align-items: center; justify-content: center;
    gap: .4rem;
    font-size: .95rem;
    box-shadow: 0 4px 12px rgba(15,118,110,.25);
    text-decoration: none;
}
.btn-primary:hover {
    filter: brightness(1.08);
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(15,118,110,.3);
}
.btn-primary:active { transform: translateY(0); }

.btn-secondary {
    background: var(--sand-100);
    color: var(--sand-600);
    font-weight: 500;
    padding: .65rem 1.25rem;
    border-radius: .75rem;
    border: 1px solid var(--sand-200);
    cursor: pointer;
    transition: background .15s, border-color .15s;
    display: inline-flex; align-items: center; justify-content: center;
    gap: .4rem;
    font-size: .9rem;
    text-decoration: none;
}
.btn-secondary:hover { background: var(--sand-200); border-color: var(--sand-400); }

.btn-cancel {
    background: var(--sand-100);
    color: var(--sand-600);
    font-weight: 500;
    padding: .75rem 1.25rem;
    border-radius: .75rem;
    border: 1px solid var(--sand-200);
    cursor: pointer;
    transition: background .15s;
}
.btn-cancel:hover { background: var(--sand-200); }

.btn-danger {
    background: #fef2f2;
    color: #dc2626;
    font-weight: 600;
    padding: .75rem 1.5rem;
    border-radius: .75rem;
    border: 1px solid #fecaca;
    cursor: pointer;
    transition: background .15s;
    text-decoration: none;
}
.btn-danger:hover { background: #fee2e2; }

.btn-share {
    background: linear-gradient(135deg, #059669, #047857);
    color: #fff;
    font-weight: 600;
    padding: .6rem 1rem;
    border-radius: .625rem;
    border: none;
    cursor: pointer;
    transition: filter .15s, transform .15s;
    font-size: .875rem;
}
.btn-share:hover { filter: brightness(1.08); transform: translateY(-1px); }

.btn-copy {
    background: linear-gradient(135deg, var(--teal-500), var(--teal-700));
    color: #fff;
    font-weight: 600;
    padding: .6rem 1rem;
    border-radius: .625rem;
    border: none;
    cursor: pointer;
    transition: filter .15s, transform .15s;
    font-size: .875rem;
}
.btn-copy:hover { filter: brightness(1.08); transform: translateY(-1px); }
.btn-copy.btn-copied { background: #059669; }

/* ── Action buttons (edit/delete) ──────────────────────────── */
.action-btn {
    padding: .45rem .65rem;
    border-radius: .5rem;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
    transition: background .15s, transform .1s;
}
.action-btn:active { transform: scale(.92); }
.action-btn-blue { background: #dbeafe; color: #1d4ed8; }
.action-btn-blue:hover { background: #bfdbfe; }
.action-btn-red  { background: #fee2e2; color: #dc2626; }
.action-btn-red:hover  { background: #fecaca; }

/* ── Input ─────────────────────────────────────────────────── */
.input-field {
    border: 1.5px solid var(--sand-200);
    border-radius: .625rem;
    padding: .65rem .9rem;
    font-size: .9rem;
    font-family: inherit;
    transition: border-color .15s, box-shadow .15s;
    background: #fff;
    color: var(--sand-800);
    outline: none;
}
.input-field:focus {
    border-color: var(--teal-500);
    box-shadow: 0 0 0 3px rgba(20,184,166,.15);
}

.form-label {
    display: block;
    font-weight: 600;
    font-size: .875rem;
    color: var(--sand-600);
    margin-bottom: .4rem;
}
.form-hint {
    font-size: .75rem;
    color: var(--sand-400);
    margin-top: .25rem;
}

/* ── Régions checkboxes ────────────────────────────────────── */
.regions-checkboxes {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    padding: .75rem;
    background: var(--teal-50);
    border-radius: .75rem;
    border: 1.5px solid var(--teal-100);
}
.region-checkbox-label {
    display: flex;
    align-items: center;
    gap: .4rem;
    padding: .4rem .75rem;
    background: #fff;
    border-radius: .5rem;
    border: 1.5px solid var(--sand-200);
    cursor: pointer;
    font-size: .875rem;
    transition: border-color .15s, background .15s;
    user-select: none;
}
.region-checkbox-label:hover { border-color: var(--teal-500); background: var(--teal-50); }
.region-checkbox {
    accent-color: var(--teal-600);
    width: 1rem; height: 1rem;
}

/* ── Region cards (index) ──────────────────────────────────── */
.region-card { position: relative; }
.region-btn {
    border: 1.5px solid var(--sand-200);
    border-radius: var(--radius-card);
    padding: 1rem 1.25rem;
    background: #fff;
    cursor: pointer;
    transition: border-color .2s, background .2s, transform .15s, box-shadow .2s;
    font-family: inherit;
}
.region-btn:hover {
    border-color: var(--teal-500);
    background: var(--teal-50);
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

/* ── Guest card ────────────────────────────────────────────── */
.guest-card {
    border: 1.5px solid var(--sand-200);
    border-radius: var(--radius-card);
    padding: 1.25rem;
    background: #fff;
    transition: box-shadow .2s;
}
.guest-card:hover { box-shadow: var(--shadow-hover); }
.guest-card-expired { border-color: #fca5a5; background: #fff5f5; }

/* ── Badges ────────────────────────────────────────────────── */
.badge {
    display: inline-flex;
    align-items: center;
    font-size: .7rem;
    font-weight: 600;
    padding: .15rem .55rem;
    border-radius: 999px;
    letter-spacing: .02em;
}
.badge-red  { background: #fef2f2; color: #dc2626; border: 1px solid #fca5a5; }
.badge-teal { background: var(--teal-50); color: var(--teal-700); border: 1px solid var(--teal-200); }

/* ── QR Code section ───────────────────────────────────────── */
.qr-details { margin-top: .25rem; }
.qr-summary {
    cursor: pointer;
    font-size: .875rem;
    color: var(--teal-700);
    font-weight: 500;
    padding: .5rem .25rem;
    user-select: none;
    list-style: none;
    display: flex;
    align-items: center;
    gap: .35rem;
}
.qr-summary::-webkit-details-marker { display: none; }
.qr-summary::before {
    content: '▶';
    font-size: .6rem;
    transition: transform .2s;
}
.qr-details[open] .qr-summary::before { transform: rotate(90deg); }
.qr-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1rem 0 .5rem;
}
.qr-canvas {
    background: #fff;
    padding: .75rem;
    border-radius: .75rem;
    border: 1.5px solid var(--teal-100);
    display: inline-block;
}
.qr-canvas canvas, .qr-canvas img { display: block; }

/* ── Alerts ────────────────────────────────────────────────── */
.alert {
    padding: .875rem 1.25rem;
    border-radius: .75rem;
    font-weight: 500;
    font-size: .9rem;
}
.alert-success {
    background: #f0fdf4;
    color: #166534;
    border: 1px solid #bbf7d0;
}
.alert-error {
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
}

/* ── Empty state ───────────────────────────────────────────── */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--sand-400);
    font-size: .9rem;
}

/* ── Modals ────────────────────────────────────────────────── */
.modal-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,.45);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    z-index: 50;
}
.modal-box {
    background: #fff;
    border-radius: 1.25rem;
    padding: 1.75rem;
    width: 100%;
    max-width: 26rem;
    box-shadow: 0 20px 60px rgba(0,0,0,.2);
    animation: modal-in .2s ease;
}
@keyframes modal-in {
    from { opacity: 0; transform: scale(.95) translateY(8px); }
    to   { opacity: 1; transform: scale(1)  translateY(0);    }
}
.modal-title {
    font-family: 'DM Serif Display', Georgia, serif;
    font-size: 1.4rem;
    color: var(--teal-800);
    margin: 0 0 .25rem;
}
.modal-subtitle {
    font-size: .875rem;
    color: var(--sand-400);
    margin: 0 0 1.25rem;
}

/* ── Responsive tweaks ─────────────────────────────────────── */
@media (max-width: 480px) {
    .card { padding: 1.25rem; }
    .app-logo { width: 64px; height: 64px; font-size: 2rem; border-radius: 18px; }
}
