:root {
    --primary: #F68B1E;
    --primary-hover: #E07D18;
    --primary-light: #FFF5E6;
    --text-dark: #282828;
    --text-medium: #555555;
    --text-light: #757575;
    --border: #C7C7CD;
    --border-light: #E8E8E8;
    --bg-page: #F5F5F5;
    --bg-white: #FFFFFF;
    --error: #E62E2E;
    --success: #1E8E3E;
    --facebook: #3B5998;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-page);
    color: var(--text-dark);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ===== HEADER ===== */
.top-bar {
    background: var(--bg-white);
    border-bottom: 1px solid var(--border-light);
    padding: 12px 0;
}

.top-bar-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.brand-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}

.brand-logo img {
    height: 40px;
    width: auto;
}

.brand-logo span {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-dark);
    letter-spacing: -0.5px;
}

.brand-logo span em {
    color: var(--primary);
    font-style: normal;
}

.header-help {
    font-size: 0.85rem;
    color: var(--text-medium);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: color 0.2s;
}

.header-help:hover {
    color: var(--primary);
}

/* ===== HERO MESSAGE ===== */
.hero-banner {
    text-align: center;
    padding: 35px 20px 20px;
    background: var(--bg-white);
}

.hero-banner h2 {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 6px;
}

.hero-banner p {
    font-size: 0.9rem;
    color: var(--text-light);
    margin-bottom: 15px;
}

.service-icons {
    display: flex;
    justify-content: center;
    gap: 18px;
    flex-wrap: wrap;
}

.service-icons i {
    font-size: 1.5rem;
    color: var(--primary);
    opacity: 0.8;
}

/* ============================================================
   MAIN CONTENT - CARTE CENTRÉE (sans partie blanche à droite)
   ============================================================ */
.main-wrapper {
    flex: 1;
    max-width: 780px;
    margin: 0 auto;
    padding: 40px 20px 60px;
    width: 100%;
    display: flex;
    align-items: center;
    min-height: calc(100vh - 180px);
}

/* 🔧 FIX : empêche toute grille externe de créer une colonne vide */
.auth-grid {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.auth-card {
    width: 100%;
    background: var(--bg-white);
    border: 1px solid var(--border-light);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
}

.auth-panel {
    width: 100%;
    background: var(--bg-white);
    border: 1px solid var(--border-light);
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
    overflow: hidden;
    padding: 40px 45px;
}

.panel-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 28px;
    padding-bottom: 14px;
    border-bottom: 3px solid var(--primary);
    display: inline-block;
}

/* ===== FORM ELEMENTS ===== */
.form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-medium);
    margin-bottom: 6px;
}

.form-group label .req {
    color: var(--error);
}

.form-control-custom {
    width: 100%;
    padding: 12px 14px;
    font-size: 0.95rem;
    border: 1px solid var(--border);
    border-radius: 3px;
    background: var(--bg-white);
    color: var(--text-dark);
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
}

.form-control-custom:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(246, 139, 30, 0.15);
}

.form-control-custom::placeholder {
    color: #aaa;
}

.password-wrap {
    position: relative;
}

.password-wrap .form-control-custom {
    padding-right: 45px;
}

.toggle-pwd {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-light);
    cursor: pointer;
    font-size: 1rem;
    padding: 4px;
}

.toggle-pwd:hover {
    color: var(--primary);
}

/* ===== CHECKBOX ===== */
.check-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 12px 0;
}

.check-row input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--primary);
    cursor: pointer;
}

.check-row label {
    font-size: 0.85rem;
    color: var(--text-medium);
    cursor: pointer;
    user-select: none;
}

/* ===== BUTTONS ===== */
.btn-main {
    display: block;
    width: 100%;
    padding: 14px;
    font-size: 0.95rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    color: #fff;
    background: var(--primary);
    border: none;
    border-radius: 3px;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    text-align: center;
    text-decoration: none;
}

.btn-main:hover {
    background: var(--primary-hover);
}

.btn-main:active {
    transform: translateY(1px);
}

.btn-main:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-social {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 12px;
    font-size: 0.9rem;
    font-weight: 500;
    color: #fff;
    background: var(--facebook);
    border: none;
    border-radius: 3px;
    cursor: pointer;
    transition: opacity 0.2s;
    margin-top: 12px;
}

.btn-social:hover {
    opacity: 0.9;
}

.btn-google-custom {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 12px;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-dark);
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: 3px;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
    margin-top: 10px;
}

.btn-google-custom:hover {
    background: #f9f9f9;
    border-color: var(--text-light);
}

.btn-outline-custom {
    display: block;
    width: 100%;
    padding: 12px;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-medium);
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: 3px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
    text-decoration: none;
    margin-top: 10px;
}

.btn-outline-custom:hover {
    border-color: var(--primary);
    color: var(--primary);
}

