/**
 * Interfaces d'authentification — Marketing Platform (refonte)
 * Colonne marque + carte formulaire, thème noir / or / blanc
 */

/* ------------------------------------------------------------------------- */
/* Page shell                                                                 */
/* ------------------------------------------------------------------------- */

body.auth-page {
    margin: 0;
    min-height: 100vh;
    min-height: 100dvh;
    background: #060606;
    color: #f4f4f5;
    font-family: var(--font-family-primary, system-ui, sans-serif);
}

body.auth-page #main-content {
    min-height: 100vh;
    min-height: 100dvh;
}

body.auth-page .messages-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    left: 1rem;
    z-index: 1080;
    max-width: 420px;
    margin-left: auto;
    pointer-events: none;
}

body.auth-page .messages-container .alert {
    pointer-events: auto;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
    border: none;
    border-radius: 12px;
}

/* ------------------------------------------------------------------------- */
/* Grille : marque | contenu                                                  */
/* ------------------------------------------------------------------------- */

.auth-shell {
    display: grid;
    min-height: 100vh;
    min-height: 100dvh;
    grid-template-columns: 1fr;
    position: relative;
    overflow-x: hidden;
}

.auth-shell::before {
    content: "";
    position: fixed;
    inset: 0;
    background:
        radial-gradient(ellipse 80% 50% at 50% -20%, rgba(212, 175, 55, 0.18), transparent),
        radial-gradient(ellipse 60% 40% at 100% 100%, rgba(212, 175, 55, 0.08), transparent),
        radial-gradient(ellipse 50% 30% at 0% 80%, rgba(255, 255, 255, 0.04), transparent);
    pointer-events: none;
    z-index: 0;
}

.auth-shell--home {
    grid-template-columns: 1fr;
}

@media (min-width: 992px) {
    .auth-shell {
        grid-template-columns: minmax(280px, 1fr) minmax(420px, 520px);
    }

    .auth-shell--home {
        grid-template-columns: minmax(280px, 1fr) minmax(480px, 680px);
    }
}

/* ------------------------------------------------------------------------- */
/* Colonne marque                                                             */
/* ------------------------------------------------------------------------- */

.auth-brand {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1.75rem 1.5rem;
    background: linear-gradient(165deg, #0c0c0e 0%, #080809 45%, #111113 100%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    z-index: 1;
}

@media (min-width: 992px) {
    .auth-brand {
        border-bottom: none;
        border-right: 1px solid rgba(255, 255, 255, 0.06);
        padding: 3rem 2.5rem;
        min-height: 100vh;
        min-height: 100dvh;
    }
}

.auth-brand-glow {
    position: absolute;
    width: 280px;
    height: 280px;
    top: 10%;
    left: 50%;
    transform: translateX(-50%);
    background: radial-gradient(circle, rgba(212, 175, 55, 0.12) 0%, transparent 70%);
    pointer-events: none;
}

.auth-brand-inner {
    position: relative;
    max-width: 22rem;
    text-align: center;
}

@media (min-width: 992px) {
    .auth-brand-inner {
        text-align: left;
    }
}

.auth-brand-mark {
    margin-bottom: 1.25rem;
    display: flex;
    justify-content: center;
}

@media (min-width: 992px) {
    .auth-brand-mark {
        justify-content: flex-start;
    }
}

.auth-brand-mark-icon {
    width: 4.5rem;
    height: 4.5rem;
    border-radius: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    color: #0a0a0a;
    background: linear-gradient(145deg, #e8c547 0%, var(--color-accent, #d4af37) 50%, #a67c00 100%);
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.25) inset,
        0 12px 40px rgba(212, 175, 55, 0.35);
}

.auth-brand-title {
    font-family: var(--font-family-heading, "Poppins", sans-serif);
    font-size: clamp(1.5rem, 3vw, 1.85rem);
    font-weight: 700;
    letter-spacing: -0.03em;
    color: #fafafa;
    margin: 0 0 0.35rem;
    line-height: 1.2;
}

.auth-brand-tagline {
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: rgba(212, 175, 55, 0.9);
    margin: 0 0 1.75rem;
}

.auth-brand-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    text-align: left;
}

