/* ===== JangaMarket — Connexion / Inscription (Neumorphism) ===== */

:root {
    --auth-bg: #F3F6FB;
    --auth-card: #EEF2F7;
    --auth-shadow-light: #FFFFFF;
    --auth-shadow-dark: #C9D3DF;
    --auth-green: #2E7D32;
    --auth-green-light: #43A047;
    --auth-orange: #F57C00;
    --auth-text: #1F2937;
    --auth-text-secondary: #6B7280;
}

.auth-body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--auth-bg);
    color: var(--auth-text);
    margin: 0;
}

.auth-shell {
    display: flex;
    min-height: 100vh;
}

/* Le verrouillage du scroll (page tenant dans un seul écran) ne s'applique
   qu'à partir du layout deux colonnes : sur mobile, la mise en page empilée
   doit pouvoir défiler normalement pour ne rien couper. */
@media (min-width: 992px) {
    html, body.auth-body {
        height: 100%;
        overflow: hidden;
    }
    .auth-shell {
        height: 100vh;
    }
}

/* ----- Colonne gauche : identité ----- */
.auth-brand-panel {
    flex: 0 0 46%;
    max-width: 46%;
    background: linear-gradient(155deg, #0f5132, var(--auth-green) 60%, var(--auth-green-light));
    color: #fff;
    padding: 3rem 3.5rem;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

.auth-brand-decor {
    position: absolute;
    border-radius: 50%;
    background: rgba(255,255,255,0.06);
    pointer-events: none;
}

.auth-brand-decor-1 {
    width: 340px;
    height: 340px;
    top: -120px;
    right: -100px;
}

.auth-brand-decor-2 {
    width: 220px;
    height: 220px;
    bottom: -80px;
    left: -60px;
    background: rgba(245,124,0,0.12);
}

.auth-brand-logo {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    text-decoration: none;
    color: #fff;
    font-size: 1.25rem;
    font-weight: 600;
    z-index: 1;
}

.auth-brand-logo img {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
    background: #fff;
}

.auth-brand-slogan {
    font-family: 'Poppins', 'Inter', sans-serif;
    font-size: 1.6rem;
    font-weight: 700;
    line-height: 1.3;
    margin: 2rem 0 0;
    max-width: 380px;
    z-index: 1;
}

.auth-brand-illustration {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    margin: 2rem 0;
    z-index: 1;
}

.auth-phone-mock {
    width: 220px;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.25);
    border-radius: 28px;
    padding: 0.9rem;
    backdrop-filter: blur(6px);
    animation: authFloat 5s ease-in-out infinite;
}

.auth-phone-notch {
    width: 50px;
    height: 5px;
    border-radius: 10px;
    background: rgba(255,255,255,0.35);
    margin: 0 auto 0.9rem;
}

.auth-phone-screen {
    background: #fff;
    border-radius: 16px;
    padding: 0.9rem;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.auth-phone-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.2rem;
}

.auth-phone-avatar {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--auth-green-light);
    flex-shrink: 0;
}

.auth-phone-line {
    display: block;
    height: 7px;
    border-radius: 4px;
    background: #e4e9ef;
}

.auth-phone-line-short { width: 70px; }
.auth-phone-line-tiny { width: 44px; margin-top: 5px; }

.auth-phone-card {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    background: var(--auth-bg);
    border-radius: 10px;
    padding: 0.55rem 0.6rem;
}

.auth-phone-card i {
    color: var(--auth-green);
    font-size: 1.1rem;
}

.auth-phone-map {
    background: var(--auth-green);
    border-radius: 10px;
    height: 54px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.3rem;
}

.auth-floating-badge {
    position: absolute;
    background: #fff;
    color: var(--auth-text);
    padding: 0.5rem 0.85rem;
    border-radius: 30px;
    font-size: 0.75rem;
    font-weight: 600;
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.auth-floating-badge i {
    color: var(--auth-orange);
}

.auth-floating-badge-1 {
    top: 10%;
    right: 4%;
    animation: authFloat 4s ease-in-out infinite .3s;
}

.auth-floating-badge-2 {
    bottom: 14%;
    left: 0;
    animation: authFloat 4.5s ease-in-out infinite .6s;
}

@keyframes authFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.auth-brand-text {
    color: rgba(255,255,255,0.85);
    font-size: 0.92rem;
    max-width: 380px;
    margin: 0;
    z-index: 1;
}

/* ----- Colonne droite : formulaire ----- */
.auth-form-panel {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.25rem 1.5rem;
}

@media (min-width: 992px) {
    .auth-form-panel {
        height: 100vh;
        overflow-y: auto;
    }
}

.auth-card {
    background: var(--auth-card);
    border-radius: 24px;
    width: 100%;
    max-width: 440px;
    padding: 1.75rem 2rem;
    box-shadow: 10px 10px 24px var(--auth-shadow-dark), -10px -10px 24px var(--auth-shadow-light);
    animation: authCardIn .5s ease both;
    margin: auto;
}

.auth-card-wide {
    max-width: 720px;
}

@keyframes authCardIn {
    from { opacity: 0; transform: translateY(18px); }
    to { opacity: 1; transform: translateY(0); }
}

.auth-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--auth-card);
    box-shadow: 6px 6px 14px var(--auth-shadow-dark), -6px -6px 14px var(--auth-shadow-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    color: var(--auth-green);
    margin: 0 auto 0.75rem;
}

