/* Variables de couleur globales */
:root {
    --primary-color: #16304d;
    --accent-color: #f28c18;
    --accent-hover: #df7d10;
    --bg-color: #edf3fa;
    --card-bg: #ffffff;
    --text-muted: #5a6e85;
    --border-color: #d4d9df;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--bg-color);
    color: var(--primary-color);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    overflow-x: hidden;
}

/* --- Corps de la page / Main --- */
main {
    flex: 1;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: clamp(24px, 5vw, 60px);
    padding: clamp(20px, 5vw, 40px) clamp(16px, 8vw, 8%);
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

/* Section Présentation / Hero */
.hero {
    flex: 1 1 420px;
    max-width: 550px;
    min-width: 0;
}

.hero h1 {
    font-size: clamp(30px, 3.6vw, 42px);
    font-weight: 700;
    line-height: 1.25;
    margin-bottom: 20px;
}

.hero .highlight {
    color: var(--accent-color);
}

.hero p {
    font-size: clamp(14px, 1.6vw, 16px);
    line-height: 1.7;
    color: var(--text-muted);
    margin-bottom: 35px;
}

.hero-visual {
    position: relative;
    width: 100%;
    max-width: 500px;
    margin-bottom: 30px;
}

.hero-image-main {
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(22, 48, 77, 0.1);
}

.hero-image-main img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.5s ease;
}

.hero-image-main:hover img {
    transform: scale(1.03);
}

.hero-image-accent {
    position: absolute;
    left: -30px;
    bottom: -30px;
    width: 42%;
    aspect-ratio: 1 / 1;
    border-radius: 16px;
    overflow: hidden;
    border: 5px solid var(--card-bg);
    box-shadow: 0 12px 24px rgba(22, 48, 77, 0.18);
    transform: rotate(-4deg);
    transition: transform 0.4s ease;
}

.hero-image-accent img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.hero-image-accent:hover {
    transform: rotate(0deg);
}

.code-float {
    position: absolute;
    top: -24px;
    right: -20px;
    width: 230px;
    background: var(--primary-color);
    border-radius: 14px;
    padding: 14px 16px;
    box-shadow: 0 14px 28px rgba(22, 48, 77, 0.25);
    transform: rotate(3deg);
    transition: transform 0.4s ease;
}

.code-float:hover {
    transform: rotate(0deg);
}

.code-float-dots {
    display: flex;
    gap: 6px;
    margin-bottom: 10px;
}

.code-float-dots span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.25);
    display: inline-block;
}

.code-float-dots span:first-child {
    background: var(--accent-color);
}

.code-float-body {
    font-family: 'Courier New', monospace;
    font-size: 11px;
    line-height: 1.6;
    color: #cfe0f0;
    white-space: pre;
    margin: 0;
}

.code-float-body .kw {
    color: var(--accent-color);
    font-weight: 600;
}

/* Section Authentification / Card */
.login-card {
    flex: 0 1 420px;
    width: 100%;
    max-width: 420px;
    min-width: 0;
    background: var(--card-bg);
    padding: clamp(24px, 4vw, 40px);
    border-radius: 24px;
    box-shadow: 0 20px 40px rgba(22, 48, 77, 0.08);
}

.login-card h2 {
    margin-bottom: 30px;
    font-size: 28px;
    font-weight: 600;
    text-align: center;
}

.input-group {
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.input-group label {
    font-size: 14px;
    font-weight: 500;
    color: var(--primary-color);
}

.input-group input {
    padding: 14px 16px;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    font-size: 15px;
    font-family: inherit;
    color: var(--primary-color);
    transition: all 0.3s ease;
    background-color: #fafbfc;
}

.input-group input:focus {
    outline: none;
    border-color: var(--accent-color);
    background-color: #fff;
    box-shadow: 0 0 0 4px rgba(242, 140, 24, 0.1);
}

/* Case à cocher personnalisée */
.role-choix {
    display: flex;
    gap: 10px;
}

.role-choix-option {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-muted);
    transition: all 0.2s ease;
}

.role-choix-option:has(input:checked) {
    border-color: var(--accent-color);
    background: rgba(242, 140, 24, 0.08);
    color: var(--primary-color);
}

.role-choix-option input {
    accent-color: var(--accent-color);
}

.form-options {
    margin-bottom: 25px;
}

.checkbox-container {
    display: flex;
    align-items: center;
    position: relative;
    padding-left: 30px;
    cursor: pointer;
    font-size: 14px;
    color: var(--text-muted);
    user-select: none;
}

.checkbox-container input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.checkmark {
    position: absolute;
    top: 0;
    left: 0;
    height: 20px;
    width: 20px;
    background-color: #fafbfc;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    transition: all 0.3s ease;
}

.checkbox-container:hover input ~ .checkmark {
    border-color: var(--accent-color);
}

.checkbox-container input:checked ~ .checkmark {
    background-color: var(--accent-color);
    border-color: var(--accent-color);
}

.checkmark:after {
    content: "";
    position: absolute;
    display: none;
}

.checkbox-container input:checked ~ .checkmark:after {
    display: block;
}