/* ===== LINKS ===== */
.link-text {
    font-size: 0.85rem;
    color: var(--text-light);
    text-decoration: none;
    transition: color 0.2s;
}

.link-text:hover {
    color: var(--primary);
    text-decoration: underline;
}

.forgot-link {
    display: block;
    text-align: right;
    font-size: 0.8rem;
    color: var(--text-light);
    text-decoration: none;
    margin-top: -10px;
    margin-bottom: 15px;
    transition: color 0.2s;
}

.forgot-link:hover {
    color: var(--primary);
    text-decoration: underline;
}

/* ===== DIVIDER ===== */
.divider-line {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 18px 0;
    color: var(--text-light);
    font-size: 0.8rem;
}

.divider-line::before,
.divider-line::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-light);
}

/* ===== EMAIL DISPLAY ===== */
.email-chip {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: var(--primary-light);
    border: 1px solid rgba(246, 139, 30, 0.2);
    border-radius: 3px;
    margin-bottom: 18px;
    font-size: 0.9rem;
}

.email-chip span {
    font-weight: 500;
    color: var(--text-dark);
    word-break: break-all;
}

.email-chip button {
    background: none;
    border: none;
    color: var(--primary);
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    margin-left: 10px;
}

.email-chip button:hover {
    text-decoration: underline;
}

/* ===== STEP INDICATOR ===== */
.step-tracker {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 25px;
}

.step-dot {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    background: var(--border-light);
    color: var(--text-light);
    transition: all 0.3s;
}

.step-dot.active {
    background: var(--primary);
    color: #fff;
}

.step-dot.done {
    background: var(--success);
    color: #fff;
}

.step-line {
    width: 30px;
    height: 2px;
    background: var(--border-light);
    transition: background 0.3s;
}

.step-line.active {
    background: var(--primary);
}

.step-labels {
    display: flex;
    justify-content: center;
    gap: 28px;
    margin-top: 4px;
    margin-bottom: 20px;
}

