/* ========== Reset simple & base ========== */
.swipe-page {
    background: radial-gradient(circle at top, #fff0e8 0%, #fff 60%);
    color: #222;
}

#swipe-backdrop {
    opacity: 0.30;
    filter: blur(16px) brightness(1.1);
}

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

body {
    margin: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: radial-gradient(circle at top, #ffe9e0 0, #f4f4f4 45%, #e5ecff 100%);
    color: #222;
}

img {
    max-width: 100%;
    display: block;
}



/* ========== Header / Nav ========== */

.app-header {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-inner {
    max-width: 960px;
    margin: 0 auto;
    padding: 10px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.logo {
    margin: 0;
    font-size: 1.2rem;
}

.main-nav {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.nav-user {
    font-size: 0.9rem;
    opacity: 0.85;
}

.nav-link {
    text-decoration: none;
    font-size: 0.9rem;
    padding: 6px 10px;
    border-radius: 999px;
    border: 1px solid transparent;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
    color: #333;
}

.nav-link:hover {
    background: rgba(0, 0, 0, 0.04);
}

.nav-link-primary {
    border-color: #ff6f61;
    color: #ff6f61;
}

.nav-link-primary:hover {
    background: #ff6f61;
    color: white;
}

.nav-form {
    margin: 0;
    display: inline-block;    /* ✅ le bouton se comporte comme un lien */
}

.nav-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    border: 1px solid rgba(0, 0, 0, 0.15);
    background: #ffffff;
    padding: 6px 12px;
    font-size: 0.85rem;
    color: #333;              /* ✅ texte bien visible */
    white-space: nowrap;      /* ✅ évite que ça casse bizarrement sur mobile */
    cursor: pointer;
}

/* ========== Layout pages ========== */

.page-main {
    padding: 16px;
}

.page-container {
    max-width: 420px;
    margin: 0 auto;
}

/* ========== Cartes & composants ========== */

.card {
    background: rgba(255, 255, 255, 0.96);
    border-radius: 18px;
    padding: 18px 18px 20px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
}

.auth-card {
    margin-top: 24px;
}

.card-title {
    margin: 0 0 4px;
    font-size: 1.3rem;
}

.card-subtitle {
    margin: 0 0 16px;
    font-size: 0.95rem;
    color: #666;
}

.card-footer-text {
    margin-top: 16px;
    font-size: 0.9rem;
    text-align: center;
}


/* ========== Formulaires ========== */

.form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.form-group label {
    font-size: 0.9rem;
    font-weight: 500;
}

.form-group input[type="text"],
.form-group input[type="password"],
.form-group input[type="file"] {
    border-radius: 10px;
    border: 1px solid rgba(0, 0, 0, 0.12);
    padding: 8px 10px;
    font-size: 0.95rem;
}

.form-group input:focus {
    outline: none;
    border-color: #ff6f61;
    box-shadow: 0 0 0 2px rgba(255, 111, 97, 0.2);
}

.form-hint {
    font-size: 0.8rem;
    color: #888;
}

.btn {
    border-radius: 999px;
    border: none;
    padding: 10px 14px;
    font-size: 0.95rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.btn-primary {
    background: linear-gradient(135deg, #ff6f61, #ffb347);
    color: white;
    box-shadow: 0 8px 18px rgba(255, 111, 97, 0.35);
}

.btn-primary:hover {
    filter: brightness(0.98);
}

.btn-full {
    width: 100%;
}

/* ========== Alertes / états ========== */

.alert {
    border-radius: 10px;
    padding: 8px 10px;
    font-size: 0.85rem;
    margin-bottom: 4px;
}

.alert-error {
    background: #ffe7e5;
    color: #b04135;
}

.alert-success {
    background: #e8f9f0;
    color: #1a7a46;
}

.empty-state {
    font-size: 1rem;
    color: #333;      /* ✔ plus foncé */
    margin-top: 10px;
    text-align: center;
    line-height: 1.4;
}

/* ========== Lien textuel ========== */

.link {
    color: #ff6f61;
    text-decoration: none;
    font-weight: 500;
}

.link:hover {
    text-decoration: underline;
}

/* ========== Top 3 grid ========== */

.top-grid {
    margin-top: 16px;
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
}

.top-card {
    background: #fafafa;
    border-radius: 14px;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.top-rank {
    font-size: 0.8rem;
    font-weight: 700;
    color: #ff6f61;
}

.top-image {
    border-radius: 12px;
}

.top-title {
    margin: 4px 0 0;
    font-size: 1rem;
}

.top-stats,
.top-ratio {
    margin: 0;
    font-size: 0.9rem;
    color: #555;
}

/* ========== SWIPE (Tinder-like) ========== */

#swipe-section {
    max-width: 420px;
    margin: 20px auto;
    text-align: center;
}

#card-container {
    position: relative;
    width: 100%;
    height: 460px;
    overflow: visible;
}

/* Backdrop flouté derrière la carte */

#swipe-backdrop {
    position: absolute;
    inset: 20px;
    border-radius: 22px;
    filter: blur(18px);
    opacity: 0.45;
    transform: scale(1.05);
    background-position: center;
    background-size: cover;
    background-repeat: no-repeat;
    transition: background-image 0.3s ease, opacity 0.3s ease;
    pointer-events: none;
    z-index: 0;
}


/* La carte type Tinder */

#card {
    position: absolute;
    inset: 0;
    margin: auto;
    width: 100%;
    max-width: 400px;
    height: 100%;
    background: white;
    border-radius: 18px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    padding: 10px;
    overflow: hidden;
    transition: transform 0.3s ease, opacity 0.3s ease;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    z-index: 2;
}

/* Stack visuel façon Tinder: cartes fantômes */

#card::before,
#card::after {
    content: '';
    position: absolute;
    inset: 10px;
    border-radius: 18px;
    background: rgba(0, 0, 0, 0.1);
    z-index: -1;
}

#card::before {
    transform: translateY(14px) scale(0.97);
    opacity: 0.5;
}

