/* =========================================================
   DataGrade — Accueil en deux moitiés
   Gauche : connexion (élève par défaut, switch enseignant).
   Droite : attracteur étrange animé (home.js).
   Jetons, boutons, marque et sélecteur de langue : landing.css.
   Champs de formulaire : app.css (.form-row).
   ========================================================= */

.home {
    --art-bg: #0D0918;
    --pane-w: 46%;
    background: var(--bg);
}

.split {
    min-height: 100vh;
    min-height: 100dvh;
    display: grid;
    grid-template-rows: 38vh 1fr;
}
@media (min-width: 900px) {
    .split {
        grid-template-rows: none;
        grid-template-columns: minmax(400px, var(--pane-w)) 1fr;
    }
}

/* ---------- Moitié gauche ---------- */

.pane--form {
    display: flex;
    flex-direction: column;
    padding: 20px 24px 24px;
    order: 2;
}
@media (min-width: 900px) {
    .pane--form {
        order: 1;
        padding: 28px 40px 28px;
        min-height: 100vh;
        min-height: 100dvh;
        border-right: 1px solid var(--line);
    }
}
@media (min-width: 1280px) {
    .pane--form { padding: 32px 64px 32px; }
}

.pane__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.pane__body {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
    padding: 40px 0;
}

/* Liu + titre */
.pane__title { margin-bottom: 32px; text-align: center; }
.liu {
    display: block;
    width: 160px;
    height: 160px;
    margin: 0 auto;
    cursor: pointer;
    user-select: none;
}
.liu img { width: 100%; height: 100%; display: block; }
.pane__title h1 {
    margin-top: 6px;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.45rem;
    line-height: 1.25;
    letter-spacing: -0.015em;
    color: var(--ink);
    text-wrap: balance;
}
@media (max-width: 899px) {
    .liu { width: 120px; height: 120px; }
    .pane__title { margin-bottom: 24px; }
}

/* Switch élève / enseignant */
.switch {
    position: relative;
    display: grid;
    grid-template-columns: 1fr 1fr;
    padding: 4px;
    background: var(--line-soft);
    border: 1px solid var(--line);
    border-radius: var(--r-full);
    margin-bottom: 28px;
    isolation: isolate;
}
.switch__btn {
    position: relative;
    z-index: 1;
    padding: 9px 12px;
    border-radius: var(--r-full);
    text-align: center;
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 14px;
    color: var(--ink-muted);
    transition: color .25s var(--ease-out);
    cursor: pointer;
}
.switch__btn[aria-selected="true"] { color: var(--ink); }
.switch__btn:focus-visible {
    outline: 2px solid var(--violet-500);
    outline-offset: 2px;
}
.switch__thumb {
    position: absolute;
    z-index: 0;
    top: 4px; bottom: 4px; left: 4px;
    width: calc(50% - 4px);
    background: var(--bg-elev);
    border-radius: var(--r-full);
    box-shadow: var(--shadow-sm);
    transition: transform .35s var(--ease-out);
}
.home--teacher .switch__thumb { transform: translateX(100%); }

/* Panneaux */
.panel { display: none; }
.home:not(.home--teacher) .panel--student,
.home--teacher .panel--teacher { display: block; animation: panel-in .4s var(--ease-out) both; }
@keyframes panel-in {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: none; }
}

.panel__title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.35rem;
    line-height: 1.2;
    letter-spacing: -0.015em;
    color: var(--ink);
}
.panel__lead {
    margin-top: 8px;
    margin-bottom: 24px;
    color: var(--ink-soft);
    font-size: 15px;
    line-height: 1.6;
}
.panel__form .form-row { margin-bottom: 18px; }
.panel__form .code-input {
    text-transform: uppercase;
    letter-spacing: 0.18em;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 22px;
    text-align: center;
    padding: 14px 16px;
}
.panel__form .code-input::placeholder { letter-spacing: 0.18em; color: var(--line); }
.form-row__hint--right { text-align: right; }
.form-row__hint--right a { color: var(--violet-700); }

.panel__cta {
    width: 100%;
    margin-top: 6px;
}
.panel__alt {
    margin-top: 22px;
    font-size: 14px;
    line-height: 1.6;
    color: var(--ink-muted);
}
.panel__alt a {
    color: var(--violet-700);
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 3px;
    text-decoration-color: var(--violet-200);
}
.panel__alt a:hover { text-decoration-color: currentColor; }

/* Pied de la moitié gauche */
.pane__foot {
    font-size: 12.5px;
    line-height: 1.6;
    color: var(--ink-muted);
}
.pane__links {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 16px;
}
.pane__links a { color: var(--ink-soft); }
.pane__links a:hover { color: var(--violet-700); }
.pane__copy { margin-left: auto; }

/* ---------- Moitié droite : l'attracteur ---------- */

.pane--art {
    position: relative;
    order: 1;
    background: var(--art-bg);
    overflow: hidden;
    min-height: 38vh;
}
@media (min-width: 900px) {
    .pane--art {
        order: 2;
        position: sticky;
        top: 0;
        height: 100vh;
        height: 100dvh;
        min-height: 0;
    }
}
.art__canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
}
.art__caption {
    position: absolute;
    left: 24px;
    bottom: 22px;
    right: 24px;
    pointer-events: none;
    color: rgba(255, 255, 255, 0.72);
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 12px;
    line-height: 1.6;
    text-shadow: 0 1px 8px rgba(13, 9, 24, 0.9);
    transition: opacity .6s;
}
@media (min-width: 900px) {
    .art__caption { left: 32px; bottom: 28px; right: auto; }
}
.art__name {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 13px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 4px;
}
.art__eq { white-space: pre; opacity: .85; }
.art__params { opacity: .6; font-variant-numeric: tabular-nums; }
.art__caption.is-dim { opacity: 0; }

.art__hint {
    position: absolute;
    top: 20px;
    right: 24px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.45);
    pointer-events: none;
    transition: opacity 1.2s;
}
.art__hint.is-gone { opacity: 0; }
@media (max-width: 899px) {
    .art__hint { display: none; }
    .art__eq, .art__params { display: none; }
}

@media (prefers-reduced-motion: reduce) {
    .panel, .switch__thumb { animation: none; transition: none; }
    .home .btn { transition: none; }
    .home .btn:hover { transform: none; }
}
