/**
 * Auth — Nexoria Hub
 * Composition sombre unifiée, marque en héros, formulaire épuré
 */

/* -------------------------------------------------------------------------
   Base
------------------------------------------------------------------------- */

html:has(body.auth-page--login),
body.auth-page--login {
    height: 100%;
    overflow: hidden;
}

body.auth-page {
    margin: 0;
    min-height: 100vh;
    min-height: 100dvh;
    overflow-x: hidden;
    background: #070A12;
    color: #E8EEF7;
    font-family: var(--font-family-primary, "Inter", system-ui, sans-serif);
    font-size: 16px;
}

body.auth-page--login {
    height: 100dvh;
    max-height: 100dvh;
    min-height: 0;
    overflow: hidden;
}

body.auth-page #main-content {
    display: block;
    min-height: 100vh;
    min-height: 100dvh;
    width: 100%;
    max-width: 100%;
    padding: 0 !important;
    margin: 0 !important;
    overflow-x: hidden;
    box-sizing: border-box;
}

body.auth-page--login #main-content {
    height: 100dvh;
    max-height: 100dvh;
    min-height: 0;
    overflow: hidden;
}

/* -------------------------------------------------------------------------
   Login — plein écran, centré, sans scroll
------------------------------------------------------------------------- */

.auth-login {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100dvh;
    max-height: 100dvh;
    padding: 1rem;
    box-sizing: border-box;
    overflow: hidden;
}

.auth-login-bg {
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        radial-gradient(ellipse 60% 50% at 50% 0%, rgba(27, 60, 255, 0.22), transparent 60%),
        radial-gradient(ellipse 40% 35% at 80% 100%, rgba(27, 60, 255, 0.1), transparent 55%),
        #070A12;
}

.auth-login-box {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 380px;
    max-height: calc(100dvh - 2rem);
    overflow: auto;
    padding: 1.75rem 1.5rem;
    border-radius: 1rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
    box-sizing: border-box;
}

.auth-login-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.65rem;
    text-decoration: none;
    color: #FAFBFF;
    margin-bottom: 1.35rem;
}

.auth-login-brand img {
    width: 2.35rem;
    height: 2.35rem;
    display: block;
    border-radius: 0.55rem;
}

.auth-login-brand span {
    font-family: var(--font-family-heading, "Space Grotesk", sans-serif);
    font-size: 1.45rem;
    font-weight: 700;
    letter-spacing: -0.04em;
    line-height: 1;
}

.auth-login-title {
    font-family: var(--font-family-heading, "Space Grotesk", sans-serif);
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    color: #FAFBFF;
    text-align: center;
    margin: 0 0 0.25rem;
    line-height: 1.2;
}

.auth-login-sub {
    text-align: center;
    font-size: 0.875rem;
    color: rgba(232, 238, 247, 0.55);
    margin: 0 0 1.35rem;
    line-height: 1.4;
}

body.auth-page--login .auth-form .auth-field {
    margin-bottom: 0.95rem;
}

body.auth-page--login .auth-check {
    margin: 0.1rem 0 1.1rem;
}

body.auth-page--login .auth-panel-head,
body.auth-page--login .auth-fineprint {
    display: none;
}

@media (max-height: 700px) {
    .auth-login-box {
        padding: 1.25rem 1.25rem;
    }

    .auth-login-brand {
        margin-bottom: 0.85rem;
    }

    .auth-login-sub {
        margin-bottom: 1rem;
    }

    body.auth-page--login .auth-input,
    body.auth-page--login .auth-form .form-control.auth-input {
        height: 2.65rem;
        min-height: 2.65rem;
    }

    body.auth-page--login .auth-btn {
        min-height: 2.65rem;
    }
}

body.auth-page .messages-container {
    position: fixed;
    top: 1.25rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1080;
    width: min(400px, calc(100% - 2rem));
    margin: 0;
    pointer-events: none;
}

