/* ============================================================
   ABSTECH PRO - Connexion établissement
   Reproduction CSS de la page React originale
   ============================================================ */

:root {
    --auth-bg: #0a0a12;
    --auth-white: #ffffff;
    --auth-indigo: #6366f1;
    --auth-indigo-light: #818cf8;
    --auth-purple: #9333ea;
    --auth-red: #f87171;
    --auth-green: #6ee7b7;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
}

body {
    font-family:
        Inter,
        ui-sans-serif,
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;
    background: var(--auth-bg);
    color: white;
    -webkit-font-smoothing: antialiased;
}

button,
input {
    font: inherit;
}

.auth-page {
    position: relative;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 12px;
    overflow-x: hidden;
    overflow-y: auto;
    isolation: isolate;
    background: #0a0a12;
}

.auth-orb,
.auth-grid {
    position: absolute;
    pointer-events: none;
    user-select: none;
}

.auth-orb {
    border-radius: 999px;
    filter: blur(85px);
    opacity: .9;
    animation: authPulse 5.5s ease-in-out infinite;
}

.auth-orb-one {
    top: -30%;
    right: -20%;
    width: 600px;
    height: 600px;
    background:
        linear-gradient(
            135deg,
            rgba(79, 70, 229, .30),
            rgba(147, 51, 234, .20)
        );
}

.auth-orb-two {
    bottom: -30%;
    left: -20%;
    width: 600px;
    height: 600px;
    animation-delay: 1s;
    background:
        linear-gradient(
            45deg,
            rgba(37, 99, 235, .20),
            rgba(79, 70, 229, .30)
        );
}

.auth-orb-center {
    top: 50%;
    left: 50%;
    width: 800px;
    height: 800px;
    opacity: 1;
    transform: translate(-50%, -50%);
    animation: none;
    background: rgba(255, 255, 255, .02);
}

.auth-grid {
    inset: 0;
    opacity: .03;
    background-image:
        radial-gradient(
            circle at 1px 1px,
            white 1px,
            transparent 0
        );
    background-size: 40px 40px;
}

.auth-back {
    position: absolute;
    z-index: 20;
    top: 24px;
    left: 24px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    color: rgba(255, 255, 255, .70);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    border: 1px solid rgba(255, 255, 255, .10);
    border-radius: 12px;
    background: rgba(255, 255, 255, .05);
    backdrop-filter: blur(18px);
    transition:
        color .3s ease,
        background .3s ease,
        border-color .3s ease,
        transform .3s ease;
}

.auth-back:hover {
    color: white;
    border-color: rgba(255, 255, 255, .20);
    background: rgba(255, 255, 255, .10);
    transform: translateX(-2px);
}

.auth-back:focus-visible {
    outline: none;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, .20);
}

.auth-card {
    position: relative;
    z-index: 10;
    width: min(100%, 440px);
    padding: 40px;
    border: 1px solid rgba(255, 255, 255, .10);
    border-radius: 24px;
    background: rgba(255, 255, 255, .05);
    backdrop-filter: blur(28px);
    box-shadow: 0 30px 80px rgba(0, 0, 0, .60);
    transition: box-shadow .5s ease, transform .5s ease;
    animation: authCardEnter .55s ease both;
}

.auth-card:hover {
    box-shadow: 0 40px 100px rgba(0, 0, 0, .70);
}

.auth-brand {
    margin-bottom: 32px;
    text-align: center;
}

.auth-brand-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 16px;
    color: white;
    background: linear-gradient(135deg, #6366f1, #9333ea);
    box-shadow: 0 10px 30px rgba(99, 102, 241, .25);
}

.auth-brand-icon svg {
    width: 32px;
    height: 32px;
}

.auth-brand h1 {
    margin: 0;
    color: white;
    font-size: 24px;
    line-height: 1.2;
    font-weight: 800;
    letter-spacing: -.025em;
}

.auth-brand h1 span {
    color: var(--auth-indigo-light);
}

