/* ─── Variables & Reset ───────────────────────────────────────────────── */
:root {
    --orange: #ed6839;
    --orange-dark: #d45a2e;
    --orange-light: rgba(237, 104, 57, 0.15);
    --text: #f5f5f5;
    --text-muted: #888888;
    --text-dim: #444444;
    --bg: #0d0d0d;
    --surface: #1a1a1a;
    --surface-2: #242424;
    --border: rgba(255, 255, 255, 0.08);
    --success: #22c55e;
    --error: #ef4444;
    --radius-sm: 10px;
    --radius-md: 18px;
    --radius-lg: 28px;
    --shadow: 0 2px 16px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.6);
    --transition: 0.32s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html,
body {
    height: 100%;
    overflow: hidden;
    font-family:
        "Plus Jakarta Sans",
        -apple-system,
        BlinkMacSystemFont,
        sans-serif;
    background: var(--bg);
    color: var(--text);
    -webkit-font-smoothing: antialiased;
}

body.fs-body {
    overflow: hidden;
}

/* ─── Header ───────────────────────────────────────────────────────────── */
#fs-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    height: calc(52px + env(safe-area-inset-top, 0px));
    padding-top: env(safe-area-inset-top, 0px);
    background: rgba(13, 13, 13, 0.9);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
}

.fs-header__logo {
    height: 28px;
    width: auto;
    object-fit: contain;
}

/* ─── App container ───────────────────────────────────────────────────── */
#fs-app {
    position: fixed;
    top: calc(52px + env(safe-area-inset-top, 0px));
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg);
}

/* ─── Sections ────────────────────────────────────────────────────────── */
.fs-section {
    position: absolute;
    inset: 0;
    opacity: 0;
    transform: translateX(20px);
    transition:
        opacity var(--transition),
        transform var(--transition);
    pointer-events: none;
    overflow: clip;
}

.fs-section--active {
    opacity: 1;
    transform: translateX(0);
    pointer-events: auto;
}

/* ─── Page layout ─────────────────────────────────────────────────────── */
.fs-page {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 24px 20px 0;
    max-width: 480px;
    margin: 0 auto;
}

.fs-page--scrollable {
    overflow-y: auto;
    padding-bottom: 32px;
}

.fs-page--detail {
    padding-bottom: 0;
}

.fs-page--centered {
    justify-content: center;
    align-items: center;
    text-align: center;
}

.fs-page__header {
    padding-top: env(safe-area-inset-top, 0px);
    margin-bottom: 24px;
}

.fs-page__header--row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.fs-page__title {
    font-size: 26px;
    font-weight: 800;
    color: var(--text);
    line-height: 1.15;
    letter-spacing: -0.02em;
}

.fs-page__subtitle {
    font-size: 14px;
    color: var(--text-muted);
    margin-top: 5px;
}

.fs-page__groupe-label {
    font-size: 13px;
    color: var(--orange);
    font-weight: 600;
    margin-top: 2px;
}

.fs-page__actions {
    padding: 16px 0 env(safe-area-inset-bottom, 24px);
    margin-top: auto;
    background: var(--bg);
    border-top: 1px solid var(--border);
}

/* ─── Buttons ─────────────────────────────────────────────────────────── */
.fs-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 16px 28px;
    border-radius: var(--radius-md);
    border: none;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition:
        opacity var(--transition),
        transform 0.1s ease,
        box-shadow var(--transition);
    text-decoration: none;
    line-height: 1;
    -webkit-tap-highlight-color: transparent;
    letter-spacing: -0.01em;
}

.fs-btn:active {
    transform: scale(0.97);
}

.fs-btn--primary {
    background: linear-gradient(135deg, var(--orange) 0%, var(--orange-dark) 100%);
    color: #fff;
    box-shadow: 0 4px 20px rgba(237, 104, 57, 0.35);
}

.fs-btn--primary:hover {
    opacity: 0.92;
}