.step-labels span {
    font-size: 0.7rem;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ===== VENDOR SECTION ===== */
.vendor-box {
    margin-top: 25px;
    padding: 20px;
    background: linear-gradient(135deg, #FFF9F0 0%, #FFF5E6 100%);
    border: 1px solid rgba(246, 139, 30, 0.15);
    border-radius: 4px;
    text-align: center;
}

.vendor-box h4 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.vendor-box h4 i {
    color: var(--primary);
}

.vendor-box p {
    font-size: 0.8rem;
    color: var(--text-light);
    margin-bottom: 15px;
}

.vendor-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.vendor-actions .btn-main {
    flex: 1;
    min-width: 140px;
    font-size: 0.85rem;
    padding: 11px;
}

.vendor-actions .btn-outline-custom {
    flex: 1;
    min-width: 140px;
    font-size: 0.85rem;
    padding: 11px;
    margin-top: 0;
}

/* ===== NEW CUSTOMER PANEL ===== */
.new-customer-text {
    font-size: 0.9rem;
    color: var(--text-medium);
    line-height: 1.6;
    margin-bottom: 25px;
}

.new-customer-text ul {
    list-style: none;
    padding: 0;
    margin: 15px 0 0;
}

.new-customer-text ul li {
    padding: 6px 0;
    font-size: 0.85rem;
    color: var(--text-light);
    display: flex;
    align-items: center;
    gap: 8px;
}

.new-customer-text ul li i {
    color: var(--primary);
    font-size: 0.8rem;
}

/* ===== LOADING STATE ===== */
.loading-state {
    text-align: center;
    padding: 50px 20px;
}

.spinner-ring {
    width: 45px;
    height: 45px;
    border: 3px solid var(--border-light);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 15px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-state p {
    color: var(--text-light);
    font-size: 0.9rem;
}

/* ============================================================
   TOAST / NOTIFICATION
   ============================================================ */
.toast-wrap {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999999;
    max-width: 90%;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.toast-custom {
    display: none;
    opacity: 1 !important;
    background-color: #ffffff !important;
    background: #ffffff !important;
    border: 1px solid var(--border-light);
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18);
    padding: 16px 20px;
    min-width: 300px;
    max-width: 420px;
    align-items: flex-start;
    gap: 14px;
    transition: opacity 0.3s ease, transform 0.3s ease;
    position: relative;
}

.toast-custom.hide {
    opacity: 0;
    transform: translateX(50px);
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* ===== COULEURS DES TOASTS ===== */
.toast-custom.error {
    border-left: 4px solid #E62E2E;
    background: #ffffff !important;
}

.toast-custom.error > i {
    color: #E62E2E;
}
.toast-custom.show {
    display: flex !important;
    animation: slideIn 0.35s ease;
}
.toast-custom.success {
    border-left: 4px solid #1E8E3E;
    background: #ffffff !important;
}

.toast-custom.success > i {
    color: #1E8E3E;
}

.toast-custom.info {
    border-left: 4px solid #F68B1E;
    background: #ffffff !important;
}

.toast-custom.info > i {
    color: #F68B1E;
}

.toast-custom.warning {
    border-left: 4px solid #f59e0b;
    background: #ffffff !important;
}

.toast-custom.warning > i {
    color: #f59e0b;
}

/* ===== ICÔNE ===== */
.toast-custom > i {
    font-size: 1.3rem;
    margin-top: 2px;
    flex-shrink: 0;
    width: 28px;
    text-align: center;
}

/* ===== CORPS DU TOAST ===== */
.toast-custom .toast-body {
    flex: 1;
    min-width: 0;
    padding-right: 10px;
}

.toast-custom .toast-title {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-dark);
    margin-bottom: 3px;
}

.toast-custom .toast-msg {
    font-size: 0.85rem;
    color: var(--text-light);
    word-wrap: break-word;
    line-height: 1.5;
}

/* ===== BOUTON FERMER ===== */
.toast-custom .toast-close {
    background: rgba(0, 0, 0, 0.04);
    border: none;
    color: #666;
    cursor: pointer;
    font-size: 1rem;
    padding: 6px;
    flex-shrink: 0;
    border-radius: 50%;
    transition: all 0.25s ease;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: -8px;
    margin-right: -8px;
    align-self: flex-start;
}

.toast-custom .toast-close:hover {
    background: rgba(0, 0, 0, 0.10);
    color: var(--text-dark);
    transform: rotate(90deg);
}

.toast-custom .toast-close:active {
    transform: scale(0.90) rotate(90deg);
}

/* ============================================================
   HIDE/SHOW STEPS
   ============================================================ */
.step-content {
    display: none;
}

.step-content.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ===== CAPTCHA ===== */
.captcha-box {
    margin-bottom: 18px;
    display: flex;
    justify-content: center;
}

.captcha-box > div {
    transform: scale(0.85);
    transform-origin: center;
}

/* ===== REQUIRED NOTE ===== */
.required-note {
    font-size: 0.8rem;
    color: var(--text-light);
    margin-top: 15px;
}

.required-note .req {
    color: var(--error);
}

/* ===== FOOTER ===== */
.page-footer {
    text-align: center;
    padding: 20px;
    font-size: 0.8rem;
    color: var(--text-light);
    border-top: 1px solid var(--border-light);
    background: var(--bg-white);
    margin-top: auto;
}

/* ============================================================
   RESPONSIVE — MOBILE : pleine largeur, sans padding
   (une seule série de media queries, les doublons de l'original
   ont été fusionnés ici)
   ============================================================ */
@media (max-width: 768px) {
    .main-wrapper {
        padding: 10px;
        margin: 0;
        max-width: 100%;
        min-height: auto;
    }

    .auth-panel {
        width: 100%;
        padding: 0;
        border: none;
        border-radius: 0;
        box-shadow: none;
    }

    /* Le contenu interne garde un minimum d'air horizontal pour rester
       lisible (labels/inputs collés au bord de l'écran sinon) ; c'est
       le seul padding restant, mis directement sur le contenu plutôt
       que sur le conteneur. Mets à 0 si tu veux vraiment zéro espace. */
    .panel-title,
    .step-tracker,
    .step-labels,
    .captcha-box,
    #stepEmail,
    #stepPassword,
    #stepRegister,
    #stepSuccess,
    #stepLogin,
    .required-note {
        padding-left: 0;
        padding-right: 0;
    }

    .step-labels {
        gap: 14px;
    }
    .step-labels span {
        font-size: 0.6rem;
    }
    .step-line {
        width: 20px;
    }
    .vendor-actions {
        flex-direction: column;
    }
    .vendor-actions .btn-main,
    .vendor-actions .btn-outline-custom {
        min-width: auto;
        width: 100%;
    }
    .brand-logo span {
        font-size: 1.1rem;
    }
    .brand-logo img {
        height: 32px;
    }
    .hero-banner h2 {
        font-size: 1.1rem;
    }

    .captcha-box > div {
        transform: scale(0.85);
    }
}

@media (max-width: 576px) {
    .toast-wrap {
        top: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
    }
    .toast-custom {
        min-width: auto;
        max-width: 100%;
        padding: 14px 16px;
    }
    .toast-custom .toast-title {
        font-size: 0.9rem;
    }
    .toast-custom .toast-msg {
        font-size: 0.82rem;
    }
}

@media (max-width: 480px) {
    .top-bar-inner {
        padding: 0 12px;
    }
    .hero-banner {
        padding: 20px 12px 15px;
    }
    .panel-title {
        font-size: 1rem;
    }
    .captcha-box > div {
        transform: scale(0.7);
    }
}

/* ============================================================
   IMPRESSION
   ============================================================ */
@media print {
    .top-bar {
        display: none !important;
    }
    .page-footer {
        display: none !important;
    }
    .toast-wrap {
        display: none !important;
    }
}