#card::after {
    transform: translateY(26px) scale(0.94);
    opacity: 0.35;
}


#card.dragging {
    transition: none; /* pas d’anim pendant le drag */
}

#card img {
    max-width: 100%;
    max-height: 80%;
    object-fit: cover;
    border-radius: 14px;
}

#card h3 {
    margin-top: 10px;
}

/* Badges LIKE / NOPE */

.badge {
    position: absolute;
    top: 18px;
    padding: 6px 12px;
    font-weight: bold;
    font-size: 18px;
    letter-spacing: 2px;
    border: 3px solid;
    border-radius: 8px;
    opacity: 0;
    transform: rotate(-20deg);
    pointer-events: none;
}

.badge-like {
    left: 20px;
    color: #27ae60;
    border-color: #27ae60;
}

.badge-nope {
    right: 20px;
    color: #e74c3c;
    border-color: #e74c3c;
    transform: rotate(20deg);
}

/* Boutons bas */

#buttons {
    margin-top: 20px;
    display: flex;
    justify-content: center;
    gap: 30px;
}

#buttons button {
    font-size: 24px;
    width: 70px;
    height: 70px;
    border-radius: 50%;
    border: none;
    box-shadow: 0 3px 10px rgba(0,0,0,0.4);
    cursor: pointer;
    background: white;
}

/* États cachés */

.hidden {
    display: none !important;
}

/* Loader (spinner) */

.loader {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 3px solid rgba(255, 255, 255, 0.2);
    border-top-color: #ff6f61;
    animation: spin 0.8s linear infinite;
    margin: 16px auto 0;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Overlay de match */

#match-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.75);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999;
}

.match-box {
    background: white;
    padding: 25px 35px;
    border-radius: 24px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    animation: match-pop 0.4s ease-out;
}

.match-box h2 {
    font-size: 28px;
    margin-bottom: 10px;
    background: linear-gradient(90deg, #ff6f61, #ffb347);
    -webkit-background-clip: text;
    color: transparent;
}

.match-box p {
    color: #555;
}

@keyframes match-pop {
    from {
        transform: scale(0.7);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* Bounce (retour) de la carte */

@keyframes card-bounce {
    0% { transform: translateX(0) rotate(0); }
    25% { transform: translateX(-12px) rotate(-2deg); }
    50% { transform: translateX(8px) rotate(1deg); }
    75% { transform: translateX(-4px) rotate(-1deg); }
    100% { transform: translateX(0) rotate(0); }
}

#card.bounce-back {
    animation: card-bounce 0.25s ease-out;
}

/* Toast de série de likes */

.streak-toast {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.85);
    color: #fff;
    padding: 8px 14px;
    border-radius: 999px;
    font-size: 0.85rem;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.4);
    z-index: 998;
    animation: toast-slide 0.3s ease-out;
}

@keyframes toast-slide {
    from {
        transform: translate(-50%, 20px);
        opacity: 0;
    }
    to {
        transform: translate(-50%, 0);
        opacity: 1;
    }
}

