/* === On est bien - CSS === */

:root {
    --corail: #E8836B;
    --corail-dark: #D4654D;
    --peche: #F5C5A3;
    --creme: #FFF8F0;
    --bordeaux: #8B2252;
    --bordeaux-light: #A83262;
    --text: #3D2B1F;
    --text-light: #7A6B63;
    --white: #FFFFFF;
    --gray-light: #F0EBE5;
    --gray: #D5CEC7;
    --success: #5CB85C;
    --danger: #D9534F;
    --shadow: 0 2px 12px rgba(61, 43, 31, 0.1);
    --shadow-lg: 0 8px 30px rgba(61, 43, 31, 0.15);
    --radius: 16px;
    --radius-sm: 10px;
    --max-width: 480px;
}

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

body {
    font-family: 'Nunito', sans-serif;
    background: var(--creme);
    color: var(--text);
    min-height: 100dvh;
    -webkit-font-smoothing: antialiased;
}

/* === Layout === */

.page {
    display: none;
    min-height: 100dvh;
    padding-bottom: 2rem;
}
.page.active {
    display: flex;
    flex-direction: column;
}

.container {
    width: 100%;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 1rem;
}

/* === Header === */

.app-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    max-width: var(--max-width);
    margin: 0 auto;
    width: 100%;
}

.app-header h2 {
    font-size: 1.1rem;
    font-weight: 700;
}

.header-left {
    font-size: 1.1rem;
    font-weight: 600;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
}

.btn-back {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text);
    padding: 0.25rem;
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-icon {
    background: none;
    border: none;
    font-size: 1.3rem;
    cursor: pointer;
    color: var(--text-light);
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* === Login === */

.login-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100dvh;
    padding: 2rem;
    text-align: center;
}

.logo-area {
    margin-bottom: 3rem;
}

.logo-heart {
    font-size: 4rem;
    color: var(--corail);
    margin-bottom: 0.5rem;
}

.logo-area h1 {
    font-size: 2rem;
    color: var(--bordeaux);
    font-weight: 700;
}

.tagline {
    color: var(--text-light);
    font-size: 1rem;
    margin-top: 0.5rem;
}

/* === Buttons === */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.1s, opacity 0.2s;
    min-height: 44px;
}
.btn:active {
    transform: scale(0.97);
}

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

.btn-secondary {
    background: var(--gray-light);
    color: var(--text);
}

.btn-success {
    background: var(--success);
    color: var(--white);
}

.btn-danger {
    background: var(--danger);
    color: var(--white);
}

.btn-large {
    padding: 1rem 2rem;
    font-size: 1.1rem;
    width: 100%;
}

.btn-google {
    background: var(--white);
    color: var(--text);
    border: 2px solid var(--gray);
    padding: 0.9rem 1.5rem;
    font-size: 1rem;
    box-shadow: var(--shadow);
}
.btn-google:hover {
    border-color: var(--corail);
}

.btn-install {
    background: var(--bordeaux);
    color: var(--white);
    padding: 0.9rem 1.5rem;
    font-size: 1rem;
    width: 100%;
    margin-bottom: 1rem;
    box-shadow: var(--shadow);
}

.btn-whatsapp {
    background: #25D366;
    color: var(--white);
    padding: 0.75rem 1.5rem;
    width: 100%;
    margin-top: 1rem;
}

/* === Setup === */

.setup-choices {
    margin-top: 2rem;
}

.separator {
    text-align: center;
    color: var(--text-light);
    margin: 1.5rem 0;
    font-size: 0.9rem;
}

.join-form {
    display: flex;
    gap: 0.5rem;
}

.input-code {
    flex: 1;
    padding: 0.75rem;
    font-size: 1.2rem;
    font-family: inherit;
    font-weight: 700;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    border: 2px solid var(--gray);
    border-radius: var(--radius-sm);
    outline: none;
}
.input-code:focus {
    border-color: var(--corail);
}

.hidden {
    display: none !important;
}

.card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
}

.card-highlight {
    text-align: center;
    margin-top: 2rem;
}

.big-code {
    font-size: 2.5rem;
    font-weight: 700;
    letter-spacing: 0.3em;
    color: var(--bordeaux);
    margin: 1rem 0;
}

.hint {
    color: var(--text-light);
    font-size: 0.85rem;
}

/* === Home grid === */

.home-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    margin-top: 1rem;
}

.home-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}
.home-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}
.home-card:active {
    transform: scale(0.98);
}

.home-card-icon {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.home-card h3 {
    font-size: 1.1rem;
    margin-bottom: 0.25rem;
}

.home-card p {
    color: var(--text-light);
    font-size: 0.85rem;
}

/* === Cards / Conversation === */

.niveau-selector {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
    margin-top: 1rem;
}

.chip {
    padding: 0.5rem 1rem;
    border: 2px solid var(--gray);
    border-radius: 50px;
    background: var(--white);
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    min-height: 44px;
}
.chip.active {
    background: var(--corail);
    border-color: var(--corail);
    color: var(--white);
}

.card-area {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 280px;
}

.conversation-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 2rem 1.5rem;
    box-shadow: var(--shadow-lg);
    width: 100%;
    text-align: center;
    position: relative;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.card-niveau {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 1rem;
    background: var(--peche);
    color: var(--bordeaux);
}

.card-question {
    font-size: 1.2rem;
    line-height: 1.6;
    font-weight: 600;
}

.card-source {
    color: var(--text-light);
    font-size: 0.75rem;
    margin-top: 1rem;
    font-style: italic;
}

.card-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    margin-top: 1.5rem;
}

