:root {
    --bg: #0f172a;
    --bg-soft: #111827;
    --card: rgba(15, 23, 42, 0.86);
    --card-solid: #111827;
    --border: rgba(148, 163, 184, 0.22);
    --text: #f8fafc;
    --muted: #94a3b8;
    --primary: #facc15;
    --primary-text: #111827;
    --danger: #fb7185;
    --success: #34d399;
    --info: #38bdf8;
    --shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
    --radius: 22px;
}

* {
    box-sizing: border-box;
}

html,
body {
    min-height: 100%;
    margin: 0;
}

body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at top left, rgba(250, 204, 21, 0.15), transparent 34rem),
        radial-gradient(circle at bottom right, rgba(56, 189, 248, 0.14), transparent 30rem),
        var(--bg);
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input,
select {
    font: inherit;
}

.app-body {
    min-height: 100vh;
}

.command-shell,
.programming-shell {
    width: min(1120px, calc(100% - 28px));
    margin: 0 auto;
    padding: 28px 0 44px;
}

.hero-card,
.card,
.login-card,
.info-panel {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    backdrop-filter: blur(18px);
}

.hero-card {
    padding: clamp(28px, 5vw, 54px);
    margin-bottom: 22px;
}

.hero-card h1,
.login-card h1,
.intro-card h1 {
    margin: 12px 0 10px;
    font-size: clamp(2.2rem, 6vw, 4.4rem);
    line-height: 0.98;
    letter-spacing: -0.055em;
}

.hero-card p,
.intro-card p {
    max-width: 760px;
    color: var(--muted);
    font-size: 1.08rem;
    line-height: 1.7;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    color: var(--primary);
    background: rgba(250, 204, 21, 0.1);
    border: 1px solid rgba(250, 204, 21, 0.24);
    border-radius: 999px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.76rem;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
    margin-bottom: 22px;
}

.portal-card {
    min-height: 190px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    gap: 10px;
    padding: 24px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: linear-gradient(160deg, rgba(255,255,255,0.08), rgba(255,255,255,0.02));
    box-shadow: var(--shadow);
    transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.portal-card:hover {
    transform: translateY(-4px);
    border-color: rgba(250, 204, 21, 0.55);
    background: linear-gradient(160deg, rgba(250,204,21,0.13), rgba(255,255,255,0.03));
}

.portal-card strong {
    font-size: 1.25rem;
}

.portal-card small,
.muted {
    color: var(--muted);
}

.portal-icon {
    width: 54px;
    height: 54px;
    display: grid;
    place-items: center;
    border-radius: 18px;
    background: rgba(250, 204, 21, 0.13);
    color: var(--primary);
    font-size: 1.7rem;
    font-weight: 900;
}

.info-panel,
.card {
    padding: 22px;
    margin-bottom: 18px;
}

.info-panel h2,
.card h2,
.card h1 {
    margin: 0;
}

.url-list {
    display: grid;
    gap: 10px;
    margin-top: 16px;
}

.url-list div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px;
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--border);
    border-radius: 14px;
}

code {
    color: var(--primary);
    overflow-wrap: anywhere;
}

.footer-actions {
    display: flex;
    justify-content: center;
    color: var(--muted);
}

.login-body {
    display: grid;
    place-items: center;
    padding: 18px;
}

.login-card {
    width: min(440px, 100%);
    padding: 28px;
}

.stack-form,
.program-form {
    display: grid;
    gap: 14px;
}

label {
    display: grid;
    gap: 7px;
    color: #dbeafe;
    font-weight: 700;
}

input,
select {
    width: 100%;
    min-height: 46px;
    padding: 10px 12px;
    color: var(--text);
    background: rgba(15, 23, 42, 0.75);
    border: 1px solid rgba(148, 163, 184, 0.28);
    border-radius: 14px;
    outline: none;
}

input:focus,
select:focus {
    border-color: rgba(250, 204, 21, 0.8);
    box-shadow: 0 0 0 4px rgba(250, 204, 21, 0.12);
}

input[type="color"] {
    padding: 4px;
    height: 46px;
}

.btn {
    min-height: 46px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    border: 1px solid rgba(148, 163, 184, 0.24);
    border-radius: 14px;
    color: var(--text);
    background: rgba(255, 255, 255, 0.07);
    cursor: pointer;
    font-weight: 800;
    transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.btn:hover {
    transform: translateY(-1px);
    border-color: rgba(250, 204, 21, 0.5);
}

.btn.primary {
    background: var(--primary);
    color: var(--primary-text);
    border-color: transparent;
}

.btn.warning {
    background: rgba(251, 113, 133, 0.14);
    border-color: rgba(251, 113, 133, 0.35);
    color: #fecdd3;
}

.btn.ghost {
    background: transparent;
}

.alert,
.toast {
    padding: 12px 14px;
    border-radius: 14px;
    border: 1px solid var(--border);
}

.alert.error {
    color: #fecdd3;
    background: rgba(251, 113, 133, 0.12);
    border-color: rgba(251, 113, 133, 0.35);
}

.toast {
    position: fixed;
    left: 50%;
    bottom: 22px;
    transform: translateX(-50%);
    max-width: min(460px, calc(100% - 28px));
    background: #020617;
    color: #f8fafc;
    box-shadow: var(--shadow);
    z-index: 50;
}

.toast.success {
    border-color: rgba(52, 211, 153, 0.4);
}

.toast.error {
    border-color: rgba(251, 113, 133, 0.4);
}

.back-link {
    display: inline-block;
    margin-top: 18px;
    color: var(--muted);
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 62px;
    padding: 0 18px;
    background: rgba(2, 6, 23, 0.82);
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(18px);
}

.topbar-link {
    color: var(--primary);
    font-weight: 800;
}

.section-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}

.section-title small {
    color: var(--muted);
}

.two-cols,
.three-cols {
    display: grid;
    gap: 14px;
}

.two-cols {
    grid-template-columns: repeat(2, 1fr);
}

.three-cols {
    grid-template-columns: repeat(3, 1fr);
}

.pill {
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    padding: 6px 10px;
    border-radius: 999px;
    color: var(--primary);
    background: rgba(250, 204, 21, 0.1);
    border: 1px solid rgba(250, 204, 21, 0.22);
    font-size: 0.8rem;
    font-weight: 800;
}

.responsive-table {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    padding: 12px 10px;
    border-bottom: 1px solid var(--border);
    text-align: left;
    vertical-align: middle;
}

th {
    color: var(--muted);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.table-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.table-actions .btn {
    min-height: 36px;
    padding: 7px 10px;
    border-radius: 11px;
}

@media (max-width: 760px) {
    .grid-3,
    .two-cols,
    .three-cols {
        grid-template-columns: 1fr;
    }

    .portal-card {
        min-height: 150px;
    }

    .url-list div,
    .section-title {
        align-items: flex-start;
        flex-direction: column;
    }

    .topbar {
        gap: 10px;
        font-size: 0.92rem;
    }
}


.display-launcher-frame {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    border: 0;
    background: #020617;
    z-index: 9999;
}

.portal-card.is-launching {
    pointer-events: none;
    opacity: 0.72;
    transform: translateY(-2px) scale(0.99);
}

.portal-card.is-launching::after {
    content: "Ouverture plein écran...";
    margin-top: 6px;
    color: var(--primary);
    font-size: 0.85rem;
    font-weight: 800;
}