.auth-brand p {
    margin: 6px 0 0;
    color: rgba(255, 255, 255, .40);
    font-size: 14px;
    font-weight: 500;
    letter-spacing: .025em;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.auth-invitation {
    padding: 12px;
    color: #e0e7ff;
    font-size: 14px;
    line-height: 1.5;
    border: 1px solid rgba(129, 140, 248, .20);
    border-radius: 12px;
    background: rgba(99, 102, 241, .10);
}

.auth-link-status {
    padding: 24px 20px;
    border: 1px solid rgba(129, 140, 248, .20);
    border-radius: 16px;
    background: rgba(99, 102, 241, .08);
    text-align: center;
}

.auth-link-status h2 {
    margin: 0 0 12px;
    color: #e0e7ff;
    font-size: 20px;
    line-height: 1.4;
}

.auth-link-status p {
    margin: 0;
    color: rgba(255, 255, 255, .70);
    font-size: 14px;
    line-height: 1.7;
}

.auth-error {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px;
    color: #fca5a5;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.45;
    border: 1px solid rgba(239, 68, 68, .20);
    border-radius: 12px;
    background: rgba(239, 68, 68, .10);
    animation: authShake .36s ease both;
}

.auth-error i {
    margin-top: 2px;
    color: #f87171;
}

.auth-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.auth-field label,
.auth-label-row label {
    display: block;
    color: rgba(255, 255, 255, .60);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .07em;
    text-transform: uppercase;
}

.auth-label-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.auth-label-row > span {
    color: rgba(255, 255, 255, .30);
    font-size: 12px;
    text-align: right;
}

.auth-input-wrap {
    position: relative;
}

.auth-input-icon {
    position: absolute;
    z-index: 2;
    top: 50%;
    left: 16px;
    transform: translateY(-50%);
    color: rgba(255, 255, 255, .30);
    font-size: 14px;
    pointer-events: none;
}

.auth-input {
    width: 100%;
    min-height: 50px;
    padding: 13px 16px 13px 44px;
    color: white;
    caret-color: var(--auth-indigo-light);
    font-size: 14px;
    border: 1px solid rgba(255, 255, 255, .10);
    border-radius: 12px;
    outline: none;
    background: rgba(255, 255, 255, .05);
    transition:
        border-color .3s ease,
        background .3s ease,
        box-shadow .3s ease;
}

.auth-input-password {
    padding-right: 48px;
}

.auth-input::placeholder {
    color: rgba(255, 255, 255, .20);
}

.auth-input:hover {
    background: rgba(255, 255, 255, .10);
}

.auth-input:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, .10);
}

.auth-input[readonly] {
    color: rgba(255, 255, 255, .72);
    cursor: default;
}

.auth-password-toggle {
    position: absolute;
    z-index: 3;
    top: 50%;
    right: 14px;
    width: 32px;
    height: 32px;
    padding: 0;
    transform: translateY(-50%);
    color: rgba(255, 255, 255, .30);
    border: 0;
    border-radius: 8px;
    cursor: pointer;
    background: transparent;
    transition: color .2s ease, background .2s ease;
}

.auth-password-toggle:hover {
    color: rgba(255, 255, 255, .70);
    background: rgba(255, 255, 255, .05);
}

.password-rules {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    padding: 12px;
    border: 1px solid rgba(255, 255, 255, .10);
    border-radius: 12px;
    background: rgba(0, 0, 0, .10);
}

.password-rule {
    display: flex;
    align-items: center;
    gap: 8px;
    color: rgba(255, 255, 255, .40);
    font-size: 11px;
    line-height: 1.35;
    transition: color .2s ease;
}

.password-rule i {
    font-size: 9px;
}

.password-rule.is-valid {
    color: #6ee7b7;
}

.confirmation-icon {
    position: absolute;
    top: 50%;
    right: 16px;
    transform: translateY(-50%);
    font-size: 12px;
}

.confirmation-icon.is-valid {
    color: #6ee7b7;
}

.confirmation-icon.is-invalid {
    color: #fda4af;
}

.confirmation-message {
    min-height: 15px;
    margin: 0;
    font-size: 11px;
}

.confirmation-message.is-valid {
    color: #6ee7b7;
}

.confirmation-message.is-invalid {
    color: #fda4af;
}

.auth-input.confirm-valid {
    border-color: rgba(52, 211, 153, .60);
}

.auth-input.confirm-valid:focus {
    border-color: #34d399;
    box-shadow: 0 0 0 4px rgba(16, 185, 129, .10);
}

.auth-input.confirm-invalid {
    border-color: rgba(251, 113, 133, .60);
}

.auth-input.confirm-invalid:focus {
    border-color: #fb7185;
    box-shadow: 0 0 0 4px rgba(244, 63, 94, .10);
}

.auth-submit {
    position: relative;
    width: 100%;
    min-height: 50px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 13px 18px;
    color: white;
    font-size: 14px;
    font-weight: 700;
    border: 0;
    border-radius: 12px;
    cursor: pointer;
    background: linear-gradient(90deg, #6366f1, #9333ea);
    box-shadow: 0 10px 25px rgba(99, 102, 241, .25);
    transition:
        transform .3s ease,
        box-shadow .3s ease,
        opacity .3s ease;
}

.auth-submit:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 16px 34px rgba(99, 102, 241, .40);
}

.auth-submit:active:not(:disabled) {
    transform: scale(.98);
}

.auth-submit:disabled {
    opacity: .60;
    cursor: not-allowed;
}

.auth-submit-spinner {
    display: none;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, .20);
    border-top-color: white;
    border-radius: 50%;
    animation: authSpin .75s linear infinite;
}

.auth-submit.is-loading .auth-submit-spinner {
    display: inline-block;
}

.auth-submit.is-loading .auth-submit-arrow {
    display: none;
}

.auth-footer {
    margin-top: 4px;
    text-align: center;
}

.auth-footer p {
    margin: 0;
    color: rgba(255, 255, 255, .20);
    font-size: 12px;
    line-height: 1.55;
}

@keyframes authPulse {
    0%, 100% {
        transform: scale(1);
        opacity: .72;
    }
    50% {
        transform: scale(1.08);
        opacity: 1;
    }
}

