@import url('./var.css');

:root {
    --ies-blue: #00264e;
    --ies-blue-light: #073b70;
    --ies-pink: #c90054;
    --ies-pink-light: #e03b7a;
    --white: #ffffff;
    --text-muted: rgba(255, 255, 255, 0.62);
}

/* =========================
   RESET
========================= */

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

html,
body {
    width: 100%;
    height: 100%;
}

body {
    font-family: Arial, Helvetica, sans-serif;
    overflow: hidden;
    background: var(--ies-blue);
}

/* =========================
   PAGE
========================= */

.login-page {
    position: relative;
    width: 100%;
    height: 100vh;
    min-height: 600px;
    overflow: hidden;
    display: flex;
}

/* =========================
   MODE OPÉRATOIRE
========================= */

.presentation-logo {
    width: 200px;
    max-height: 100px;
    object-fit: contain;
    object-position: left center;
}

.presentation h1 {
    font-size: clamp(46px, 4.5vw, 70px);
}

.logo-container img {
    width: 200px;
    max-height: 110px;
    object-fit: contain;
}

/* =========================
   VIDEO
========================= */

.background-video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scale(1.03);
    animation: videoZoom 18s ease-in-out infinite alternate;
}

.video-overlay {
    position: absolute;
    inset: 0;
    z-index: 1;
    background: linear-gradient(90deg, rgba(0, 38, 78, 0.94) 0%, rgba(0, 38, 78, 0.78) 38%, rgba(0, 38, 78, 0.62) 65%, rgba(0, 20, 43, 0.90) 100%);
}

/* =========================
   LIGHT EFFECTS
========================= */

.light {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    filter: blur(110px);
    z-index: 2;
    opacity: 0.16;
}

.light-blue {
    width: 450px;
    height: 450px;
    background: #146aa8;
    top: -220px;
    right: 20%;
    animation: floatingLight 10s ease-in-out infinite;
}

.light-pink {
    width: 280px;
    height: 280px;
    background: var(--ies-pink);
    bottom: -150px;
    right: 8%;
    opacity: 0.12;
    animation: floatingLight 12s ease-in-out infinite reverse;
}

/* =========================
   PRESENTATION
========================= */

.presentation {
    position: relative;
    z-index: 3;
    width: 58%;
    height: 100%;
    padding: 55px 7%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    color: var(--white);
    animation: presentationIn 1.1s cubic-bezier(.22, .61, .36, 1) both;
}

.presentation-logo {
    width:200px;
    height: auto;
    object-fit: contain;
}

.presentation-content {
    max-width: 620px;
    margin-top: -50px;
}

.eyebrow {
    display: inline-block;
    margin-bottom: 20px;
    color: var(--ies-pink-light);
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 3px;
    animation: fadeUp 0.8s 0.3s both;
}

.presentation h1 {
    margin-bottom: 28px;
    font-size: clamp(48px, 5vw, 76px);
    line-height: 0.98;
    font-weight: 700;
    letter-spacing: -3px;
    animation: fadeUp 0.8s 0.45s both;
}

.presentation h1 span {
    background: linear-gradient(90deg, #ffffff 0%, #ffffff 45%, #e78bad 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.presentation-content p {
    max-width: 520px;
    color: rgba(255, 255, 255, 0.70);
    font-size: 16px;
    line-height: 1.75;
    animation: fadeUp 0.8s 0.6s both;
}

/* =========================
   DOCUMENT TYPES
========================= */

.document-types {
    display: flex;
    flex-wrap: wrap;
    gap: 22px;
    margin-top: 28px;
    animation: fadeUp 0.8s 0.75s both;
}

.document-type {
    display: flex;
    align-items: center;
    gap: 9px;
    color: rgba(255, 255, 255, 0.72);
    font-size: 14px;
}

.document-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--ies-pink);
    box-shadow: 0 0 10px rgba(201, 0, 84, 0.7);
}

.presentation-line {
    width: 65px;
    height: 3px;
    margin-top: 32px;
    border-radius: 20px;
    background: var(--ies-pink);
    box-shadow: 0 0 18px rgba(201, 0, 84, 0.45);
    animation: lineGrow 0.8s 0.9s both, pulseLine 4s 2s infinite;
}