.auth-brand-list li {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    font-size: 0.9rem;
    line-height: 1.45;
    color: rgba(228, 228, 231, 0.88);
}

.auth-brand-list i {
    flex-shrink: 0;
    width: 2rem;
    height: 2rem;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    color: var(--color-accent, #d4af37);
    background: rgba(212, 175, 55, 0.1);
    border: 1px solid rgba(212, 175, 55, 0.2);
    margin-top: 0.1rem;
}

/* ------------------------------------------------------------------------- */
/* Zone carte                                                                 */
/* ------------------------------------------------------------------------- */

.auth-main {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem 1.25rem 2rem;
    background: rgba(0, 0, 0, 0.2);
}

@media (min-width: 992px) {
    .auth-main {
        padding: 2.5rem 2rem;
    }
}

.auth-card {
    width: 100%;
    max-width: 420px;
    background: #ffffff;
    color: #0a0a0a;
    border-radius: 1.25rem;
    padding: 2rem 1.75rem 1.75rem;
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.6) inset,
        0 24px 64px rgba(0, 0, 0, 0.45),
        0 0 0 1px rgba(255, 255, 255, 0.08);
    animation: auth-card-in 0.55s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.auth-card--wide {
    max-width: 640px;
}

@keyframes auth-card-in {
    from {
        opacity: 0;
        transform: translateY(16px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.auth-card-head {
    margin-bottom: 1.5rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid #ececee;
}

.auth-card-eyebrow {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    color: var(--color-accent, #b8962e);
    margin: 0 0 0.4rem;
}

.auth-card-title {
    font-family: var(--font-family-heading, "Poppins", sans-serif);
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: #0a0a0a;
    margin: 0;
    line-height: 1.25;
}

.auth-card-sub {
    font-size: 0.9rem;
    color: #52525b;
    margin: 0.5rem 0 0;
    line-height: 1.5;
}

/* ------------------------------------------------------------------------- */
/* Formulaires                                                                */
/* ------------------------------------------------------------------------- */

.auth-form .auth-field {
    margin-bottom: 1.25rem;
}

.auth-form .auth-label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: #3f3f46;
    margin-bottom: 0.45rem;
}

.auth-form .auth-label i {
    color: var(--color-accent, #b8962e);
    margin-right: 0.35rem;
    width: 1rem;
    text-align: center;
}

.auth-input-wrap {
    position: relative;
}

.auth-input-wrap .auth-input-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #a1a1aa;
    font-size: 0.95rem;
    pointer-events: none;
    z-index: 2;
}

.auth-input,
.auth-form .form-control.auth-input {
    width: 100%;
    height: 3rem;
    padding: 0 1rem;
    font-size: 0.95rem;
    border: 1px solid #e4e4e7;
    border-radius: 0.65rem;
    background: #fafafa;
    color: #18181b;
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.auth-input-wrap .auth-input,
.auth-input-wrap .form-control.auth-input {
    padding-left: 2.65rem;
}

.auth-input:focus,
.auth-form .form-control.auth-input:focus {
    outline: none;
    border-color: rgba(212, 175, 55, 0.65);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.18);
}

.auth-form .text-danger.small {
    margin-top: 0.35rem;
    font-size: 0.8rem;
}

.auth-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

.auth-check {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: #52525b;
    cursor: pointer;
    user-select: none;
}

.auth-check input {
    width: 1rem;
    height: 1rem;
    accent-color: var(--color-accent, #d4af37);
    border-radius: 4px;
}

.auth-link {
    font-size: 0.875rem;
    font-weight: 600;
    color: #a67c00;
    text-decoration: none;
    transition: color 0.2s;
}

.auth-link:hover {
    color: #7c5e00;
    text-decoration: underline;
}

/* Boutons */
.auth-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    min-height: 3rem;
    padding: 0 1.25rem;
    font-size: 0.95rem;
    font-weight: 600;
    border: none;
    border-radius: 0.65rem;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s, background 0.2s;
}

.auth-btn-primary {
    background: linear-gradient(180deg, #1a1a1a 0%, #0a0a0a 100%);
    color: #fafafa;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
}

.auth-btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    color: #fff;
}

.auth-btn-secondary {
    background: transparent;
    color: #3f3f46;
    border: 1px solid #d4d4d8;
    width: auto;
    min-width: 100%;
}

.auth-btn-secondary:hover {
    background: #f4f4f5;
    border-color: #a1a1aa;
    color: #18181b;
}

.auth-footer {
    margin-top: 1.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid #ececee;
    text-align: center;
    font-size: 0.8rem;
    color: #71717a;
}

.auth-footer i {
    color: var(--color-accent, #b8962e);
    margin-right: 0.25rem;
}

/* Alertes dans la carte */
.auth-alert {
    border-radius: 0.65rem;
    padding: 0.85rem 1rem;
    font-size: 0.875rem;
    margin-bottom: 1.25rem;
    border: 1px solid transparent;
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
}

.auth-alert i {
    margin-top: 0.15rem;
    flex-shrink: 0;
}

.auth-alert--danger {
    background: #fef2f2;
    border-color: #fecaca;
    color: #991b1b;
}

.auth-alert--warning {
    background: #fffbeb;
    border-color: #fde68a;
    color: #92400e;
}

.auth-alert--success {
    background: #f0fdf4;
    border-color: #bbf7d0;
    color: #166534;
}

.auth-actions-stack {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    align-items: stretch;
    margin-top: 0.5rem;
}

/* ------------------------------------------------------------------------- */
/* Accueil (landing) dans la carte                                            */
/* ------------------------------------------------------------------------- */

.auth-home-lead {
    font-size: 0.95rem;
    color: #52525b;
    line-height: 1.65;
    margin: 0 0 1.5rem;
}

.auth-home-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.85rem;
    margin-bottom: 1.25rem;
}

@media (min-width: 576px) {
    .auth-home-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1200px) {
    .auth-shell--home .auth-home-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

.auth-home-tile {
    padding: 1.1rem 1rem;
    border-radius: 0.75rem;
    background: linear-gradient(180deg, #fafafa 0%, #fff 100%);
    border: 1px solid #ececee;
    transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}

.auth-home-tile:hover {
    border-color: rgba(212, 175, 55, 0.35);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
    transform: translateY(-2px);
}

.auth-home-tile-icon {
    width: 2.35rem;
    height: 2.35rem;
    border-radius: 0.55rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    color: #0a0a0a;
    background: linear-gradient(145deg, #e8c547 0%, var(--color-accent, #d4af37) 100%);
    margin-bottom: 0.65rem;
    box-shadow: 0 4px 12px rgba(212, 175, 55, 0.25);
}

.auth-home-tile h3 {
    font-family: var(--font-family-heading, "Poppins", sans-serif);
    font-size: 0.95rem;
    font-weight: 700;
    margin: 0 0 0.35rem;
    color: #18181b;
}

.auth-home-tile p {
    font-size: 0.8rem;
    color: #71717a;
    margin: 0;
    line-height: 1.5;
}

.auth-home-cta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: center;
}

.auth-home-cta .auth-btn {
    width: auto;
    min-width: 220px;
}

/* Page accueil : défilement si besoin */
body.auth-page.auth-page--scroll {
    overflow-y: auto;
}

body.auth-page.auth-page--scroll .auth-shell,
body.auth-page.auth-page--scroll .auth-brand {
    min-height: auto;
}

@media (min-width: 992px) {
    body.auth-page.auth-page--scroll .auth-brand {
        min-height: 100vh;
        min-height: 100dvh;
    }
}

/* ------------------------------------------------------------------------- */
/* Responsive                                                                 */
/* ------------------------------------------------------------------------- */

@media (max-width: 991px) {
    .auth-card {
        padding: 1.65rem 1.35rem 1.5rem;
    }
}

@media (max-width: 480px) {
    .auth-brand-mark-icon {
        width: 4rem;
        height: 4rem;
        font-size: 1.5rem;
    }

    .auth-card-title {
        font-size: 1.35rem;
    }
}
