/* ═══════════════════════════════════════════
   Variables & Reset
   ═══════════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --bp-blue:       #36a9e1;
    --bp-blue-dark:  #178BFF;
    --bp-indigo:     #311EC1;
    --bp-teal:       #00AFAA;
    --bp-teal-light: #00D1D1;
    --bp-text:       #313130;
    --bp-gray:       #6b7280;
    --bp-border:     #e5e7eb;
    --bp-bg:         #f4f7fb;
    --bp-input-h:    52px;
    --bp-radius-btn: 50px;
    --bp-radius-inp: 8px;
}

/* ═══════════════════════════════════════════
   Layout
   ═══════════════════════════════════════════ */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bp-bg);
    color: var(--bp-text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2.5rem 1.5rem;
}

/* ═══════════════════════════════════════════
   Navigation
   ═══════════════════════════════════════════ */
nav {
    background: #fff;
    border-bottom: 1px solid var(--bp-border);
    padding: 0 2rem;
    height: 64px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

nav .brand svg {
    display: block;
}

nav .nav-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

nav .nav-user {
    font-size: 0.85rem;
    color: var(--bp-gray);
}

nav .nav-user__email {
    font-size: 0.8rem;
    opacity: 0.7;
}

nav a.nav-logout {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--bp-blue);
    text-decoration: none;
    padding: 0.45rem 1.1rem;
    border: 1.5px solid var(--bp-blue);
    border-radius: var(--bp-radius-btn);
    transition: background 0.15s, color 0.15s;
}

nav a.nav-logout:hover {
    background: var(--bp-blue);
    color: #fff;
}

/* ═══════════════════════════════════════════
   Footer
   ═══════════════════════════════════════════ */
footer {
    background: #fff;
    border-top: 1px solid var(--bp-border);
    padding: 1rem 2rem;
    text-align: center;

    font-size: 0.8rem;
    line-height: 1.4;
    color: var(--bp-gray);
}

footer li {
    list-style-type: none;
}

footer a {
    color: var(--bp-blue);
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

/* ═══════════════════════════════════════════
   Card
   ═══════════════════════════════════════════ */
.card {
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 2px 16px rgba(49,30,193,0.07), 0 1px 4px rgba(0,0,0,0.04);
    padding: 2.5rem;
    width: 100%;
    max-width: 480px;
}

.card h1 {
    font-size: 1.55rem;
    color: var(--bp-text);
    margin-bottom: 1.5rem;
}

.card--wide {
    max-width: 680px;
}

.card h1.card__title--sm {
    margin-bottom: 0.25rem;
}

/* ═══════════════════════════════════════════
   Alerts
   ═══════════════════════════════════════════ */
.alert {
    padding: 0.85rem 1.1rem;
    border-radius: var(--bp-radius-inp);
    margin-bottom: 1.2rem;
    font-size: 0.9rem;
}

.alert-danger  { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }
.alert-success { background: #d1fae5; color: #065f46; border: 1px solid #6ee7b7; }

/* ═══════════════════════════════════════════
   Subtitle
   ═══════════════════════════════════════════ */
.subtitle {
    color: var(--bp-gray);
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}

.subtitle--lg {
    margin-bottom: 2rem;
}

/* ═══════════════════════════════════════════
   Buttons — style bienpreter.com
   ═══════════════════════════════════════════ */

/* Bouton principal : dégradé pill */
button[type="submit"],
.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 2rem;
    height: 46px;
    background: linear-gradient(90deg, var(--bp-blue) 0%, var(--bp-blue-dark) 100%);
    color: #fff;
    border: none;
    border-radius: var(--bp-radius-btn);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: opacity 0.2s, box-shadow 0.2s;
    box-shadow: 0 2px 8px rgba(23, 139, 255, 0.25);
    white-space: nowrap;
}

button[type="submit"]:hover,
.btn-primary:hover {
    opacity: 0.9;
    box-shadow: 0 4px 14px rgba(23, 139, 255, 0.35);
}

/* Bouton outline pill */
.btn-edit,
.btn-outline {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 1.2rem;
    height: 36px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--bp-blue);
    text-decoration: none;
    border: 1.5px solid var(--bp-blue);
    border-radius: var(--bp-radius-btn);
    background: transparent;
    transition: background 0.15s, color 0.15s;
    white-space: nowrap;
}

.btn-edit:hover,
.btn-outline:hover {
    background: var(--bp-blue);
    color: #fff;
}