/* ========== Responsive (tablette / desktop) ========== */

@media (min-width: 700px) {
    .header-inner {
        padding-inline: 24px;
    }

    .page-container {
        max-width: 520px;
    }

    .top-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}



/* ========== LANDING PAGE (RateMyCat) ========== */

/* Fond général légèrement rosé / crème */
body.swipe-page {
    background: radial-gradient(
            circle at top left,
            #fff5ef 0%,
            #fff7f0 40%,
            #ffffff 100%
    );
    color: #222;
}

/* Conteneur principal de page (landing + autres) */
.page-container {
    max-width: 880px;
    margin: 0 auto;
    padding: 0 16px;
}

/* Layout de la landing */
.landing-main {
    padding-top: 40px;
}

/* ===== HERO ===== */

.landing-hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 32px;
    margin-bottom: 48px;
}

.landing-hero-text {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.landing-title {
    font-size: 2rem;
    line-height: 1.25;
    margin: 0 0 12px;
}

.landing-subtitle {
    margin: 0;
    font-size: 0.98rem;
    color: #555;
}

.landing-hero-actions {
    margin-top: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.landing-cta-main {
    font-size: 1rem;
}

.landing-secondary-link {
    font-size: 0.9rem;
    text-align: center;
    text-decoration: none;
    color: #ff6f61;
}

.landing-secondary-link:hover {
    text-decoration: underline;
}

.landing-meta {
    margin: 6px 0 0;
    font-size: 0.85rem;
    color: #777;
}

/* Carte d’aperçu à droite du hero */

.landing-hero-card {
    flex: 1;
    display: flex;
    justify-content: center;
}

.landing-preview-card {
    width: 85%;
    max-width: 280px;
    margin-top: 8px;
}

.preview-badge {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #999;
    margin-bottom: 6px;
}

.preview-card-inner {
    border-radius: 18px;
    padding: 14px;
    background: linear-gradient(135deg, #fff7ed, #ffe6ee);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.06);
    position: relative;
    overflow: hidden;
}

.preview-image-placeholder {
    height: 200px;
    border-radius: 14px;
    background: radial-gradient(
            circle at top,
            #ffffff 0,
            #f5f5f5 50%,
            #e5ecff 100%
    );
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.08);
}

.preview-like-nope {
    position: absolute;
    inset: 14px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    pointer-events: none;
}

.preview-pill {
    font-size: 0.8rem;
    padding: 4px 10px;
    border-radius: 999px;
    font-weight: 600;
    border: 2px solid;
    background: rgba(255, 255, 255, 0.9);
}

.preview-like {
    color: #27ae60;
    border-color: #27ae60;
}

.preview-nope {
    color: #e74c3c;
    border-color: #e74c3c;
}

.preview-caption {
    margin: 8px 0 0;
    font-size: 0.85rem;
    color: #666;
}

/* ===== SECTIONS GÉNÉRALES ===== */

.landing-section {
    margin: 40px 0;
}

.landing-section-title {
    margin: 0 0 12px;
    font-size: 1.3rem;
}

/* ===== Étapes “Comment ça marche ?” ===== */

.landing-steps {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.landing-step-card h3 {
    margin: 0 0 4px;
}

.landing-step-card p {
    margin: 0;
    font-size: 0.92rem;
    color: #555;
}

.step-number {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ff6f61, #ffb347);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 700;
    margin-bottom: 6px;
}

/* ===== Features ===== */

.landing-features {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.landing-feature-card h3 {
    margin: 0 0 4px;
}

.landing-feature-card p {
    margin: 0;
    font-size: 0.92rem;
    color: #555;
}

/* ===== Bloc Top 3 ===== */

.landing-top-card {
    text-align: center;
    padding: 28px;
}

.landing-top-card p {
    font-size: 0.95rem;
    color: #555;
}

.landing-top-btn {
    margin-top: 10px;
}

/* ===== Footer ===== */

.landing-footer {
    margin-top: 24px;
    text-align: center;
    font-size: 0.85rem;
    color: #777;
}

.landing-footer-meta {
    margin-top: 2px;
    font-size: 0.8rem;
}

/* ===== Responsive desktop ===== */

@media (min-width: 768px) {
    .landing-hero {
        flex-direction: row;
        text-align: left;
        gap: 60px;
        align-items: center;
    }

    .landing-hero-actions {
        align-items: flex-start;
    }

    .landing-steps,
    .landing-features {
        flex-direction: row;
    }

    .landing-step-card,
    .landing-feature-card {
        flex: 1;
    }
}