/* ============================================================
   Projet : تحدي الحروف (Tahadi Al Horouf)
   Fichier : assets/css/home.css
   Description : Style complet de la page d'accueil
   Compatible : LWS Linux PHP 8.2+ / PHP 9.0
   Direction : RTL
   ============================================================ */

/* ============================================================
   1. Page d'accueil
   ============================================================ */

.home-page {
    width: 100%;
    min-height: 100%;
    background: #f8fafc;
    direction: rtl;
    text-align: right;
    font-family:
        "Cairo",
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        Tahoma,
        Arial,
        sans-serif;
    overflow-x: hidden;
}

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

/* ============================================================
   2. Hero
   ============================================================ */

.home-page .hero {
    width: 100%;
    min-height: 460px;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 70px 20px;

    background:
        linear-gradient(
            135deg,
            #eff6ff 0%,
            #dbeafe 100%
        );

    border-bottom: 1px solid #e2e8f0;

    text-align: center;
}

.home-page .hero-content {
    width: 100%;
    max-width: 850px;
    margin: 0 auto;
}

.home-page .hero h1 {
    margin: 0 0 20px;

    color: #1e3a8a;

    font-size: 54px;
    font-weight: 800;

    line-height: 1.25;

    letter-spacing: -0.5px;
}

.home-page .hero p {
    max-width: 780px;
    margin: 0 auto;

    color: #475569;

    font-size: 22px;
    font-weight: 500;

    line-height: 1.8;
}

/* ============================================================
   3. Hero Actions
   ============================================================ */

.home-page .hero-actions {
    margin-top: 35px;

    display: flex;
    align-items: center;
    justify-content: center;

    gap: 20px;

    flex-wrap: wrap;
}

.home-page .hero-actions .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-height: 54px;

    padding: 15px 40px;

    border-radius: 100px;

    font-family: inherit;
    font-size: 18px;
    font-weight: 700;

    line-height: 1.4;
    text-align: center;

    text-decoration: none;

    cursor: pointer;

    transition:
        background-color 0.2s ease,
        color 0.2s ease,
        border-color 0.2s ease,
        transform 0.2s ease,
        box-shadow 0.2s ease;
}

/* Primary */

.home-page .hero-actions .btn-primary {
    background: #2563eb;
    color: #ffffff;

    border: 2px solid #2563eb;

    box-shadow:
        0 4px 14px rgba(37, 99, 235, 0.35);
}

.home-page .hero-actions .btn-primary:hover {
    background: #1d4ed8;
    border-color: #1d4ed8;

    transform: translateY(-2px);

    box-shadow:
        0 6px 20px rgba(37, 99, 235, 0.45);
}

/* Secondary */

.home-page .hero-actions .btn-secondary {
    background: #ffffff;
    color: #2563eb;

    border: 2px solid #e2e8f0;

    box-shadow:
        0 2px 6px rgba(0, 0, 0, 0.03);
}

.home-page .hero-actions .btn-secondary:hover {
    background: #f8fafc;

    border-color: #2563eb;

    transform: translateY(-2px);
}

/* ============================================================
   4. Features
   ============================================================ */

.home-page .features {
    width: 100%;

    padding: 80px 20px;

    background: #f8fafc;

    text-align: center;
}

.home-page .features h2,
.home-page .how-to-play h2 {
    margin: 0 0 40px;

    color: #1e3a8a;

    font-size: 32px;
    font-weight: 800;

    line-height: 1.4;

    text-align: center;
}

.home-page .feature-list {
    width: 100%;
    max-width: 1100px;

    margin: 0 auto;

    display: grid;

    grid-template-columns:
        repeat(
            auto-fit,
            minmax(240px, 1fr)
        );

    gap: 30px;
}

.home-page .feature-card {
    min-width: 0;

    padding: 35px 25px;

    background: #ffffff;

    border: 1px solid #eef2f7;

    border-radius: 20px;

    box-shadow:
        0 4px 6px -1px rgba(0, 0, 0, 0.05),
        0 10px 15px -3px rgba(0, 0, 0, 0.03);

    text-align: center;

    animation:
        homeFadeUp
        0.6s
        cubic-bezier(0.16, 1, 0.3, 1)
        both;

    transition:
        transform 0.3s ease,
        box-shadow 0.3s ease,
        border-color 0.3s ease;
}

