:root {
    --color-bg: #f5f6fa;
    --color-bg-hero: #ffffff;
    --color-primary: #123a63;
    --color-primary-soft: #1f5b99;
    --color-border: #dde1eb;
    --color-text: #1d2433;
    --color-muted: #6f7a8a;
    --color-error: #b00020;
    --color-success: #1b8a3b;
    --radius-lg: 18px;
    --radius-pill: 999px;
    --shadow-soft: 0 18px 40px rgba(0, 0, 0, 0.06);
    --font-sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    font-family: var(--font-sans);
    background: var(--color-bg);
    color: var(--color-text);
}

.layout-split {
    min-height: 100vh;
    display: flex;
    align-items: stretch;
}

.left-panel,
.right-panel {
    padding: 40px 48px;
}

.left-panel {
    flex: 1;
    background: var(--color-bg-hero);
    display: flex;
    flex-direction: column;
    justify-content: center;
    box-shadow: var(--shadow-soft);
    z-index: 2;
}

.right-panel {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.brand-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 32px;
}

.logo {
    height: 40px;
}

.brand-name {
    font-weight: 700;
    letter-spacing: 0.08em;
    font-size: 1.1rem;
    color: var(--color-primary);
}

.hero-title {
    font-size: 2.2rem;
    line-height: 1.2;
    margin: 0 0 12px;
}

.hero-subtitle {
    margin: 0 0 24px;
    color: var(--color-muted);
    max-width: 460px;
}

.cta-buttons {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
}

.btn {
    border-radius: var(--radius-pill);
    border: 1px solid transparent;
    padding: 10px 22px;
    font-size: 0.95rem;
    cursor: pointer;
    transition: transform 0.12s ease, box-shadow 0.12s ease, background-color 0.15s ease, color 0.15s ease;
    font-weight: 500;
    background: transparent;
}

.btn-primary {
    background: var(--color-primary);
    color: #ffffff;
    box-shadow: 0 10px 25px rgba(10, 46, 92, 0.25);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 14px 32px rgba(10, 46, 92, 0.35);
    background: var(--color-primary-soft);
}

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

.btn-outline:hover {
    background: #e4ecf7;
}

.btn-ghost {
    border-color: transparent;
    color: var(--color-muted);
}

.btn-ghost:hover {
    background: rgba(0, 0, 0, 0.03);
}

.btn-full {
    width: 100%;
}

.btn-disabled {
    opacity: 0.6;
    cursor: not-allowed;
    box-shadow: none;
}

/* Panneaux */

.right-panel {
    background: radial-gradient(circle at top left, #ffffff, #e5edf7);
}

.panel {
    position: absolute;
    max-width: 520px;
    width: 100%;
    padding: 32px 28px;
    border-radius: var(--radius-lg);
    background: #ffffff;
    box-shadow: var(--shadow-soft);
    opacity: 0;
    transform: translateY(12px);
    pointer-events: none;
    transition: opacity 0.18s ease, transform 0.18s ease;
}

.panel-active {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.panel h2 {
    margin-top: 0;
    margin-bottom: 12px;
    font-size: 1.4rem;
}

.feature-list {
    list-style: none;
    padding: 0;
    margin: 12px 0 0;
}

.feature-list li + li {
    margin-top: 14px;
}

.feature-list h3 {
    margin: 0 0 4px;
    font-size: 1.02rem;
}

.feature-list p {
    margin: 0;
    color: var(--color-muted);
    font-size: 0.92rem;
}

/* Formulaires */

.form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.form-group label {
    font-size: 0.9rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    border-radius: 10px;
    border: 1px solid var(--color-border);
    padding: 9px 11px;
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.12s ease, box-shadow 0.12s ease, background-color 0.12s ease;
    background: #f9fafc;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--color-primary-soft);
    box-shadow: 0 0 0 3px rgba(33, 96, 158, 0.18);
    background: #ffffff;
}

.form-group input[type="file"] {
    padding: 6px 4px;
    background: transparent;
}

.form-alt {
    margin-top: 10px;
    font-size: 0.88rem;
    color: var(--color-muted);
}

.form-alt a {
    color: var(--color-primary);
    text-decoration: none;
}

.form-alt a:hover {
    text-decoration: underline;
}

/* Steps inscription */

.form-step {
    display: none;
}

.form-step-active {
    display: block;
}

.segmented-control {
    display: flex;
    gap: 8px;
    background: #f1f3f8;
    padding: 4px;
    border-radius: var(--radius-pill);
}

.segmented-control.compact {
    border-radius: 14px;
}

.segmented-control input {
    display: none;
}

.segmented-control span {
    display: inline-block;
    padding: 6px 12px;
    border-radius: var(--radius-pill);
    font-size: 0.88rem;
    cursor: pointer;
    color: var(--color-muted);
}

.segmented-control input:checked + span {
    background: #ffffff;
    color: var(--color-primary);
    box-shadow: 0 0 0 1px rgba(20, 70, 122, 0.25);
}

.fieldset-inline {
    border: 1px dashed var(--color-border);
    border-radius: 12px;
    padding: 10px 12px;
    margin: 6px 0;
}

.fieldset-inline legend {
    padding: 0 6px;
    font-size: 0.86rem;
    color: var(--color-muted);
}

.hint {
    font-size: 0.78rem;
    color: var(--color-muted);
}

.step-actions {
    display: flex;
    justify-content: space-between;
    margin-top: 8px;
}

.inline-label {
    display: flex;
    align-items: center;
    gap: 6px;
}

.info-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 1px solid var(--color-muted);
    font-size: 0.76rem;
    color: var(--color-muted);
}

/* Flash */

.flash {
    margin-top: 14px;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 0.88rem;
}

.flash.error {
    background: #fde7eb;
    color: var(--color-error);
}

.flash.success {
    background: #e3f6ea;
    color: var(--color-success);
}

/* Dashboard */

.dashboard-body {
    background: #eef1f7;
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 32px;
    background: #ffffff;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
}

.dashboard-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.88rem;
}

.tag {
    padding: 4px 10px;
    border-radius: var(--radius-pill);
    background: #dde7f7;
    color: var(--color-primary);
    font-weight: 600;
}

.uid {
    color: var(--color-muted);
}

.link-logout {
    color: var(--color-primary);
    text-decoration: none;
}

.link-logout:hover {
    text-decoration: underline;
}

.dashboard-main {
    padding: 24px 32px 40px;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 18px;
}

.card {
    background: #ffffff;
    border-radius: 16px;
    padding: 16px 18px 18px;
    box-shadow: var(--shadow-soft);
}

.card h2 {
    margin-top: 0;
    margin-bottom: 6px;
    font-size: 1.15rem;
}

.card p {
    margin: 0 0 12px;
    font-size: 0.92rem;
    color: var(--color-muted);
}

.payload-preview {
    max-height: 220px;
    overflow: auto;
    font-size: 0.78rem;
    background: #0f172a;
    color: #e5e7eb;
    padding: 10px 12px;
    border-radius: 10px;
}

/* Responsive */

@media (max-width: 960px) {
    .layout-split {
        flex-direction: column;
    }

    .left-panel,
    .right-panel {
        padding: 24px 20px;
    }

    .left-panel {
        box-shadow: none;
    }

    .right-panel {
        min-height: 60vh;
    }

    .panel {
        position: static;
        margin-top: 16px;
        max-width: 100%;
    }
}
