/* ============================================
   EasyArr — styles communs (repris du site Ensemble!)
   ============================================ */

:root {
    --color-primary: #0a6cff;
    --color-primary-dark: #0052cc;
    --color-bg: #fafafa;
    --color-surface: #ffffff;
    --color-text: #1e293b;
    --color-text-secondary: #64748b;
    --color-border: #e2e8f0;
    --color-accent-bg: #eaf2ff;
    --radius: 12px;
    --max-width: 860px;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: var(--color-text);
    background: var(--color-bg);
    line-height: 1.7;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ---- Navigation ---- */

header {
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
    position: sticky;
    top: 0;
    z-index: 100;
}

nav {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--color-primary);
    text-decoration: none;
    letter-spacing: -0.02em;
}

.nav-links {
    display: flex;
    gap: 1.5rem;
}

.nav-links a {
    color: var(--color-text-secondary);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    transition: color 0.2s;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--color-primary);
}

/* ---- Main ---- */

main {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 1.5rem;
    flex: 1;
    width: 100%;
}

/* ---- Hero ---- */

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

.logo img {
    width: 32px;
    height: 32px;
    border-radius: 22.5%;
}

.hero-icon {
    display: block;
    width: 128px;
    height: 128px;
    margin: 0 auto 1.2rem;
    border-radius: 22.5%;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
}

.hero h1 {
    font-size: 3.2rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: var(--color-primary);
    margin-bottom: 0.3rem;
}

.tagline {
    font-size: 1.3rem;
    color: var(--color-text-secondary);
    font-weight: 500;
    margin-bottom: 1rem;
}

.subtitle {
    font-size: 1.1rem;
    color: var(--color-text);
    max-width: 560px;
    margin: 0 auto 1.5rem;
}

.badges {
    display: flex;
    gap: 0.6rem;
    justify-content: center;
}

.badges {
    flex-wrap: wrap;
}

.badge {
    background: var(--color-accent-bg);
    color: var(--color-primary);
    font-size: 0.85rem;
    font-weight: 600;
    padding: 0.35rem 1rem;
    border-radius: 20px;
    cursor: pointer;
    border: 1px solid transparent;
}

.badge input {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
}

.badge:hover {
    border-color: var(--color-primary);
}

.badge:has(input:checked) {
    background: var(--color-primary);
    color: #fff;
}

.badge:has(input:focus-visible) {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

/* ---- Features grid ---- */

.features {
    padding: 2rem 0 3rem;
}

.features h2 {
    text-align: center;
    font-size: 1.6rem;
    font-weight: 700;
    margin-bottom: 2rem;
}

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

.feature-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 1.5rem;
    text-align: center;
    transition: box-shadow 0.2s, transform 0.2s;
}

.feature-card:hover {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
    transform: translateY(-2px);
}

.feature-icon {
    font-size: 2rem;
    margin-bottom: 0.6rem;
}

.feature-card h3 {
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 0.4rem;
}

.feature-card p {
    font-size: 0.9rem;
    color: var(--color-text-secondary);
}

/* ---- Highlights ---- */

.highlights {
    padding: 2rem 0 3rem;
}

.highlights h2 {
    font-size: 1.6rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    text-align: center;
}

.highlights-list {
    list-style: none;
    max-width: 640px;
    margin: 0 auto;
}

.highlights-list li {
    padding: 0.8rem 0;
    border-bottom: 1px solid var(--color-border);
    font-size: 1rem;
}

.highlights-list li:last-child {
    border-bottom: none;
}

.highlights-list a {
    color: var(--color-primary);
    text-decoration: none;
    font-weight: 500;
}

/* ---- Keywords ---- */

.keywords {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    justify-content: center;
    padding: 1.5rem 0 3rem;
}

.keywords span {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    color: var(--color-text-secondary);
    font-size: 0.85rem;
    font-weight: 500;
    padding: 0.3rem 0.9rem;
    border-radius: 20px;
}

/* ---- Page content (confidentialité, contact) ---- */

.page-content {
    padding: 3rem 0;
}

.page-content h1 {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
}

.updated {
    color: var(--color-text-secondary);
    font-size: 0.9rem;
    margin-bottom: 2rem;
}

.page-content h2 {
    font-size: 1.2rem;
    font-weight: 700;
    margin-top: 2rem;
    margin-bottom: 0.6rem;
    color: var(--color-text);
}

.page-content p {
    margin-bottom: 0.8rem;
}

.page-content ul {
    margin: 0.5rem 0 1rem 1.5rem;
}

.page-content ul li {
    margin-bottom: 0.4rem;
}

.page-content a {
    color: var(--color-primary);
    text-decoration: none;
    font-weight: 500;
}

.page-content a:hover {
    text-decoration: underline;
}

.highlight-box {
    background: var(--color-accent-bg);
    border-left: 4px solid var(--color-primary);
    border-radius: 0 var(--radius) var(--radius) 0;
    padding: 1.2rem 1.5rem;
    margin: 1rem 0 1.5rem;
}