.home-page .feature-card:nth-child(2) {
    animation-delay: 0.08s;
}

.home-page .feature-card:nth-child(3) {
    animation-delay: 0.16s;
}

.home-page .feature-card:nth-child(4) {
    animation-delay: 0.24s;
}

.home-page .feature-card:hover {
    transform: translateY(-5px);

    border-color: #dbeafe;

    box-shadow:
        0 20px 25px -5px rgba(0, 0, 0, 0.08);
}

.home-page .feature-icon {
    display: flex;
    align-items: center;
    justify-content: center;

    min-height: 55px;

    margin-bottom: 20px;

    font-size: 45px;
    line-height: 1;
}

.home-page .feature-card h3 {
    margin: 0 0 12px;

    color: #1e3a8a;

    font-size: 22px;
    font-weight: 700;

    line-height: 1.5;
}

.home-page .feature-card p {
    margin: 0;

    color: #64748b;

    font-size: 16px;
    font-weight: 500;

    line-height: 1.8;
}

@keyframes homeFadeUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================================
   5. How To Play
   ============================================================ */

.home-page .how-to-play {
    width: 100%;

    padding: 80px 20px;

    background: #ffffff;

    border-top: 1px solid #e2e8f0;
    border-bottom: 1px solid #e2e8f0;

    text-align: center;
}

.home-page .steps-list {
    width: 100%;
    max-width: 900px;

    margin: 0 auto;

    display: flex;

    flex-direction: column;

    gap: 25px;
}

.home-page .step-card {
    width: 100%;

    min-width: 0;

    display: flex;
    align-items: center;

    gap: 25px;

    padding: 20px 30px;

    background: #f8fafc;

    border-right: 5px solid #2563eb;

    border-radius: 15px;

    box-shadow:
        0 2px 4px rgba(0, 0, 0, 0.02);

    text-align: right;

    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease,
        background-color 0.2s ease;
}

.home-page .step-card:hover {
    transform: translateX(-3px);

    background: #f1f5f9;

    box-shadow:
        0 6px 12px rgba(0, 0, 0, 0.05);
}

.home-page .step-number {
    flex: 0 0 auto;

    width: 45px;
    height: 45px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 50%;

    background: #2563eb;
    color: #ffffff;

    font-size: 20px;
    font-weight: 700;

    line-height: 1;

    direction: ltr;
}

.home-page .step-card p {
    flex: 1;

    min-width: 0;

    margin: 0;

    color: #334155;

    font-size: 18px;
    font-weight: 600;

    line-height: 1.7;

    text-align: right;
}

/* ============================================================
   6. Call To Action
   ============================================================ */

.home-page .call-action {
    width: 100%;

    padding: 80px 20px;

    background: #f8fafc;

    text-align: center;
}

.home-page .cta-box {
    width: 100%;
    max-width: 900px;

    margin: 0 auto;

    padding: 50px 30px;

    background:
        linear-gradient(
            135deg,
            #1e3a8a 0%,
            #1d4ed8 100%
        );

    border-radius: 24px;

    box-shadow:
        0 10px 25px -5px rgba(37, 99, 235, 0.3);

    color: #ffffff;

    text-align: center;
}

.home-page .cta-box h2 {
    margin: 0 0 15px;

    color: #ffffff;

    font-size: 32px;
    font-weight: 800;

    line-height: 1.4;
}

.home-page .cta-box p {
    max-width: 700px;

    margin: 0 auto 30px;

    color: #bfdbfe;

    font-size: 19px;
    font-weight: 500;

    line-height: 1.7;
}

