/* ==========================================================================
   1. VARIABLES & RESET
   ========================================================================== */
:root {
    --bg-app: #0b1020;
    --bg-sidebar: #101626;
    --bg-main: #f4f5f8;
    --bg-card: #ffffff;
    --bg-card-soft: #f7f9fc;

    --color-primary: #2563eb;
    --color-primary-soft: rgba(37, 99, 235, 0.08);
    --color-primary-border: rgba(37, 99, 235, 0.35);

    --color-success: #16a34a;
    --color-error: #dc2626;
    --color-warning: #ea580c;

    --color-text-main: #0f172a;
    --color-text-soft: #6b7280;
    --color-text-on-dark: #e5e7eb;

    --border-subtle: rgba(148, 163, 184, 0.35);

    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;

    --shadow-soft: 0 10px 30px rgba(15, 23, 42, 0.18);
    --shadow-card: 0 4px 14px rgba(15, 23, 42, 0.12);

    --font-body: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    height: 100%;
}

body {
    font-family: var(--font-body);
    font-size: 15px;
    line-height: 1.6;
    color: var(--color-text-main);
    background: var(--bg-app);
}

/* ==========================================================================
   2. LAYOUT GLOBAL
   ========================================================================== */

.app {
    display: flex;
    height: 100vh;
    max-height: 100vh;
}

/* SIDEBAR */