.highlight-box p {
    margin-bottom: 0.4rem;
}

.highlight-box p:last-child {
    margin-bottom: 0;
}

/* ---- Contact form ---- */

.contact-page p {
    margin-bottom: 1.5rem;
}

.contact-form {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 2rem;
    margin-bottom: 2rem;
}

.form-group {
    margin-bottom: 1.2rem;
}

.form-group label {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 0.3rem;
    color: var(--color-text);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.7rem 0.9rem;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    color: var(--color-text);
    background: var(--color-bg);
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(10, 108, 255, 0.12);
}

.form-group textarea {
    resize: vertical;
}

.btn-submit {
    background: var(--color-primary);
    color: white;
    border: none;
    padding: 0.75rem 2rem;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-submit:hover {
    background: var(--color-primary-dark);
}

.contact-alt {
    text-align: center;
    padding: 1.5rem 0;
}

.contact-alt p {
    color: var(--color-text-secondary);
    margin-bottom: 0.5rem;
}

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

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

/* ---- Footer ---- */

footer {
    background: var(--color-surface);
    border-top: 1px solid var(--color-border);
    margin-top: auto;
}

.footer-content {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 1.5rem;
    text-align: center;
    font-size: 0.85rem;
    color: var(--color-text-secondary);
}

.footer-content a {
    color: var(--color-text-secondary);
    text-decoration: none;
}

.footer-content a:hover {
    color: var(--color-primary);
}

/* ---- Responsive ---- */

@media (max-width: 600px) {
    .hero h1 {
        font-size: 2.2rem;
    }

    .tagline {
        font-size: 1.1rem;
    }

    .features-grid {
        grid-template-columns: 1fr;
    }

    nav {
        flex-direction: column;
        gap: 0.8rem;
    }

    .contact-form {
        padding: 1.2rem;
    }
}

/* ---- Ajouts EasyArr : captures, langue, mode sombre ---- */

.lang {
    font-size: 0.85rem;
    border: 1px solid var(--color-border);
    border-radius: 20px;
    padding: 0.15rem 0.7rem;
}

.screens {
    display: flex;
    gap: 1.2rem;
    padding: 1rem 0 1.2rem;
    margin-bottom: 1.8rem;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}

.screens:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 4px;
}

.screens figure {
    flex: 0 0 min(800px, 88%);
    margin: 0;
    text-align: center;
    scroll-snap-align: center;
}

/* Centred when everything fits, scrollable from the first image when it does not. */
.screens figure:first-child {
    margin-left: auto;
}

.screens figure:last-child {
    margin-right: auto;
}

.screens img {
    width: 100%;
    height: auto;
    max-height: 600px;
    object-fit: contain;
    border-radius: 10px;
    border: 1px solid var(--color-border);
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.08);
    display: block;
}

.platform-iphone figure {
    flex-basis: 210px;
}

.platform-iphone img {
    border-radius: 22px;
}

.platform-ipad img {
    border-radius: 14px;
}

.screens figcaption {
    font-size: 0.85rem;
    color: var(--color-text-secondary);
    margin-top: 0.6rem;
}

/* One platform at a time, chosen with the badges of the hero. Without :has(), every platform stays visible. */
@supports selector(:has(*)) {
    .carousel {
        display: none;
    }

    main:has(#platform-mac:checked) .platform-mac,
    main:has(#platform-iphone:checked) .platform-iphone,
    main:has(#platform-ipad:checked) .platform-ipad,
    main:has(#platform-tv:checked) .platform-tv {
        display: block;
    }
}

.carousel {
    position: relative;
}

/* Arrows added by carousel.js; absent without script. */
.carousel-arrow {
    position: absolute;
    top: calc(50% - 2.6rem);
    width: 2.6rem;
    height: 2.6rem;
    border-radius: 50%;
    border: 1px solid var(--color-border);
    background: var(--color-surface, #fff);
    color: var(--color-primary);
    font-size: 1.7rem;
    line-height: 1;
    padding: 0 0 0.2rem;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
}

.carousel-previous {
    left: 0.5rem;
}

.carousel-next {
    right: 0.5rem;
}

.carousel-arrow:disabled {
    opacity: 0.35;
    cursor: default;
}

.carousel-arrow[hidden] {
    display: none;
}

.carousel-arrow:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

.note {
    max-width: 640px;
    margin: 0 auto 3rem;
    font-size: 0.9rem;
    color: var(--color-text-secondary);
    text-align: center;
}

@media (prefers-color-scheme: dark) {
    :root {
        --color-primary: #5aa2ff;
        --color-primary-dark: #8bbcff;
        --color-bg: #0f1218;
        --color-surface: #181c24;
        --color-text: #e8ecf3;
        --color-text-secondary: #9aa6b8;
        --color-border: #2a3140;
        --color-accent-bg: #16233a;
    }
    .btn-submit { color: #0f1218; }
}