.home-page .cta-box .btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-height: 54px;

    padding: 15px 40px;

    border: 2px solid #ffffff;

    border-radius: 100px;

    background: #ffffff;

    color: #2563eb;

    font-family: inherit;

    font-size: 18px;
    font-weight: 700;

    line-height: 1.4;

    text-decoration: none;

    box-shadow:
        0 4px 14px rgba(0, 0, 0, 0.1);

    transition:
        background-color 0.2s ease,
        color 0.2s ease,
        transform 0.2s ease,
        box-shadow 0.2s ease;
}

.home-page .cta-box .btn-primary:hover {
    background: #f8fafc;

    color: #1d4ed8;

    transform:
        scale(1.04)
        translateY(-2px);

    box-shadow:
        0 8px 22px rgba(0, 0, 0, 0.18);
}

/* ============================================================
   7. Focus clavier
   ============================================================ */

.home-page a:focus-visible,
.home-page button:focus-visible {
    outline: 3px solid #2563eb;
    outline-offset: 4px;
}

.home-page .cta-box a:focus-visible {
    outline-color: #ffffff;
}

/* ============================================================
   8. Responsive tablette
   ============================================================ */

@media (max-width: 768px) {

    .home-page .hero {
        min-height: 0;
        padding: 60px 15px;
    }

    .home-page .hero h1 {
        font-size: 38px;
        line-height: 1.3;
    }

    .home-page .hero p {
        font-size: 18px;
        line-height: 1.8;
    }

    .home-page .hero-actions {
        width: 100%;
        max-width: 320px;

        margin: 30px auto 0;

        flex-direction: column;

        gap: 12px;
    }

    .home-page .hero-actions .btn {
        width: 100%;
    }

    .home-page .features,
    .home-page .how-to-play,
    .home-page .call-action {
        padding: 60px 15px;
    }

    .home-page .features h2,
    .home-page .how-to-play h2 {
        font-size: 27px;
        margin-bottom: 30px;
    }

    .home-page .feature-list {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .home-page .feature-card {
        padding: 30px 20px;
    }

    .home-page .step-card {
        padding: 16px 20px;
        gap: 15px;
    }

    .home-page .step-card p {
        font-size: 16px;
    }

    .home-page .cta-box {
        padding: 40px 20px;
        border-radius: 20px;
    }

    .home-page .cta-box h2 {
        font-size: 27px;
    }

    .home-page .cta-box p {
        font-size: 16px;
    }

    .home-page .cta-box .btn-primary {
        width: 100%;
    }
}

/* ============================================================
   9. Responsive petits écrans
   ============================================================ */

@media (max-width: 420px) {

    .home-page .hero {
        padding: 50px 12px;
    }

    .home-page .hero h1 {
        font-size: 31px;
    }

    .home-page .hero p {
        font-size: 16px;
    }

    .home-page .features,
    .home-page .how-to-play,
    .home-page .call-action {
        padding: 50px 12px;
    }

    .home-page .features h2,
    .home-page .how-to-play h2 {
        font-size: 24px;
    }

    .home-page .feature-card h3 {
        font-size: 20px;
    }

    .home-page .step-card {
        align-items: flex-start;
        padding: 15px;
    }

    .home-page .step-number {
        width: 40px;
        height: 40px;
        font-size: 18px;
    }

    .home-page .step-card p {
        font-size: 15px;
        line-height: 1.7;
    }

    .home-page .cta-box {
        padding: 35px 16px;
    }

    .home-page .cta-box h2 {
        font-size: 24px;
    }
}

/* ============================================================
   10. Reduced Motion
   ============================================================ */

@media (prefers-reduced-motion: reduce) {

    .home-page *,
    .home-page *::before,
    .home-page *::after {
        animation: none !important;
        transition: none !important;
        transform: none !important;
        scroll-behavior: auto !important;
    }
}.home-page .hero{position:relative;overflow:hidden;background:radial-gradient(circle at 20% 20%,rgba(37,99,235,.18),transparent 32%),radial-gradient(circle at 80% 30%,rgba(124,58,237,.16),transparent 34%),linear-gradient(135deg,#eff6ff,#f5f3ff)}
.home-page .hero::before,.home-page .hero::after{content:"";position:absolute;border-radius:50%;filter:blur(2px);opacity:.55;pointer-events:none}.home-page .hero::before{width:180px;height:180px;background:rgba(37,99,235,.12);top:-70px;right:8%;animation:v35Float 6s ease-in-out infinite}.home-page .hero::after{width:140px;height:140px;background:rgba(124,58,237,.12);bottom:-50px;left:10%;animation:v35Float 5s ease-in-out infinite reverse}.home-page .hero-content{position:relative;z-index:1}.home-page .feature-card:hover,.home-page .step-card:hover{transform:translateY(-6px);box-shadow:0 18px 38px rgba(15,23,42,.12)}
@media(max-width:700px){.home-page .hero{min-height:430px;padding:48px 14px}.home-page .hero h1{font-size:clamp(32px,9vw,48px)}.home-page .hero p{font-size:17px}.home-page .hero-actions{gap:10px}.home-page .hero-actions .btn{width:100%;padding:14px 20px}.home-page .feature-list{grid-template-columns:1fr!important}.home-page .steps-list{grid-template-columns:1fr!important}}
.hero-player-form{max-width:760px;margin:24px auto 0;padding:18px;border-radius:20px;background:rgba(255,255,255,.92);border:1px solid rgba(30,60,100,.12);box-shadow:0 14px 35px rgba(20,40,80,.10);text-align:right}.hero-player-form label{display:block;font-weight:800;margin-bottom:10px}.hero-player-row{display:flex;gap:10px;align-items:stretch}.hero-player-row input{flex:1;min-width:0;min-height:52px;border:1px solid #cfd8e3;border-radius:12px;padding:0 16px;font-size:1rem;background:#fff}.hero-player-row button{min-width:180px;border:0;cursor:pointer}.hero-player-form small{display:block;margin-top:9px;color:#64748b}.secondary-actions{justify-content:center;margin-top:14px}@media(max-width:640px){.hero-player-row{flex-direction:column}.hero-player-row button{width:100%;min-height:52px}.hero-player-form{padding:14px}.secondary-actions .btn{width:100%}}

/* V50 - identité persistante du joueur sur l'accueil */
.home-player-card{max-width:760px;margin:24px auto 0;padding:20px;display:flex;align-items:center;gap:16px;background:rgba(255,255,255,.96);border:1px solid rgba(37,99,235,.14);border-radius:22px;box-shadow:0 14px 36px rgba(20,40,80,.10);text-align:right}
.home-player-avatar{width:58px;height:58px;display:grid;place-items:center;flex:0 0 58px;border-radius:16px;background:#eef4ff;font-size:1.8rem}
.home-player-info{display:flex;flex-direction:column;gap:3px;min-width:0;flex:1}.home-player-label{font-size:.82rem;color:#64748b;font-weight:700}.home-player-info strong{font-size:1.25rem}.home-player-country{font-size:.92rem;color:#475569}
.home-player-actions{display:flex;gap:9px;align-items:center;flex-wrap:wrap}.home-player-actions .btn{min-height:48px;white-space:nowrap}.home-change-form{margin-top:12px}
@media(max-width:640px){.home-player-card{flex-direction:column;text-align:center}.home-player-info{align-items:center}.home-player-actions{width:100%;flex-direction:column}.home-player-actions .btn{width:100%}}

.home-change-details{display:block;position:relative}.home-change-details>summary{list-style:none;cursor:pointer;display:inline-flex;align-items:center;justify-content:center}.home-change-details>summary::-webkit-details-marker{display:none}.home-change-details[open]>summary{opacity:.9}.home-change-details .home-change-form{width:100%;box-sizing:border-box}.home-change-details .hero-player-row{display:flex;gap:10px;align-items:center}.home-change-details .hero-player-row input{flex:1;min-width:0}@media(max-width:640px){.home-change-details{width:100%}.home-change-details>summary{width:100%;box-sizing:border-box}.home-change-details .hero-player-row{flex-direction:column;align-items:stretch}.home-change-details .hero-player-row input,.home-change-details .hero-player-row .btn{width:100%;box-sizing:border-box}}