body.auth-page .messages-container .alert {
    pointer-events: auto;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
    background: rgba(15, 20, 36, 0.95);
    color: #E8EEF7;
    backdrop-filter: blur(8px);
}

/* -------------------------------------------------------------------------
   Shell
------------------------------------------------------------------------- */

.auth-shell {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
    min-height: 100vh;
    min-height: 100dvh;
    position: relative;
    overflow: hidden;
}

.auth-shell::before {
    content: "";
    position: fixed;
    inset: 0;
    background:
        radial-gradient(ellipse 70% 55% at 15% 40%, rgba(27, 60, 255, 0.18), transparent 60%),
        radial-gradient(ellipse 50% 40% at 90% 80%, rgba(27, 60, 255, 0.08), transparent 55%),
        linear-gradient(180deg, #070A12 0%, #0B0F1A 100%);
    pointer-events: none;
    z-index: 0;
}

@media (min-width: 960px) {
    .auth-shell {
        grid-template-columns: minmax(280px, 1.05fr) minmax(320px, 0.95fr);
    }

    .auth-shell--home {
        grid-template-columns: minmax(280px, 1fr) minmax(360px, 1.1fr);
        max-width: 1180px;
        margin: 0 auto;
    }
}

/* -------------------------------------------------------------------------
   Brand panel
------------------------------------------------------------------------- */

.auth-brand {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2.5rem 1.5rem 1.25rem;
    box-sizing: border-box;
}

@media (min-width: 960px) {
    .auth-brand {
        min-height: 100vh;
        min-height: 100dvh;
        padding: 3rem 3.5rem;
        justify-content: flex-end;
        padding-right: 4rem;
    }
}

.auth-brand-mesh {
    position: absolute;
    inset: 0;
    opacity: 0.35;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 48px 48px;
    mask-image: radial-gradient(ellipse 70% 60% at 50% 50%, #000 20%, transparent 75%);
    pointer-events: none;
}

.auth-brand-inner {
    position: relative;
    max-width: 22rem;
    animation: auth-rise 0.7s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.auth-brand-logo {
    display: inline-flex;
    align-items: center;
    gap: 0.85rem;
    text-decoration: none;
    color: inherit;
    margin-bottom: 1.75rem;
}

.auth-brand-logo img {
    width: 3.25rem;
    height: 3.25rem;
    display: block;
    border-radius: 0.85rem;
    box-shadow: 0 8px 28px rgba(27, 60, 255, 0.35);
}

.auth-brand-name {
    font-family: var(--font-family-heading, "Space Grotesk", sans-serif);
    font-size: clamp(2rem, 4vw, 2.75rem);
    font-weight: 700;
    letter-spacing: -0.045em;
    line-height: 1;
    color: #FAFBFF;
}

.auth-brand-line {
    font-family: var(--font-family-heading, "Space Grotesk", sans-serif);
    font-size: clamp(1.35rem, 2.5vw, 1.75rem);
    font-weight: 600;
    letter-spacing: -0.03em;
    color: #1B3CFF;
    margin: 0 0 1rem;
    line-height: 1.15;
}

.auth-brand-tagline {
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.55;
    color: rgba(232, 238, 247, 0.62);
    max-width: 18rem;
}

/* legacy hooks (anciennes classes) */
.auth-brand-glow,
.auth-brand-mark,
.auth-brand-mark-icon,
.auth-brand-title,
.auth-brand-list {
    display: none;
}

/* -------------------------------------------------------------------------
   Main / form panel
------------------------------------------------------------------------- */

.auth-main {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 1rem 1.25rem 2.5rem;
    box-sizing: border-box;
}

@media (min-width: 960px) {
    .auth-main {
        justify-content: flex-start;
        padding: 3rem 3.5rem 3rem 2rem;
        min-height: 100vh;
        min-height: 100dvh;
    }
}

.auth-panel,
.auth-card {
    width: 100%;
    max-width: 400px;
    padding: 2rem 1.75rem;
    border-radius: 1.15rem;
    background: rgba(255, 255, 255, 0.035);
    border: 1px solid rgba(255, 255, 255, 0.09);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    animation: auth-rise 0.7s cubic-bezier(0.22, 1, 0.36, 1) 0.08s both;
    color: #E8EEF7;
}

.auth-card--wide,
.auth-panel--wide {
    max-width: 560px;
}

@keyframes auth-rise {
    from {
        opacity: 0;
        transform: translateY(18px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.auth-panel-head,
.auth-card-head {
    margin-bottom: 1.75rem;
    padding-bottom: 0;
    border-bottom: none;
}

.auth-panel-title,
.auth-card-title {
    font-family: var(--font-family-heading, "Space Grotesk", sans-serif);
    font-size: 1.65rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    color: #FAFBFF;
    margin: 0 0 0.4rem;
    line-height: 1.2;
}

.auth-panel-sub,
.auth-card-sub,
.auth-home-lead {
    margin: 0;
    font-size: 0.925rem;
    line-height: 1.55;
    color: rgba(232, 238, 247, 0.58);
}

.auth-card-eyebrow {
    display: none;
}

/* -------------------------------------------------------------------------
   Form
------------------------------------------------------------------------- */

.auth-form .auth-field {
    margin-bottom: 1.15rem;
}

.auth-label-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.4rem;
}

.auth-label-row .auth-label {
    margin-bottom: 0;
}

.auth-form .auth-label {
    display: block;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: rgba(232, 238, 247, 0.72);
    margin-bottom: 0.4rem;
}

.auth-input,
.auth-form .form-control.auth-input,
.auth-form .form-control {
    display: block;
    width: 100%;
    max-width: 100%;
    height: 3rem;
    min-height: 3rem;
    padding: 0.75rem 1rem !important;
    font-size: 0.95rem;
    line-height: 1.25;
    color: #FAFBFF !important;
    background: rgba(7, 10, 18, 0.55) !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    border-radius: 0.7rem !important;
    box-shadow: none !important;
    box-sizing: border-box;
    margin: 0;
    transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}

.auth-input::placeholder,
.auth-form .form-control::placeholder {
    color: rgba(232, 238, 247, 0.35);
}

.auth-input:focus,
.auth-form .form-control.auth-input:focus,
.auth-form .form-control:focus {
    outline: none;
    border-color: rgba(27, 60, 255, 0.75) !important;
    background: rgba(7, 10, 18, 0.75) !important;
    box-shadow: 0 0 0 3px rgba(27, 60, 255, 0.2) !important;
}

/* icônes input désactivées (layout plus propre) */
.auth-input-wrap {
    position: relative;
}

.auth-input-wrap .auth-input-icon {
    display: none;
}

.auth-input-wrap .auth-input,
.auth-input-wrap .form-control.auth-input {
    padding-left: 1rem !important;
}

.auth-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 1.15rem;
}

.auth-check {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    margin: 0.25rem 0 1.35rem;
    font-size: 0.875rem;
    color: rgba(232, 238, 247, 0.65);
    cursor: pointer;
    user-select: none;
}

.auth-check input {
    width: 1rem;
    height: 1rem;
    accent-color: #1B3CFF;
    border-radius: 4px;
}

.auth-link {
    font-size: 0.8rem;
    font-weight: 600;
    color: #7B93FF;
    text-decoration: none;
    transition: color 0.2s;
}

.auth-link:hover {
    color: #A8B8FF;
    text-decoration: underline;
}

.auth-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    min-height: 3.05rem;
    padding: 0 1.25rem;
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    border: none;
    border-radius: 0.7rem;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s, background 0.2s, opacity 0.2s;
    text-decoration: none;
}

.auth-btn-primary {
    background: #1B3CFF;
    color: #FAFBFF;
    box-shadow: 0 10px 28px rgba(27, 60, 255, 0.35);
}

.auth-btn:disabled {
    opacity: 0.7;
    cursor: wait;
}

.auth-hp {
    position: absolute;
    left: -10000px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.auth-btn-primary:hover {
    background: #2A4BFF;
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 14px 32px rgba(27, 60, 255, 0.42);
}

.auth-btn-primary:active {
    transform: translateY(0);
}

.auth-btn-secondary {
    background: transparent;
    color: rgba(232, 238, 247, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.14);
    width: auto;
    min-width: 100%;
}

.auth-btn-secondary:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #FAFBFF;
    border-color: rgba(255, 255, 255, 0.22);
}

.auth-fineprint,
.auth-footer {
    margin-top: 1.5rem;
    padding-top: 0;
    border-top: none;
    text-align: center;
    font-size: 0.75rem;
    color: rgba(232, 238, 247, 0.4);
}

.auth-footer i {
    display: none;
}

.auth-alert {
    border-radius: 0.7rem;
    padding: 0.8rem 1rem;
    font-size: 0.875rem;
    margin-bottom: 1.15rem;
    border: 1px solid transparent;
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    line-height: 1.45;
}

.auth-alert--danger {
    background: rgba(239, 68, 68, 0.12);
    border-color: rgba(239, 68, 68, 0.35);
    color: #FCA5A5;
}

.auth-alert--warning {
    background: rgba(245, 158, 11, 0.12);
    border-color: rgba(245, 158, 11, 0.35);
    color: #FCD34D;
}

.auth-alert--success {
    background: rgba(16, 185, 129, 0.12);
    border-color: rgba(16, 185, 129, 0.35);
    color: #6EE7B7;
}

.auth-form .text-danger.small {
    margin-top: 0.35rem;
    font-size: 0.8rem;
    color: #FCA5A5;
}

.auth-actions-stack {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    align-items: stretch;
    margin-top: 0.5rem;
}

/* -------------------------------------------------------------------------
   Home tiles
------------------------------------------------------------------------- */

.auth-home-lead {
    margin: 0 0 1.5rem;
}

.auth-home-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

@media (min-width: 576px) {
    .auth-home-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.auth-home-tile {
    padding: 1rem;
    border-radius: 0.75rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: border-color 0.2s, background 0.2s, transform 0.2s;
}

.auth-home-tile:hover {
    border-color: rgba(27, 60, 255, 0.4);
    background: rgba(27, 60, 255, 0.08);
    transform: translateY(-2px);
}

.auth-home-tile-icon {
    width: 2.2rem;
    height: 2.2rem;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    color: #fff;
    background: #1B3CFF;
    margin-bottom: 0.65rem;
}

.auth-home-tile h3 {
    font-family: var(--font-family-heading, "Space Grotesk", sans-serif);
    font-size: 0.92rem;
    font-weight: 700;
    margin: 0 0 0.3rem;
    color: #FAFBFF;
}

.auth-home-tile p {
    font-size: 0.78rem;
    color: rgba(232, 238, 247, 0.5);
    margin: 0;
    line-height: 1.45;
}

.auth-home-cta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: center;
}

.auth-home-cta .auth-btn {
    width: auto;
    min-width: 220px;
}

/* -------------------------------------------------------------------------
   Scroll / mobile
------------------------------------------------------------------------- */

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: 960px) {
    body.auth-page.auth-page--scroll .auth-brand {
        min-height: 100vh;
        min-height: 100dvh;
    }
}

@media (max-width: 959px) {
    .auth-brand {
        text-align: center;
    }

    .auth-brand-inner {
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .auth-brand-tagline {
        max-width: 16rem;
    }

    .auth-brand-logo {
        margin-bottom: 1rem;
    }

    .auth-brand-line {
        margin-bottom: 0.5rem;
    }

    .auth-panel,
    .auth-card {
        padding: 1.65rem 1.35rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .auth-brand-inner,
    .auth-panel,
    .auth-card,
    .auth-home-tile,
    .auth-btn-primary {
        animation: none;
        transition: none;
    }
}
