* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;

    background: #f3f4f6;

    font-family: Arial, sans-serif;

    display: flex;
    justify-content: center;

    padding: 40px;
}

.container {
    width: 900px;
    max-width: 100%;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 25px;
}

.topbar h1 {
    margin: 0;
}

.language-picker {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

.prompt-fields {
    margin-bottom: 18px;
}

.prompt-fields label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 14px;
}

.prompt-fields input,
.prompt-fields textarea {
    width: 100%;
    min-width: 0;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 8px;
    font: inherit;
}

.prompt-fields textarea {
    resize: vertical;
    height: 42px;
    min-height: 42px;
}

.prompt-card {
    margin-bottom: 20px;
    padding: 18px 22px;
    background: #fff;
    border: 1px solid #ddd;
    border-left: 4px solid #6b7280;
    border-radius: 10px;
}

.prompt-card p {
    margin: 0;
    white-space: pre-wrap;
}

h1 {
    margin-bottom: 25px;
}

textarea {
    width: 100%;
    min-height: 180px;

    padding: 15px;

    font-size: 18px;

    border: 1px solid #ccc;
    border-radius: 10px;

    resize: vertical;
}

.settings {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;

    margin: 20px 0;
}

.split-settings,
.part-navigation,
.cut-controls {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.split-settings {
    margin: 16px 0;
}

.split-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.split-settings #partCountField:not(.hidden) {
    display: flex;
    align-items: center;
    gap: 8px;
}

#partCount {
    width: 90px;
}

.split-settings #partCountField.hidden {
    display: none;
}

.split-preview {
    margin: 20px 0;
    padding: 18px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 12px;
}

.split-preview h2 {
    margin-top: 0;
}

.preview-part {
    margin: 12px 0;
}

.split-preview pre {
    margin: 8px 0;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    font: inherit;
}

.cut-controls {
    margin: 14px 0 14px 28px;
}

.split-error {
    color: #a12424;
    font-weight: bold;
}

.part-navigation {
    justify-content: space-between;
    margin: 0 0 16px;
}

.settings label {
    display: flex;
    flex-direction: column;
    gap: 6px;

    font-size: 14px;
}

input,
select {
    padding: 8px;

    font-size: 16px;
}

@media (max-width: 560px) {
    body {
        padding: 20px;
    }

    .topbar {
        align-items: flex-start;
        flex-direction: column;
        gap: 12px;
    }

}

button {
    padding: 10px 18px;

    border: none;
    border-radius: 8px;

    background: #111827;
    color: white;

    font-size: 16px;

    cursor: pointer;
}

button:hover {
    opacity: 0.85;
}

.hidden {
    display: none;
}

.info {
    display: flex;
    justify-content: space-between;

    margin-bottom: 20px;

    color: #666;
}

/*
    C'EST ICI QUE SE PASSE L'EFFET IMPORTANT.

    Le texte entier est toujours présent.
    Les caractères correctement tapés passent simplement
    du gris au noir.

    Le texte ne bouge donc jamais.
*/

#display {
    white-space: pre-wrap;

    height: min(60vh, 650px);
    min-height: min(250px, 45vh);
    max-height: 650px;
    overflow-y: auto;
    overflow-wrap: anywhere;

    padding: 25px;

    background: white;

    border-radius: 12px;

    font-family: monospace;
    font-size: 25px;
    line-height: 1.7;

    color: #c5c5c5;

    border: 1px solid #ddd;
}

#display .correct {
    color: #111;
}

#display .masked {
    visibility: hidden;
}

#display .typing-caret {
    display: inline-block;
    width: 1px;
    height: 1em;
    margin-left: -1px;
    vertical-align: -0.18em;
    background: #4b5563;
    animation: caret-blink 1.1s steps(2, start) infinite;
}

@keyframes caret-blink {
    to { visibility: hidden; }
}

/*
    La zone de saisie réelle est invisible.
    On récupère les frappes du clavier mais on affiche
    le résultat directement dans #display.
*/

#typing {
    position: fixed;

    width: 1px;
    height: 1px;

    opacity: 0;

    left: -100px;
}

.progress {
    height: 8px;

    margin-top: 20px;

    background: #ddd;

    border-radius: 10px;

    overflow: hidden;
}

#progressBar {
    width: 0;
    height: 100%;

    background: #111;
}

#message {
    min-height: 25px;

    font-weight: bold;
}

.section-heading {
    margin: 0 0 14px;
    font-size: 1.2rem;
}

.seo-section {
    margin-top: 28px;
    color: #4b5563;
    font-size: 0.95rem;
    line-height: 1.65;
}

.seo-section summary {
    cursor: pointer;
    color: #374151;
}

.seo-heading {
    margin: 14px 0 6px;
    font-size: 1.05rem;
}

.seo-section p {
    margin: 0;
}