/* =========================
   PRESENTATION FOOTER
========================= */

.presentation-footer {
    display: flex;
    align-items: center;
    gap: 15px;
    color: rgba(255, 255, 255, 0.48);
    font-size: 11px;
    letter-spacing: 1.5px;
    animation: fadeUp 0.8s 1s both;
}

.separator {
    width: 1px;
    height: 14px;
    background: rgba(255, 255, 255, 0.25);
}

/* =========================
   LOGIN CONTAINER
========================= */

.login-container {
    position: relative;
    z-index: 4;
    width: 42%;
    height: 100%;
    padding: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* =========================
   LOGIN CARD
========================= */

.login-card {
    position: relative;
    width: 100%;
    max-width: 455px;
    padding: 45px 48px 35px;
    overflow: hidden;
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: linear-gradient(145deg, rgba(5, 48, 88, 0.78), rgba(0, 22, 45, 0.90));
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.10);
    animation: cardIn 1s cubic-bezier(.22, .61, .36, 1) 0.15s backwards;
    transition:
        transform 0.45s cubic-bezier(0.22, 1, 0.36, 1),
        box-shadow 0.45s ease,
        border-color 0.45s ease;
}

/* Fine ligne supérieure */
.login-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 12%;
    width: 76%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(201, 0, 84, 0.8), transparent);
    box-shadow: 0 0 18px rgba(201, 0, 84, 0.45);
}

/* Halo */
.login-card::after {
    content: "";
    position: absolute;
    width: 180px;
    height: 180px;
    top: -110px;
    right: -80px;
    border-radius: 50%;
    background: var(--ies-pink);
    filter: blur(90px);
    opacity: 0.10;
    pointer-events: none;
}

/* =========================
   CARD HEADER
========================= */

.card-top {
    margin-bottom: 35px;
    text-align: center;
}

.logo-container {
    margin-bottom: 25px;
}

.logo-container img {
    width: 200px;
    filter: drop-shadow(0 0 18px rgba(255, 255, 255, 0.08));
}

.card-top h2 {
    margin-bottom: 10px;
    color: white;
    font-size: 30px;
    font-weight: 600;
}

.card-top p {
    color: var(--text-muted);
    font-size: 14px;
}

/* =========================
   FORM
========================= */

.login-form {
    width: 100%;
}

.input-group {
    margin-bottom: 22px;
}

.input-group label {
    display: block;
    margin-bottom: 9px;
    color: rgba(255, 255, 255, 0.80);
    font-size: 13px;
    font-weight: 600;
}

.input-wrapper {
    position: relative;
}

.input-icon {
    position: absolute;
    left: 18px;
    top: 50%;
    width: 20px;
    transform: translateY(-50%);
    color: rgba(224, 59, 122, 0.85);
    font-size: 17px;
    font-weight: bold;
    z-index: 2;
}

.form-control,
.input-wrapper input {
    width: 100%;
    height: 55px;
    padding: 0 18px 0 50px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.13);
    outline: none;
    background: rgba(0, 38, 78, 0.45);
    color: white;
    font-size: 14px;
    transition: border-color 0.3s ease, background 0.3s ease, box-shadow 0.3s ease, transform 0.3s ease;
}

.input-wrapper input::placeholder {
    color: rgba(255, 255, 255, 0.32);
}

.input-wrapper input:focus {
    border-color: rgba(201, 0, 84, 0.75);
    background: rgba(0, 38, 78, 0.70);
    box-shadow: 0 0 0 3px rgba(201, 0, 84, 0.08), 0 0 25px rgba(201, 0, 84, 0.08);
    transform: translateY(-1px);
}

/* =========================
   ERROR
========================= */

.alert-danger {
    margin-bottom: 22px;
    padding: 13px 15px;
    border-radius: 10px;
    border: 1px solid rgba(255, 80, 120, 0.25);
    background: rgba(201, 0, 84, 0.10);
    color: #ff9ab8;
    font-size: 13px;
    line-height: 1.5;
    animation: shake 0.45s ease;
}

/* =========================
   BUTTON
========================= */