/* Bouton annuler — texte simple */
.btn-cancel {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 1.2rem;
    height: 46px;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--bp-gray);
    text-decoration: none;
    border: 1.5px solid var(--bp-border);
    border-radius: var(--bp-radius-btn);
    background: transparent;
    transition: border-color 0.15s, color 0.15s;
}

.btn-cancel:hover {
    border-color: var(--bp-gray);
    color: var(--bp-text);
}

/* ═══════════════════════════════════════════
   User info panel (home)
   ═══════════════════════════════════════════ */
.user-info {
    background: #f9fafb;
    border: 1px solid var(--bp-border);
    border-radius: 10px;
    padding: 1.25rem 1.5rem;
    margin-bottom: 2rem;
}

.user-info-title {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--bp-gray);
    margin-bottom: 0.85rem;
}

.user-info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem 1.5rem;
}

.user-info-field {
    display: flex;
    flex-direction: column;
}

.user-info-field .field-label {
    font-size: 0.72rem;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 0.1rem;
}

.user-info-field .field-value {
    font-size: 0.9rem;
    color: #1a1a2e;
    font-weight: 500;
}

.user-info-field .field-value.empty {
    color: #d1d5db;
    font-style: italic;
    font-weight: 400;
}

.user-info-divider {
    border: none;
    border-top: 1px solid var(--bp-border);
    margin: 0.85rem 0;
}

/* ═══════════════════════════════════════════
   Checkboxes (home)
   ═══════════════════════════════════════════ */
.options-list {
    list-style: none;
    margin-bottom: 1.5rem;
}

.options-list li {
    margin-bottom: 1rem;
}

.checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    cursor: pointer;
    padding: 1rem;
    border: 1.5px solid var(--bp-border);
    border-radius: 10px;
    transition: border-color 0.2s, background 0.2s;
}

.checkbox-label:hover {
    border-color: var(--bp-blue);
    background: #f0f8fd;
}

.checkbox-label input[type="checkbox"] {
    width: 1.15rem;
    height: 1.15rem;
    margin-top: 0.15rem;
    accent-color: var(--bp-blue);
    flex-shrink: 0;
    cursor: pointer;
}

.checkbox-label .label-text {
    font-weight: 600;
    color: #1a1a2e;
}

.checkbox-label .label-desc {
    display: block;
    font-size: 0.82rem;
    color: var(--bp-gray);
    margin-top: 0.2rem;
}

/* ═══════════════════════════════════════════
   Login form — floating labels, style BP
   ═══════════════════════════════════════════ */
.form-group {
    margin-bottom: 1.2rem;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    color: #4b5563;
    margin-bottom: 0.45rem;
}

.form-group input[type="text"],
.form-group input[type="password"] {
    width: 100%;
    height: var(--bp-input-h);
    padding: 0 1rem;
    border: 1.5px solid #d1d5db;
    border-radius: var(--bp-radius-inp);
    font-size: 1rem;
    color: var(--bp-text);
    background: #fff;
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
}

.form-group input[type="text"]:focus,
.form-group input[type="password"]:focus {
    border-color: var(--bp-blue);
    box-shadow: 0 0 0 3px rgba(54, 169, 225, 0.18);
}

/* ═══════════════════════════════════════════
   Profile edit form — inputs style BP
   ═══════════════════════════════════════════ */
.form-section-title {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--bp-gray);
    margin: 1.75rem 0 1rem;
    padding-bottom: 0.4rem;
    border-bottom: 1px solid var(--bp-border);
}

.form-section-title:first-of-type {
    margin-top: 0;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem 1.5rem;
}

.form-field {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.form-field.full-width {
    grid-column: span 2;
}

/* Label flottant simulé : label au-dessus, petit */
.form-field label {
    font-size: 0.78rem;
    font-weight: 600;
    color: #4b5563;
    margin-bottom: 0.4rem;
    letter-spacing: 0.01em;
}

/* Inputs et selects : hauteur fixe, arrondi BP, border 1.5px */
.form-field input,
.form-field select {
    height: var(--bp-input-h);
    padding: 0 1rem;
    border: 1.5px solid #d1d5db;
    border-radius: var(--bp-radius-inp);
    font-size: 0.95rem;
    color: var(--bp-text);
    background: #fff;
    transition: border-color 0.2s, box-shadow 0.2s;
    width: 100%;
    outline: none;
    appearance: none;
    -webkit-appearance: none;
}

/* Select : chevron custom */
.form-field select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236b7280' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 2.5rem;
    cursor: pointer;
}