@keyframes authCardEnter {
    from {
        opacity: 0;
        transform: translateY(16px) scale(.985);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes authShake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    50% { transform: translateX(5px); }
    75% { transform: translateX(-3px); }
}

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

@media (max-width: 700px) {
    .auth-page {
        padding: 76px 12px 24px;
        align-items: flex-start;
    }

    .auth-orb-one,
    .auth-orb-two {
        width: 300px;
        height: 300px;
    }

    .auth-orb-center {
        width: 400px;
        height: 400px;
    }

    .auth-back {
        top: 16px;
        left: 16px;
        padding: 9px 12px;
        font-size: 12px;
    }

    .auth-card {
        width: min(100%, 400px);
        padding: 24px;
        border-radius: 16px;
    }

    .auth-brand {
        margin-bottom: 24px;
    }

    .auth-brand-icon {
        width: 56px;
        height: 56px;
        margin-bottom: 12px;
    }

    .auth-brand-icon svg {
        width: 28px;
        height: 28px;
    }

    .auth-brand h1 {
        font-size: 21px;
    }

    .auth-brand p {
        font-size: 12px;
    }

    .auth-form {
        gap: 16px;
    }

    .auth-input {
        min-height: 48px;
        padding-top: 12px;
        padding-bottom: 12px;
    }

    .password-rules {
        grid-template-columns: 1fr;
    }

    .auth-label-row {
        align-items: flex-start;
        flex-direction: column;
        gap: 3px;
    }

    .auth-label-row > span {
        text-align: left;
        font-size: 10px;
    }

    .auth-footer p {
        font-size: 10px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
    }
}


/* ============================================================
   ABSTECH PRO — CONNEXION RESPONSIVE V2
   ============================================================ */

html,
body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
}

.auth-page {
    width: 100%;
    max-width: 100%;
    min-height: 100vh;
    min-height: 100dvh;
    padding:
        max(20px, env(safe-area-inset-top))
        max(12px, env(safe-area-inset-right))
        max(20px, env(safe-area-inset-bottom))
        max(12px, env(safe-area-inset-left));
}

.auth-card {
    width: min(100%, 440px);
    max-width: 100%;
}

.auth-input-wrap,
.auth-field,
.auth-input,
.auth-submit {
    width: 100%;
    max-width: 100%;
    min-width: 0;
}

@media (max-width: 700px) {
    .auth-page {
        align-items: center;
        padding:
            max(70px, calc(env(safe-area-inset-top) + 56px))
            12px
            max(20px, env(safe-area-inset-bottom));
    }

    .auth-back {
        position: fixed;
        top: max(12px, env(safe-area-inset-top));
        left: max(12px, env(safe-area-inset-left));
        z-index: 20;
        max-width: calc(100vw - 24px);
    }

    .auth-card {
        width: min(100%, 420px);
        padding: 22px 18px;
        border-radius: 18px;
    }

    .auth-orb-one,
    .auth-orb-two,
    .auth-orb-center {
        max-width: 100vw;
        max-height: 100vw;
    }
}

@media (max-width: 420px) {
    .auth-page {
        padding-left: 8px;
        padding-right: 8px;
    }

    .auth-card {
        padding: 20px 14px;
        border-radius: 16px;
    }

    .auth-brand h1 {
        font-size: 20px;
    }

    .auth-brand p,
    .auth-footer p {
        overflow-wrap: anywhere;
    }

    .auth-input {
        min-height: 48px;
        font-size: 16px;
    }

    .auth-submit {
        min-height: 48px;
    }
}

@media (max-height: 620px) and (orientation: landscape) {
    .auth-page {
        align-items: flex-start;
        padding-top: 64px;
    }

    .auth-card {
        margin-bottom: 16px;
    }
}


/* ============================================================
   ABSTECH PRO — VALIDATION MOT DE PASSE EN DIRECT
   ============================================================ */
.password-rule.is-pending{color:rgba(255,255,255,.58)}
.password-rule.is-pending i{color:rgba(255,255,255,.38)}
.password-rule.is-valid{color:#6ee7b7;font-weight:700}
.password-rule.is-valid i{color:#34d399;font-size:11px}
.password-live-status{margin:-2px 0 0;padding:10px 12px;border:1px solid rgba(255,255,255,.10);border-radius:10px;font-size:11px;line-height:1.45;transition:color .2s ease,border-color .2s ease,background .2s ease}
.password-live-status.is-neutral{color:rgba(255,255,255,.48);background:rgba(255,255,255,.03)}
.password-live-status.is-pending{color:#fde68a;border-color:rgba(245,158,11,.25);background:rgba(245,158,11,.08)}
.password-live-status.is-valid{color:#6ee7b7;border-color:rgba(52,211,153,.30);background:rgba(16,185,129,.08)}
.confirmation-message.is-pending,.confirmation-icon.is-pending{color:#fde68a}
.password-rules{transition:border-color .2s ease,background .2s ease}
.password-rules:has(.password-rule.is-valid){border-color:rgba(129,140,248,.24)}