.fs-btn--primary:disabled {
    background: var(--surface-2);
    color: var(--text-dim);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.fs-btn--full {
    width: 100%;
}

.fs-btn--lg {
    padding: 20px 36px;
    font-size: 18px;
    border-radius: var(--radius-lg);
}

.fs-btn-back {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: none;
    border: none;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0;
    margin-bottom: 20px;
    -webkit-tap-highlight-color: transparent;
}

.fs-btn-back:active {
    opacity: 0.5;
}

.fs-btn-icon {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--orange-light);
    color: var(--orange);
    border: 1px solid rgba(237, 104, 57, 0.25);
    border-radius: var(--radius-sm);
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    flex-shrink: 0;
}

/* ─── S0 — Intro ──────────────────────────────────────────────────────── */
.fs-intro {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: 48px 32px env(safe-area-inset-bottom, 48px);
    text-align: center;
    background: radial-gradient(ellipse at 50% 25%, rgba(237, 104, 57, 0.14) 0%, transparent 65%), var(--bg);
}

.fs-intro__logo {
    margin-bottom: 40px;
    position: relative;
}

.fs-intro__logo::before {
    content: "";
    position: absolute;
    inset: -24px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(237, 104, 57, 0.18) 0%, transparent 70%);
    pointer-events: none;
}

.fs-intro__logo-img {
    width: 110px;
    height: 110px;
    object-fit: contain;
    border-radius: var(--radius-md);
    position: relative;
    box-shadow: 0 8px 32px rgba(237, 104, 57, 0.25);
}

.fs-intro__logo-placeholder {
    font-size: 80px;
    line-height: 1;
    position: relative;
}

.fs-intro__title {
    font-size: 44px;
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 16px;
    color: var(--text);
    letter-spacing: -0.03em;
}

.fs-intro__title span {
    color: var(--orange);
}

.fs-intro__subtitle {
    font-size: 16px;
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 56px;
    max-width: 280px;
}

/* ─── S1 — Groupes ────────────────────────────────────────────────────── */
.fs-groupes {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    overflow-y: auto;
    padding-bottom: 24px;
}

.fs-groupe-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 22px 14px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    box-shadow: var(--shadow);
    transition:
        box-shadow var(--transition),
        transform 0.1s ease,
        border-color var(--transition);
    -webkit-tap-highlight-color: transparent;
}

.fs-groupe-card:active {
    transform: scale(0.96);
    box-shadow: none;
    border-color: var(--orange);
}

.fs-groupe-card__number {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: var(--orange-light);
    color: var(--orange);
    font-size: 18px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(237, 104, 57, 0.3);
}

.fs-groupe-card__name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    text-align: center;
    line-height: 1.3;
}

/* ─── S2 — Liste restaurants ──────────────────────────────────────────── */
.fs-restaurants {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    grid-auto-rows: 200px;
    overflow-y: auto;
    padding-bottom: 24px;
    align-content: start;
    /* height: 200svh; */
    overflow: scroll;
}

.fs-restaurant-card {
    border-radius: var(--radius-md);
    overflow: hidden;
    position: relative;
    cursor: pointer;
    aspect-ratio: 3/4;
    background: var(--surface-2);
    box-shadow: var(--shadow);
    transition:
        transform 0.15s ease,
        box-shadow var(--transition);
    -webkit-tap-highlight-color: transparent;
    height: 100%;
    width: 100%;
}

.fs-restaurant-card:active {
    transform: scale(0.96);
    box-shadow:
        0 0 0 2px var(--orange),
        var(--shadow);
}

.fs-restaurant-card--visited {
    cursor: default;
    pointer-events: none;
}

.fs-restaurant-card__logo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.fs-restaurant-card__overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.88) 0%, rgba(0, 0, 0, 0.3) 50%, transparent 100%);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 12px;
}