.auth-card h1 {
    font-family: 'Poppins', 'Inter', sans-serif;
    font-size: 1.25rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 0.2rem;
}

.auth-card-subtitle {
    text-align: center;
    color: var(--auth-text-secondary);
    font-size: 0.85rem;
    margin-bottom: 1.1rem;
}

/* ----- Champs neumorphiques ----- */
.auth-field {
    margin-bottom: 0.7rem;
}

.auth-field label {
    display: block;
    font-size: 0.76rem;
    font-weight: 600;
    color: var(--auth-text-secondary);
    margin-bottom: 0.25rem;
}

.auth-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
    background: var(--auth-card);
    border-radius: 14px;
    box-shadow: inset 4px 4px 8px var(--auth-shadow-dark), inset -4px -4px 8px var(--auth-shadow-light);
    transition: box-shadow .2s;
}

.auth-input-wrap:focus-within {
    box-shadow: inset 3px 3px 6px var(--auth-shadow-dark), inset -3px -3px 6px var(--auth-shadow-light), 0 0 0 3px rgba(46,125,50,0.18);
}

.auth-input-wrap i.auth-input-icon {
    padding: 0 0.9rem;
    color: var(--auth-green);
    font-size: 1.05rem;
}

.auth-input-wrap input,
.auth-input-wrap select {
    border: none;
    background: transparent;
    outline: none;
    padding: 0.55rem 0.5rem 0.55rem 0;
    width: 100%;
    font-size: 0.9rem;
    color: var(--auth-text);
}

.auth-input-wrap .auth-toggle-password {
    background: none;
    border: none;
    color: var(--auth-text-secondary);
    padding: 0 0.9rem;
    cursor: pointer;
}

.auth-field-feedback {
    font-size: 0.78rem;
    margin-top: 0.35rem;
    display: none;
    align-items: center;
    gap: 0.3rem;
}

.auth-field-feedback.is-valid {
    display: flex;
    color: var(--auth-green);
}

.auth-field-feedback.is-invalid {
    display: flex;
    color: #dc3545;
}

.auth-input-wrap.is-valid {
    box-shadow: inset 3px 3px 6px var(--auth-shadow-dark), inset -3px -3px 6px var(--auth-shadow-light), 0 0 0 2px rgba(46,125,50,0.35);
}

.auth-input-wrap.is-invalid {
    box-shadow: inset 3px 3px 6px var(--auth-shadow-dark), inset -3px -3px 6px var(--auth-shadow-light), 0 0 0 2px rgba(220,53,69,0.35);
}

/* ----- Options ----- */
.auth-options {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.9rem;
    font-size: 0.8rem;
}

.auth-options a {
    color: var(--auth-green);
    text-decoration: none;
    font-weight: 600;
}

.auth-options a:hover {
    text-decoration: underline;
}

.auth-checkbox {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--auth-text-secondary);
}

/* ----- Bouton principal ----- */
.auth-btn-primary {
    width: 100%;
    background: linear-gradient(135deg, var(--auth-green-light), var(--auth-green));
    color: #fff;
    border: none;
    border-radius: 14px;
    padding: 0.65rem;
    font-weight: 700;
    font-size: 0.95rem;
    box-shadow: 0 10px 20px rgba(46,125,50,0.28);
    transition: transform .15s, box-shadow .15s;
}

.auth-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 26px rgba(46,125,50,0.32);
    color: #fff;
}

.auth-btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 6px 12px rgba(46,125,50,0.28);
}

/* ----- Séparateur ----- */
.auth-divider {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 0.9rem 0;
    color: var(--auth-text-secondary);
    font-size: 0.8rem;
}

.auth-divider::before,
.auth-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--auth-shadow-dark);
}

/* ----- Connexion sociale ----- */
.auth-social {
    display: flex;
    gap: 0.6rem;
    margin-bottom: 0.9rem;
}

.auth-social-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    background: var(--auth-card);
    border: none;
    border-radius: 12px;
    padding: 0.5rem;
    box-shadow: 4px 4px 10px var(--auth-shadow-dark), -4px -4px 10px var(--auth-shadow-light);
    color: var(--auth-text-secondary);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: not-allowed;
    opacity: 0.65;
    position: relative;
}