/* === Challenge === */

.challenge-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 2rem 1.5rem;
    box-shadow: var(--shadow-lg);
    text-align: center;
    margin-top: 2rem;
}

.challenge-assigned {
    font-size: 0.9rem;
    color: var(--corail);
    font-weight: 700;
    margin-bottom: 1rem;
}

.challenge-text {
    font-size: 1.2rem;
    line-height: 1.6;
    font-weight: 600;
    margin-bottom: 1.5rem;
}

.challenge-done {
    opacity: 0.6;
}
.challenge-done .btn-success {
    background: var(--gray);
    pointer-events: none;
}

/* === Parcours === */

.parcours-list {
    display: grid;
    gap: 1rem;
    margin-top: 1rem;
}

.parcours-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    cursor: pointer;
    transition: transform 0.15s;
}
.parcours-card:hover {
    transform: translateY(-2px);
}
.parcours-card:active {
    transform: scale(0.98);
}

.parcours-card h3 {
    color: var(--bordeaux);
    margin-bottom: 0.25rem;
}

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

.parcours-card .duree {
    font-size: 0.8rem;
    color: var(--corail);
    font-weight: 700;
    margin-top: 0.5rem;
}

/* === Settings === */

.settings-section {
    background: var(--white);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-top: 1rem;
    box-shadow: var(--shadow);
}

.settings-section h3 {
    color: var(--bordeaux);
    margin-bottom: 0.75rem;
    font-size: 1rem;
}

.ritual-form {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.input {
    padding: 0.75rem;
    border: 2px solid var(--gray);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 1rem;
    outline: none;
    min-height: 44px;
}
.input:focus {
    border-color: var(--corail);
}

/* === Toast notification === */

.toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    background: var(--text);
    color: var(--white);
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 600;
    z-index: 1000;
    animation: toastIn 0.3s ease, toastOut 0.3s ease 2.7s;
    max-width: calc(100vw - 2rem);
    text-align: center;
}

@keyframes toastIn {
    from { opacity: 0; transform: translateX(-50%) translateY(20px); }
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
}
@keyframes toastOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

/* === Douceur === */

.douceur-card {
    border: 2px solid var(--peche);
    background: linear-gradient(135deg, var(--white) 0%, #FFF0E6 100%);
    position: relative;
}

.douceur-step-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 2rem 1.5rem;
    box-shadow: var(--shadow-lg);
    margin-top: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.douceur-question {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--bordeaux);
    line-height: 1.5;
}

.douceur-input {
    width: 100%;
}

.douceur-textarea {
    width: 100%;
    resize: vertical;
    min-height: 100px;
    font-family: inherit;
}

.quiz-choices {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.quiz-choice {
    padding: 1rem;
    border: 2px solid var(--gray);
    border-radius: var(--radius-sm);
    background: var(--white);
    font-family: inherit;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
    min-height: 44px;
}
.quiz-choice:hover {
    border-color: var(--corail);
    background: #FFF5F0;
}
.quiz-choice:active {
    transform: scale(0.98);
}
.quiz-choice.correct {
    border-color: var(--success);
    background: #E8F5E9;
}
.quiz-choice.wrong {
    border-color: var(--danger);
    background: #FFEBEE;
}

.douceur-quiz-intro {
    color: var(--text-light);
    font-size: 0.9rem;
}

.douceur-result-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 2.5rem 1.5rem;
    box-shadow: var(--shadow-lg);
    margin-top: 2rem;
    text-align: center;
}

.result-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.result-message {
    font-size: 1.2rem;
    line-height: 1.6;
    font-weight: 600;
    white-space: pre-wrap;
}

/* === Badge notification === */

.badge {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    background: var(--danger);
    color: var(--white);
    font-size: 0.75rem;
    font-weight: 700;
    min-width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 0.25rem;
}

/* === Mur de douceurs === */

.wall-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 1rem;
    padding-bottom: 2rem;
}

.wall-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    border-left: 4px solid var(--corail);
}

.wall-card .wall-message {
    font-size: 1.1rem;
    line-height: 1.5;
    font-weight: 600;
    margin-bottom: 0.75rem;
    white-space: pre-wrap;
}

.wall-card .wall-meta {
    font-size: 0.8rem;
    color: var(--text-light);
}

.wall-empty {
    text-align: center;
    color: var(--text-light);
    margin-top: 3rem;
    font-size: 1rem;
}

/* === Responsive tablette + desktop === */

@media (min-width: 768px) {
    .home-grid {
        grid-template-columns: 1fr 1fr;
    }

    .home-card:last-child {
        grid-column: 1 / -1;
    }

    .login-container {
        max-width: var(--max-width);
        margin: 0 auto;
    }

    .card-area {
        min-height: 350px;
    }

    .conversation-card {
        padding: 3rem 2rem;
    }

    .card-question {
        font-size: 1.4rem;
    }
}

@media (min-width: 1024px) {
    body {
        display: flex;
        justify-content: center;
    }

    #app {
        width: 100%;
        max-width: var(--max-width);
        min-height: 100dvh;
        box-shadow: var(--shadow-lg);
        position: relative;
    }
}