.sidebar {
    width: 280px;
    background: radial-gradient(circle at top left, #1f2937, #020617);
    color: var(--color-text-on-dark);
    padding: 20px 18px;
    display: flex;
    flex-direction: column;
    border-right: 1px solid rgba(148, 163, 184, 0.4);
}

.sidebar__header {
    margin-bottom: 20px;
}

.sidebar__brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar__logo {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    object-fit: contain;
    background: rgba(15, 23, 42, 0.9);
    padding: 6px;
    box-shadow: 0 0 0 1px rgba(148, 163, 184, 0.5);
}

.sidebar__brand-name {
    font-weight: 700;
    font-size: 15px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.sidebar__brand-sub {
    font-size: 12px;
    color: #9ca3af;
}

/* MAIN */

.main {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--bg-main);
}

/* ==========================================================================
   3. HEADER PRINCIPAL
   ========================================================================== */

.main-header {
    padding: 18px 24px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.4);
    background: linear-gradient(120deg, #0f172a 0%, #1f2937 40%, #020617 100%);
    color: var(--color-text-on-dark);
    display: flex;
    justify-content: space-between;
    gap: 24px;
}

.main-header__kicker {
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: #93c5fd;
    margin-bottom: 6px;
}

.main-header__title {
    margin: 0;
    font-size: 22px;
    font-weight: 600;
}

.main-header__subtitle {
    margin: 6px 0 0;
    font-size: 13px;
    color: #cbd5f5;
    max-width: 560px;
}

.main-header__meta {
    text-align: right;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 8px;
}

.main-header__tagline {
    font-size: 12px;
    color: #9ca3af;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 10px;
    border-radius: 999px;
    font-size: 12px;
}

.badge--soft {
    background: rgba(15, 23, 42, 0.7);
    border: 1px solid rgba(148, 163, 184, 0.6);
}

.badge__strong {
    font-weight: 600;
}

/* ==========================================================================
   4. MAIN BODY & SECTIONS
   ========================================================================== */

.main-body {
    padding: 22px 28px 28px;
    overflow-y: auto;
    height: calc(100vh - 80px);
}

/* Alerts */

.alerts {
    margin-bottom: 16px;
}

.alert {
    border-radius: var(--radius-md);
    padding: 10px 12px;
    font-size: 14px;
    margin-bottom: 8px;
}

.alert--success {
    background: #ecfdf3;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.alert--error {
    background: #fef2f2;
    color: #b91c1c;
    border: 1px solid #fecaca;
}

.alert--warning {
    background: #fffbeb;
    color: #b45309;
    border: 1px solid #facc15;
}

.alert--info {
    background: #eff6ff;
    color: #1d4ed8;
    border: 1px solid #bfdbfe;
}

/* Section */

.section {
    margin-bottom: 32px;
}

.section--narrow {
    max-width: 640px;
    margin: 0 auto 32px;
}

.section__header {
    margin-bottom: 18px;
}

.section__header--center {
    text-align: center;
}

.section__title {
    margin: 0 0 4px;
    font-size: 20px;
    font-weight: 600;
    color: #0f172a;
}

.section__subtitle {
    margin: 0;
    font-size: 14px;
    color: var(--color-text-soft);
}

/* ==========================================================================
   5. GRID SYSTEM
   ========================================================================== */

.grid {
    display: grid;
    gap: 18px;
}

.grid--2col {
    grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
}

.grid--3col {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

@media (max-width: 1100px) {
    .grid--2col,
    .grid--3col {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* ==========================================================================
   6. SIDEBAR STEPPER & SUMMARY
   ========================================================================== */

.stepper {
    margin-bottom: 18px;
    padding-top: 8px;
    padding-bottom: 8px;
    border-top: 1px solid rgba(148, 163, 184, 0.5);
    border-bottom: 1px solid rgba(148, 163, 184, 0.5);
}

.stepper__item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 4px;
    border-radius: var(--radius-md);
    font-size: 13px;
    color: #9ca3af;
    transition: background 0.15s ease, color 0.15s ease;
}

.stepper__item + .stepper__item {
    margin-top: 2px;
}

.stepper__circle {
    width: 26px;
    height: 26px;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
}

.stepper__info {
    display: flex;
    flex-direction: column;
}

.stepper__title {
    font-weight: 500;
}

.stepper__subtitle {
    font-size: 11px;
    color: #6b7280;
}

.stepper__item--active {
    background: rgba(37, 99, 235, 0.2);
    color: #bfdbfe;
}

.stepper__item--active .stepper__circle {
    border-color: #60a5fa;
    background: #1d4ed8;
    color: #fff;
}

.stepper__item--done {
    background: rgba(22, 163, 74, 0.16);
    color: #bbf7d0;
}

.stepper__item--done .stepper__circle {
    border-color: #4ade80;
    background: #16a34a;
    color: #fff;
}

/* Résumé */

.sidebar__summary {
    margin-top: 18px;
    border-radius: var(--radius-md);
    padding: 12px 10px;
    background: rgba(15, 23, 42, 0.85);
    border: 1px solid rgba(148, 163, 184, 0.7);
    font-size: 13px;
}

.sidebar__summary-title {
    font-weight: 600;
    margin-bottom: 6px;
}

.sidebar__summary-row {
    display: flex;
    justify-content: space-between;
    margin-top: 3px;
}

.sidebar__summary-row--muted span {
    color: #9ca3af;
    font-size: 12px;
}

/* Footer */

.sidebar__footer {
    margin-top: auto;
    padding-top: 14px;
    border-top: 1px solid rgba(148, 163, 184, 0.5);
    font-size: 12px;
}

.sidebar__footer-title {
    font-weight: 500;
    margin-bottom: 6px;
}

.sidebar__footer-row {
    margin-bottom: 3px;
}

.sidebar__footer a {
    color: #bfdbfe;
    text-decoration: none;
}

.sidebar__footer a:hover {
    text-decoration: underline;
}

/* ==========================================================================
   7. CARDS, INFO-BOX & LISTES
   ========================================================================== */

.card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid rgba(148, 163, 184, 0.3);
    padding: 18px 18px 16px;
    box-shadow: var(--shadow-card);
}

.card--soft {
    background: var(--bg-card-soft);
    border-style: dashed;
}

.card--form {
    background: #ffffff;
}

.card--shadow {
    box-shadow: var(--shadow-soft);
}

.card--table {
    padding: 0;
    overflow: hidden;
}

.card--payment {
    max-width: 420px;
    margin: 0 auto;
}

.card--center {
    text-align: left;
    max-width: 480px;
    margin: 0 auto;
}

.card__title {
    margin: 0 0 10px;
    font-size: 16px;
    font-weight: 600;
}

.card__header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.card__icon {
    width: 32px;
    height: 32px;
    border-radius: 999px;
    background: var(--color-primary-soft);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.card__header-text {
    font-weight: 600;
    font-size: 14px;
}

.card__list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.card__list li + li {
    margin-top: 8px;
}

.card__list-title {
    font-weight: 500;
    font-size: 14px;
}

.card__list-text {
    font-size: 13px;
    color: var(--color-text-soft);
}

.card__list-price {
    font-size: 12px;
    color: var(--color-primary);
    margin-top: 2px;
}

.card__row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 6px;
    font-size: 14px;
}

.card__row--total {
    margin-top: 8px;
    padding-top: 6px;
    border-top: 1px solid rgba(148, 163, 184, 0.6);
    font-weight: 600;
}

.card__note {
    margin-top: 8px;
    font-size: 12px;
    color: var(--color-text-soft);
}

.card__actions {
    margin-top: 18px;
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

.card__footer-link {
    margin-top: 10px;
    text-align: center;
    font-size: 13px;
}

.card__footer-link a,
.card__footer-link button.btn--link {
    color: var(--color-primary);
    text-decoration: none;
    background: none;
    border: none;
    padding: 0;
    font: inherit;
    cursor: pointer;
}

.card__footer-link a:hover,
.btn--link:hover {
    text-decoration: underline;
}

/* Info box */

.info-box {
    margin-top: 14px;
    padding: 10px 12px;
    border-radius: var(--radius-md);
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    display: flex;
    gap: 10px;
}

.info-box--soft {
    background: #fefce8;
    border-color: #facc15;
}

.info-box__icon {
    font-size: 16px;
    margin-top: 2px;
}

.info-box__title {
    font-weight: 600;
    font-size: 14px;
}

.info-box__text {
    font-size: 13px;
    color: var(--color-text-soft);
}

/* Listes */

.list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.list__item {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    margin-bottom: 10px;
}

.list__icon {
    width: 26px;
    height: 26px;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}

.list__label {
    font-weight: 500;
    font-size: 14px;
}

.list__text {
    font-size: 13px;
    color: var(--color-text-soft);
}

.list__separator-title {
    margin: 14px 0 6px;
    font-weight: 600;
    font-size: 14px;
}

/* ==========================================================================
   8. FORMULAIRES & CHOIX
   ========================================================================== */

.form__group {
    margin-bottom: 14px;
}

.form__group--inline {
    display: flex;
    align-items: center;
    gap: 8px;
}

.form__group-title {
    margin-top: 6px;
    margin-bottom: 6px;
    font-weight: 600;
    font-size: 14px;
}

.form__label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 4px;
}

.form__control {
    width: 100%;
    border-radius: var(--radius-md);
    border: 1px solid rgba(148, 163, 184, 0.8);
    padding: 8px 10px;
    font: inherit;
    background: #ffffff;
    color: var(--color-text-main);
    transition: border-color 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
}

.form__control:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.3);
    background: #f9fafb;
}