.auth-social-btn[title]:hover::after {
    content: attr(title);
    position: absolute;
    bottom: 115%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--auth-text);
    color: #fff;
    font-size: 0.68rem;
    padding: 0.3rem 0.55rem;
    border-radius: 6px;
    white-space: nowrap;
}

/* ----- Bas de carte ----- */
.auth-switch {
    text-align: center;
    font-size: 0.9rem;
    color: var(--auth-text-secondary);
    margin: 20px 0 0;
}

.auth-switch a {
    color: var(--auth-green);
    font-weight: 700;
    text-decoration: none;
}

.auth-switch a:hover {
    text-decoration: underline;
}

.auth-footer-note {
    text-align: center;
    margin-top: 0.9rem;
    font-size: 0.72rem;
    color: var(--auth-text-secondary);
}

.auth-footer-note a {
    color: var(--auth-text-secondary);
    text-decoration: underline;
}

/* ----- Alerte ----- */
.auth-alert {
    border-radius: 12px;
    padding: 0.75rem 1rem;
    font-size: 0.85rem;
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.auth-alert-danger {
    background: rgba(220,53,69,0.1);
    color: #b02a37;
}

.auth-alert-warning {
    background: rgba(245,124,0,0.12);
    color: #a35300;
}

.auth-alert-success {
    background: rgba(46,125,50,0.12);
    color: var(--auth-green);
}

/* ----- Type de compte (radio cards) ----- */
.auth-role-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.6rem;
    margin-bottom: 0.75rem;
}

.auth-role-card {
    position: relative;
}

.auth-role-card input {
    position: absolute;
    opacity: 0;
    inset: 0;
    margin: 0;
    cursor: pointer;
}

.auth-role-card label {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    text-align: center;
    background: var(--auth-card);
    border-radius: 12px;
    padding: 0.55rem 0.5rem;
    box-shadow: 4px 4px 10px var(--auth-shadow-dark), -4px -4px 10px var(--auth-shadow-light);
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--auth-text-secondary);
    cursor: pointer;
    transition: box-shadow .15s, color .15s;
}

.auth-role-card label i {
    font-size: 1.05rem;
    color: var(--auth-text-secondary);
}

.auth-role-card input:checked + label {
    color: var(--auth-green);
    box-shadow: inset 3px 3px 6px var(--auth-shadow-dark), inset -3px -3px 6px var(--auth-shadow-light), 0 0 0 2px var(--auth-green);
}

.auth-role-card input:checked + label i {
    color: var(--auth-green);
}

/* ----- Champs commerçant dynamiques ----- */
.auth-merchant-fields {
    display: none;
    border-top: 1px dashed var(--auth-shadow-dark);
    padding-top: 0.7rem;
    margin-top: 0.2rem;
    animation: authCardIn .35s ease both;
}

.auth-merchant-fields.is-visible {
    display: block;
}

.auth-section-label {
    font-size: 0.74rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--auth-green);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

/* ----- Géolocalisation ----- */
.auth-location-box {
    background: var(--auth-card);
    border-radius: 14px;
    padding: 0.75rem 0.85rem;
    box-shadow: inset 3px 3px 6px var(--auth-shadow-dark), inset -3px -3px 6px var(--auth-shadow-light);
    margin-bottom: 0.75rem;
}

.auth-location-status {
    font-size: 0.78rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-bottom: 0.5rem;
}

.auth-location-status.is-pending { color: var(--auth-orange); }
.auth-location-status.is-success { color: var(--auth-green); }
.auth-location-status.is-error { color: #dc3545; }

.auth-location-results {
    max-height: 150px;
    overflow-y: auto;
}

.auth-location-results button {
    display: block;
    width: 100%;
    text-align: left;
    background: #fff;
    border: none;
    border-bottom: 1px solid #eef1ee;
    padding: 0.5rem 0.6rem;
    font-size: 0.78rem;
    color: var(--auth-text);
}

.auth-location-results button:hover {
    background: var(--auth-bg);
}

/* ----- Responsive ----- */
@media (max-width: 1200px) {
    .auth-brand-panel {
        flex: 0 0 40%;
        max-width: 40%;
        padding: 2.5rem;
    }
}

@media (max-width: 991px) {
    .auth-shell {
        flex-direction: column;
    }
    .auth-brand-panel {
        flex: none;
        max-width: 100%;
        padding: 2rem 1.5rem;
        min-height: 260px;
    }
    .auth-brand-illustration {
        display: none;
    }
    .auth-brand-slogan {
        font-size: 1.3rem;
        margin-top: 1rem;
    }
    .auth-form-panel {
        padding: 2rem 1rem 3rem;
    }
}

@media (max-width: 480px) {
    .auth-card {
        padding: 1.75rem 1.35rem;
        border-radius: 18px;
    }
    .auth-role-group {
        grid-template-columns: 1fr;
    }
}