.fs-restaurant-card--visited .fs-restaurant-card__overlay {
    background: linear-gradient(to top, rgba(0, 0, 0, 0.88) 0%, rgba(0, 0, 0, 0.55) 100%);
}

.fs-restaurant-card__name {
    font-size: 13px;
    font-weight: 700;
    color: #fff;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.fs-restaurant-card__addr {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.6);
    margin-top: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.fs-badge-visited {
    position: absolute;
    top: 8px;
    right: 8px;
    background: var(--success);
    color: #0d0d0d;
    font-size: 9px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 99px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ─── S3 — Aperçu ─────────────────────────────────────────────────────── */
.fs-apercu {
    flex: 1;
    overflow-y: auto;
}

.fs-apercu__cover {
    width: 100%;
    height: 220px;
    object-fit: cover;
    border-radius: var(--radius-md);
    margin-bottom: 20px;
}

.fs-apercu__logo-row {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 16px;
}

.fs-apercu__logo {
    width: 60px;
    height: 60px;
    border-radius: var(--radius-sm);
    object-fit: cover;
    flex-shrink: 0;
    background: var(--surface-2);
    border: 1px solid var(--border);
}

.fs-apercu__name {
    font-size: 22px;
    font-weight: 800;
    flex: 1;
    color: var(--text);
    letter-spacing: -0.02em;
}

.fs-apercu__description {
    font-size: 15px;
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 12px;
}

.fs-apercu__adresse {
    font-size: 13px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 4px;
}

/* ─── S4 — Détail ─────────────────────────────────────────────────────── */
.fs-detail {
    margin-bottom: 28px;
}

.fs-detail__plat {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: var(--radius-md);
    margin-bottom: 20px;
}

.fs-detail__header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 16px;
}

.fs-detail__logo {
    width: 52px;
    height: 52px;
    border-radius: var(--radius-sm);
    object-fit: cover;
    background: var(--surface-2);
    border: 1px solid var(--border);
}

.fs-detail__header h2 {
    font-size: 20px;
    font-weight: 800;
    flex: 1;
    color: var(--text);
    letter-spacing: -0.02em;
}

.fs-detail__description {
    font-size: 14px;
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 12px;
}

.fs-detail__adresse {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.fs-btn--maps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: rgba(66, 133, 244, 0.12);
    color: #6aa3f8;
    border: 1px solid rgba(66, 133, 244, 0.25);
    padding: 12px 20px;
    border-radius: var(--radius-md);
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    width: 100%;
    cursor: pointer;
}

.fs-btn--maps:active {
    opacity: 0.75;
}

/* Upload */
.fs-upload {
    margin: 28px 0 16px;
}

.fs-upload__title {
    font-size: 17px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 4px;
}

.fs-upload__hint {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 14px;
}

.fs-upload__input {
    display: none;
}

.fs-upload__label {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 32px 20px;
    border: 1.5px dashed rgba(237, 104, 57, 0.4);
    border-radius: var(--radius-md);
    cursor: pointer;
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 600;
    background: var(--orange-light);
    transition:
        border-color var(--transition),
        color var(--transition);
}

.fs-upload__label:hover,
.fs-upload__label.is-dragover {
    border-color: var(--orange);
    color: var(--orange);
}

.fs-photos-preview {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-top: 14px;
}

.fs-photo-preview {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: var(--radius-sm);
}

.fs-upload-progress {
    font-size: 13px;
    color: var(--orange);
    font-weight: 600;
    text-align: center;
    margin-top: 10px;
}

/* ─── S5 — Avis ───────────────────────────────────────────────────────── */
.fs-avis-restaurant-name {
    font-size: 14px;
    color: var(--orange);
    font-weight: 600;
    margin-top: 4px;
}

.fs-categories {
    display: flex;
    flex-direction: column;
    margin-bottom: 28px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.fs-categorie {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
}

.fs-categorie:last-child {
    border-bottom: none;
}

.fs-categorie__label {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    text-transform: uppercase;
    min-width: 90px;
}

.fs-stars {
    display: flex;
    gap: 2px;
}

.fs-star {
    font-size: 30px;
    color: var(--surface-2);
    background: none;
    border: none;
    cursor: pointer;
    padding: 0 2px;
    line-height: 1;
    transition:
        color 0.15s,
        transform 0.1s;
    -webkit-tap-highlight-color: transparent;
}

.fs-star.is-active {
    color: var(--orange);
}
.fs-star:active {
    transform: scale(1.3);
}

.fs-interview {
    margin-bottom: 24px;
}

.fs-interview__label {
    font-size: 16px;
    font-weight: 700;
    color: var(--text);
    display: block;
    margin-bottom: 4px;
}

.fs-interview__hint {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 10px;
}

.fs-interview__textarea {
    width: 100%;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    padding: 16px;
    font-size: 15px;
    font-family: inherit;
    line-height: 1.6;
    color: var(--text);
    background: var(--surface);
    resize: none;
    transition:
        border-color var(--transition),
        box-shadow var(--transition);
}

.fs-interview__textarea:focus {
    outline: none;
    border-color: var(--orange);
    box-shadow: 0 0 0 3px rgba(237, 104, 57, 0.12);
}

.fs-form-error {
    font-size: 13px;
    color: var(--error);
    text-align: center;
    margin-top: 8px;
}

/* ─── S6 — Validation ─────────────────────────────────────────────────── */
.fs-success {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    padding: 32px;
}

.fs-success__circle {
    width: 100px;
    height: 100px;
    margin-bottom: 12px;
}

.fs-success__checkmark {
    width: 100px;
    height: 100px;
}

.fs-success__checkmark-circle {
    stroke: var(--orange);
    stroke-dasharray: 166;
    stroke-dashoffset: 166;
    stroke-width: 2;
    stroke-miterlimit: 10;
    animation: stroke 0.6s cubic-bezier(0.65, 0, 0.45, 1) forwards;
}

.fs-success__checkmark-check {
    stroke: var(--orange);
    stroke-dasharray: 48;
    stroke-dashoffset: 48;
    stroke-width: 2.5;
    stroke-linecap: round;
    stroke-linejoin: round;
    animation: stroke 0.3s cubic-bezier(0.65, 0, 0.45, 1) 0.6s forwards;
}

@keyframes stroke {
    100% {
        stroke-dashoffset: 0;
    }
}

.fs-success__title {
    font-size: 30px;
    font-weight: 800;
    color: var(--text);
    letter-spacing: -0.02em;
}

.fs-success__subtitle {
    font-size: 16px;
    color: var(--text-muted);
    margin-bottom: 8px;
}

/* ─── S7 — Galerie ────────────────────────────────────────────────────── */
.fs-galerie-content {
    padding-bottom: 32px;
}

.fs-galerie-restaurant {
    margin-bottom: 32px;
}

.fs-galerie-restaurant h3 {
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1.5px solid var(--orange);
    display: inline-block;
    letter-spacing: 0.01em;
}

.fs-galerie-photos {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
}

.fs-galerie-photos img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: opacity 0.15s;
}

.fs-galerie-photos img:active {
    opacity: 0.7;
}

.fs-empty {
    text-align: center;
    color: var(--text-muted);
    font-size: 15px;
    padding: 48px 24px;
}

/* ─── Contact CTA ─────────────────────────────────────────────────────── */
.fs-contact-cta {
    font-size: 12px;
    color: var(--text-muted);
    text-align: center;
    padding: 16px 0 env(safe-area-inset-bottom, 20px);
    flex-shrink: 0;
}

.fs-contact-cta a {
    color: var(--orange);
    font-weight: 600;
    text-decoration: none;
}

/* ─── Utilitaires ─────────────────────────────────────────────────────── */
.fs-loading {
    text-align: center;
    color: var(--text-muted);
    padding: 48px 24px;
    font-size: 15px;
}