#valider {
    position: relative;
    width: 100%;
    height: 56px;
    margin-top: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    overflow: hidden;
    border: none;
    border-radius: 13px;
    background: linear-gradient(100deg, #00264e 0%, #073e70 55%, #c90054 140%);
    color: white;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

#valider::before {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 60%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.18), transparent);
    transform: skewX(-20deg);
    transition: left 0.65s ease;
}

#valider:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 35px rgba(0, 0, 0, 0.35), 0 0 25px rgba(201, 0, 84, 0.15);
}

#valider:hover::before {
    left: 140%;
}

#valider:active {
    transform: translateY(0) scale(0.98);
}

.button-arrow {
    font-size: 21px;
    transition: transform 0.3s ease;
}

#valider:hover .button-arrow {
    transform: translateX(5px);
}

/* =========================
   FOOTER CARD
========================= */

.card-footer {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 35px;
}

.card-footer span {
    flex: 1;
    height: 1px;
    background: rgba(255, 255, 255, 0.10);
}

.card-footer p {
    color: rgba(255, 255, 255, 0.42);
    font-size: 10px;
    letter-spacing: 3px;
}

.secure-text {
    margin-top: 15px;
    text-align: center;
    color: rgba(255, 255, 255, 0.30);
    font-size: 10px;
}

/* =========================
   USER CONNECTÉ
========================= */

.logged-user {
    padding: 13px;
    margin-bottom: 20px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.65);
    font-size: 12px;
    text-align: center;
}

.logged-user strong {
    color: white;
}

.logged-user a {
    display: block;
    margin-top: 8px;
    color: var(--ies-pink-light);
    text-decoration: none;
}

.logged-user a:hover {
    text-decoration: underline;
}

/* =========================
   LOGIN CARD HOVER
========================= */

@media (hover: hover) and (pointer: fine) {
    .login-card:hover {
        transform: translateY(-6px);
        border-color: rgba(201, 0, 84, 0.38);
        box-shadow:
            0 38px 90px rgba(0, 0, 0, 0.48),
            0 0 35px rgba(201, 0, 84, 0.12),
            inset 0 1px 0 rgba(255, 255, 255, 0.16);
    }

    .login-card:hover::before {
        opacity: 1;
        box-shadow: 0 0 25px rgba(201, 0, 84, 0.65);
    }
}

/* =========================
   ANIMATIONS
========================= */

@keyframes cardIn {
    from {
        opacity: 0;
        transform: translateX(80px) scale(0.96);
        filter: blur(8px);
    }
    to {
        opacity: 1;
        transform: translateX(0) scale(1);
        filter: blur(0);
    }
}

@keyframes presentationIn {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

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

@keyframes lineGrow {
    from {
        width: 0;
    }
    to {
        width: 65px;
    }
}

@keyframes pulseLine {
    0%,
    100% {
        box-shadow: 0 0 12px rgba(201, 0, 84, 0.30);
    }
    50% {
        box-shadow: 0 0 24px rgba(201, 0, 84, 0.60);
    }
}

@keyframes floatingLight {
    0%,
    100% {
        transform: translate(0, 0);
    }
    50% {
        transform: translate(35px, 30px);
    }
}

@keyframes videoZoom {
    from {
        transform: scale(1.03);
    }
    to {
        transform: scale(1.07);
    }
}

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

/* =========================
   RESPONSIVE
========================= */

@media (max-width: 1000px) {
    .presentation {
        width: 45%;
        padding: 40px;
    }
    .login-container {
        width: 55%;
        padding: 25px;
    }
    .presentation h1 {
        font-size: 50px;
    }
}

@media (max-width: 750px) {
    body {
        overflow: auto;
    }
    .login-page {
        min-height: 100vh;
        height: auto;
    }
    .presentation {
        display: none;
    }
    .login-container {
        width: 100%;
        min-height: 100vh;
        padding: 25px;
    }
    .login-card {
        max-width: 440px;
        padding: 35px 28px 30px;
    }
    .background-video {
        filter: brightness(0.30) saturate(0.7);
    }
}

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

@media (max-width: 1000px) {
    .presentation h1 {
        font-size: 46px;
    }
}