.form__control--otp {
    text-align: center;
    letter-spacing: 0.5em;
    font-size: 20px;
    padding: 10px 16px;
}

.form__help {
    font-size: 12px;
    color: var(--color-text-soft);
    margin-top: 2px;
}

.checkbox {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    cursor: pointer;
}

.checkbox input {
    width: 16px;
    height: 16px;
}

/* Actions */

.form__actions {
    margin-top: 6px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.form__actions--right {
    justify-content: flex-end;
}

/* Choice cards (intro) */

.choice-group {
    display: grid;
    gap: 8px;
}

.choice {
    border-radius: var(--radius-md);
    border: 1px solid rgba(148, 163, 184, 0.7);
    padding: 8px 10px;
    cursor: pointer;
    background: rgba(15, 23, 42, 0.01);
    transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.choice input {
    display: none;
}

.choice__title {
    font-size: 14px;
    font-weight: 500;
}

.choice__text {
    font-size: 13px;
    color: var(--color-text-soft);
}

.choice--active,
.choice:hover {
    border-color: var(--color-primary);
    background: var(--color-primary-soft);
    box-shadow: 0 0 0 1px var(--color-primary-border);
}

/* Options (step 2) */

.option-card {
    border-radius: var(--radius-lg);
    border: 1px solid rgba(148, 163, 184, 0.6);
    padding: 12px 12px 10px;
    cursor: pointer;
    background: #ffffff;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.1s ease;
    position: relative;
}

.option-card input {
    display: none;
}

.option-card__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.option-card__icon {
    font-size: 20px;
}

.option-card__price {
    font-size: 12px;
    padding: 3px 8px;
    background: var(--color-primary-soft);
    border-radius: 999px;
    color: var(--color-primary);
}

.option-card__title {
    font-weight: 600;
    font-size: 14px;
}

.option-card__text {
    font-size: 13px;
    color: var(--color-text-soft);
    margin-top: 2px;
}

.option-card__list {
    list-style: none;
    margin: 8px 0 0;
    padding: 0;
    font-size: 12px;
    color: var(--color-text-soft);
}

.option-card__list li + li {
    margin-top: 2px;
}

.option-card--active,
.option-card:hover {
    border-color: var(--color-primary);
    box-shadow: var(--shadow-soft);
    transform: translateY(-1px);
}

/* Buttons */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 8px 14px;
    border-radius: var(--radius-md);
    border: 1px solid transparent;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    background: #e5e7eb;
    color: #111827;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.btn--primary {
    background: var(--color-primary);
    color: #ffffff;
    border-color: var(--color-primary);
}

.btn--primary:hover {
    background: #1d4ed8;
    border-color: #1d4ed8;
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.35);
}

.btn--ghost {
    background: transparent;
    color: var(--color-primary);
    border-color: rgba(148, 163, 184, 0.7);
}

.btn--ghost:hover {
    background: rgba(148, 163, 184, 0.15);
}

.btn--outline {
    background: #ffffff;
    border-color: var(--color-primary);
    color: var(--color-primary);
}

.btn--outline:hover {
    background: var(--color-primary-soft);
}