.form-field input:disabled,
.form-field input[readonly] {
    background: #f9fafb;
    color: #9ca3af;
    cursor: not-allowed;
    border-color: var(--bp-border);
}

.form-field input:focus,
.form-field select:focus {
    border-color: var(--bp-blue);
    box-shadow: 0 0 0 3px rgba(54, 169, 225, 0.18);
}

.form-field.has-error input,
.form-field.has-error select {
    border-color: #ef4444;
    background: #fff8f8;
}

.form-field.has-error input:focus,
.form-field.has-error select:focus {
    border-color: #ef4444;
    box-shadow: 0 0 0 3px rgba(239,68,68,0.12);
}

.field-errors {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    margin-top: 0.35rem;
}

.field-error {
    font-size: 0.78rem;
    color: #dc2626;
    line-height: 1.3;
}

.field-hint {
    font-size: 0.78rem;
    color: #6b7280;
    line-height: 1.4;
    margin-top: 0.35rem;
    display: block;
}

.field-hint--warning {
    color: #92400e;
    background: #fffbeb;
    border: 1px solid #fcd34d;
    border-radius: 6px;
    padding: 0.45rem 0.65rem;
}

.form-actions {
    display: flex;
    gap: 0.85rem;
    margin-top: 2rem;
    align-items: center;
}

/* Champs obligatoires */
label.label-required::after {
    content: ' *';
    color: #dc2626;
    font-weight: 600;
}

.required-star {
    color: #dc2626;
    font-weight: 600;
}

/* ═══════════════════════════════════════════
   Migration — Statuts intermédiaires (SCA / KYC)
   ═══════════════════════════════════════════ */

.migration-action {
    margin-top: 2rem;
    padding: 1.5rem 1.75rem;
    background: #f0f7ff;
    border: 1.5px solid #b8d9f7;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.migration-action__text {
    font-size: 0.97rem;
    color: #313130;
    line-height: 1.6;
}

.migration-action--refused {
    background: #fff7ed;
    border-color: #fed7aa;
}

.migration-action--error {
    background: #fff8f8;
    border-color: #fecaca;
}

.migration-action--review {
    background: #fffbeb;
    border-color: #fde68a;
}

.migration-done__icon--review {
    background: linear-gradient(135deg, #f59e0b, #fbbf24);
}

.migration-action__text--warning {
    color: #92400e;
}

.migration-action__text--error {
    color: #991b1b;
}

/* ═══════════════════════════════════════════
   Migration — Terminée
   ═══════════════════════════════════════════ */

.migration-done {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 3rem 2rem;
    gap: 1.25rem;
}

.migration-done__icon {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: linear-gradient(135deg, #00AFAA, #36a9e1);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.migration-done__icon svg {
    width: 38px;
    height: 38px;
    stroke: #fff;
}

.migration-done__title {
    font-size: 1.6rem;
    font-weight: 700;
    color: #311EC1;
    margin: 0;
}

.migration-done__text {
    font-size: 1.05rem;
    color: #313130;
    line-height: 1.7;
    max-width: 520px;
}

.migration-done__sub {
    font-size: 0.88rem;
    color: #6b7280;
    line-height: 1.6;
    max-width: 480px;
}

/* ═══════════════════════════════════════════
   Dev toolbar (env=dev uniquement)
   ═══════════════════════════════════════════ */

.dev-toolbar {
    position: fixed;
    bottom: 4rem;
    right: 1rem;
    z-index: 9999;
}

.dev-toolbar__btn {
    background: #1f2937;
    color: #fbbf24;
    border: 1.5px solid #fbbf24;
    border-radius: 6px;
    padding: 0.4rem 0.85rem;
    font-size: 0.78rem;
    font-weight: 600;
    font-family: monospace;
    cursor: pointer;
    opacity: 0.85;
    transition: opacity 0.15s;
}

.dev-toolbar__btn:hover {
    opacity: 1;
}

/* ═══════════════════════════════════════════
   Badge Mangopay
   ═══════════════════════════════════════════ */

.mangopay-badge {
    display: flex;
    justify-content: center;
    padding: 0 1rem 1rem;
}

.mangopay-badge__logo {
    height: 40px;
    width: auto;
    filter: grayscale(100%);
    opacity: 0.55;
    transition: opacity 0.2s;
}

.mangopay-badge__logo:hover {
    opacity: 0.8;
}