.checkbox-container .checkmark:after {
    left: 6px;
    top: 2px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

/* Boutons */
.btn-submit {
    width: 100%;
    padding: 15px;
    background-color: var(--accent-color);
    border: none;
    border-radius: 50px;
    font-size: 16px;
    font-weight: 600;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(242, 140, 24, 0.2);
}

.btn-submit:hover {
    background-color: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(242, 140, 24, 0.3);
}

/* Liens complémentaires */
.form-links {
    margin-top: 25px;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.forgot-password {
    text-decoration: none;
    color: var(--text-muted);
    font-size: 14px;
    transition: color 0.3s ease;
}

.forgot-password:hover {
    color: var(--accent-color);
}

.signup-text {
    font-size: 14px;
    color: var(--text-muted);
}

.signup-text a {
    text-decoration: none;
    color: var(--accent-color);
    font-weight: 600;
}

.signup-text a:hover {
    text-decoration: underline;
}

/* --- Messages système (succès / erreur) --- */
.app-messages {
    max-width: 600px;
    margin: 20px auto 0;
    padding: 0 5%;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.app-message {
    padding: 14px 18px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
}

.app-message--success {
    background-color: #e5f6ec;
    color: #1c7a41;
    border: 1px solid #bfe8cd;
}

.app-message--error {
    background-color: #fdeceb;
    color: #b3342a;
    border: 1px solid #f6c9c4;
}

.field-error {
    color: #c0392b;
    font-size: 13px;
    margin-top: -12px;
}

.help-text {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: -12px;
}

/* --- Éditeur de code + console interactive (compilateur) --- */
.compiler-layout {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    align-items: stretch;
}

.editor-panel, .console-panel {
    flex: 1 1 460px;
    min-width: 0;
    background: var(--card-bg);
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(22, 48, 77, 0.08);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 20px;
    background: var(--primary-color);
    color: #fff;
    font-weight: 600;
    font-size: 14px;
}

.panel-actions {
    display: flex;
    gap: 10px;
}

.btn-small {
    width: auto;
    padding: 8px 16px;
    font-size: 13px;
    border-radius: 50px;
    border: none;
    cursor: pointer;
    font-weight: 600;
}

.btn-small:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-stop {
    background-color: #e2554a;
    color: #fff;
}

.btn-stop:hover:not(:disabled) {
    background-color: #c94438;
}

#code-editor {
    flex: 1;
    min-height: 420px;
    border: none;
    resize: vertical;
    padding: 20px;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.6;
    color: var(--primary-color);
    background: #fafbfc;
    outline: none;
}

#console-output {
    flex: 1;
    min-height: 420px;
    max-height: 500px;
    overflow-y: auto;
    padding: 16px 20px;
    background: #0f2438;
    font-family: 'Courier New', monospace;
    font-size: 13px;
    line-height: 1.7;
    color: #d7e6f5;
}

.console-line {
    white-space: pre-wrap;
    word-break: break-word;
}

.console-line--error {
    color: #ff8a80;
}

.console-line--hint {
    color: #ffd98a;
}

.console-line--success {
    color: #7de3a0;
}

.console-line--input-echo {
    color: var(--accent-color);
}

.console-input-form {
    display: flex;
    padding: 12px 20px;
    background: #0f2438;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.console-input-form input {
    flex: 1;
    padding: 10px 14px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: #16304d;
    color: #fff;
    font-family: 'Courier New', monospace;
    font-size: 13px;
    outline: none;
}

.console-input-form input:focus {
    border-color: var(--accent-color);
}

@media (max-width: 900px) {
    .compiler-layout {
        flex-direction: column;
    }
    #code-editor, #console-output {
        min-height: 300px;
    }
}

/* --- Pied de page / Footer --- */
footer {
    min-height: 70px;
    background-color: #ffffff;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 400;
    width: 100%;
    padding: 12px 20px;
    text-align: center;
}

/* --- Responsive Design (Adaptation pour Écrans Mobiles et Tablettes) --- */
@media (max-width: 992px) {
    main {
        flex-direction: column;
        text-align: center;
    }

    .hero {
        max-width: 100%;
        flex-basis: auto;
    }

    .hero-visual {
        max-width: 460px;
        margin: 0 auto 50px;
    }

    .login-card {
        flex-basis: auto;
        max-width: 450px;
    }
}

@media (max-width: 560px) {
    .hero-visual {
        margin: 0 auto 60px;
    }

    .hero-image-accent {
        left: 4px;
        width: 46%;
    }

    .code-float {
        top: -18px;
        right: 4px;
        width: 170px;
        padding: 10px 12px;
    }

    .code-float-body {
        font-size: 9.5px;
    }
}

@media (max-width: 400px) {
    .hero-visual {
        margin: 0 auto 50px;
    }

    .hero-image-accent {
        width: 44%;
        border-width: 3px;
    }

    .code-float {
        width: 145px;
        padding: 8px 10px;
    }

    .code-float-body {
        font-size: 8.5px;
        line-height: 1.5;
    }

    .login-card {
        border-radius: 18px;
    }

    .login-card h2 {
        font-size: 24px;
    }

    footer {
        font-size: 12px;
        padding: 0 16px;
        text-align: center;
    }
}
/* ============================================================
   MODE INVITÉ (page de connexion)
   ============================================================ */
.login-separateur {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 18px 0 14px;
    color: var(--text-muted, #7a8699);
    font-size: 13px;
}

.login-separateur::before,
.login-separateur::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #e4e8ee;
}

.btn-invite {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 14px;
    background: transparent;
    border: 1px solid #d4d9df;
    border-radius: 50px;
    font-size: 15px;
    font-weight: 600;
    color: var(--primary-color);
    text-decoration: none;
    box-sizing: border-box;
    transition: all 0.2s ease;
}

.btn-invite:hover {
    border-color: var(--accent-color);
    color: var(--accent-color);
}

.login-invite-note {
    text-align: center;
    font-size: 12px;
    color: #98a2b3;
    margin-top: 10px;
}