.btn--block {
    width: 100%;
}

.btn__arrow {
    font-size: 16px;
}

/* Status */

.status {
    margin-bottom: 10px;
    padding: 8px 10px;
    border-radius: var(--radius-md);
    font-size: 14px;
}

.status--success {
    background: #ecfdf3;
    color: #15803d;
    border: 1px solid #bbf7d0;
}

/* Table */

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.table thead {
    background: #0f172a;
    color: #e5e7eb;
}

.table th,
.table td {
    padding: 9px 12px;
}

.table th {
    text-align: left;
    font-weight: 500;
    border-bottom: 1px solid rgba(148, 163, 184, 0.5);
}

.table tbody tr:nth-child(even) {
    background: #f9fafb;
}

.table__th-center,
.table__td-center {
    text-align: center;
}

.table__th-right,
.table__td-right {
    text-align: right;
}

.table tfoot tr {
    background: #eff6ff;
}

.table tfoot td {
    border-top: 1px solid #bfdbfe;
}

.table__td-strong {
    font-weight: 600;
}

/* Mini table (intro) */
.table--mini {
    font-size: 13px;
    margin-bottom: 12px;
}

.table--mini th,
.table--mini td {
    padding: 6px 8px;
}

/* ==========================================================================
   9. LOADING OVERLAY
   ========================================================================== */

.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.68);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999;
    opacity: 1;
    transition: opacity 0.2s ease;
}

.loading-overlay--hidden {
    opacity: 0;
    pointer-events: none;
}

.loading-overlay__box {
    background: #020617;
    border-radius: var(--radius-lg);
    padding: 16px 18px;
    box-shadow: 0 16px 40px rgba(15, 23, 42, 0.7);
    border: 1px solid rgba(148, 163, 184, 0.8);
    color: #e5e7eb;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.loading-overlay__spinner {
    width: 26px;
    height: 26px;
    border-radius: 999px;
    border: 3px solid rgba(148, 163, 184, 0.4);
    border-top-color: #38bdf8;
    animation: spin 0.9s linear infinite;
}

.loading-overlay__text {
    font-size: 13px;
    text-align: center;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ==========================================================================
   10. RESPONSIVE
   ========================================================================== */

@media (max-width: 900px) {
    .app {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        flex-direction: column;
        overflow-x: auto;
        height: auto;
    }

    .sidebar__footer {
        display: none;
    }

    .main-header {
        flex-direction: column;
    }

    .main-body {
        padding: 16px 16px 20px;
    }
}


.schema-flow {
    margin-bottom: 24px;
}

.schema-flow__intro {
    margin-bottom: 16px;
}

.schema-flow__steps {
    display: flex;
    flex-direction: column;
    gap: 18px;
    position: relative;
}

.schema-flow__step {
    display: flex;
    gap: 16px;
}

.schema-flow__step--last .schema-flow__line::after {
    display: none;
}

.schema-flow__line {
    position: relative;
    width: 32px;
    display: flex;
    justify-content: center;
}

.schema-flow__line::after {
    content: "";
    position: absolute;
    top: 26px;
    bottom: -18px;
    width: 2px;
    border-radius: 999px;
    background: linear-gradient(to bottom, #22c55e, #0b1f3b);
    opacity: 0.4;
}

.schema-flow__bullet {
    width: 26px;
    height: 26px;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 600;
    color: #ffffff;
    background: radial-gradient(circle at 30% 30%, #22c55e, #0b1f3b);
    box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.15);
}

.schema-flow__content {
    flex: 1;
    border-radius: 14px;
    border: 1px solid rgba(148, 163, 184, 0.4);
    padding: 10px 12px 12px 12px;
    background: linear-gradient(135deg, #f9fafb 0%, #ffffff 60%, #eef2ff 100%);
}

.schema-flow__header {
    margin-bottom: 8px;
}

.schema-flow__title {
    margin: 0 0 2px;
    font-size: 14px;
    font-weight: 600;
    color: #0b1f3b;
}

.schema-flow__subtitle {
    margin: 0;
    font-size: 12px;
    color: #6b7280;
}

.schema-flow__media {
    display: flex;
    gap: 12px;
    align-items: center;
}

.schema-flow__img {
    width: 80px;
    height: auto;
    border-radius: 10px;
    box-shadow: 0 6px 14px rgba(15, 23, 42, 0.12);
    object-fit: cover;
}

.schema-flow__list {
    margin: 0;
    padding-left: 16px;
    font-size: 12px;
    color: #374151;
}

.schema-flow__list li {
    margin-bottom: 2px;
}

.schema-flow__note {
    margin-top: 14px;
    font-size: 12px;
    color: #6b7280;
    border-top: 1px dashed #e5e7eb;
    padding-top: 8px;
}
