/* ============================================================
 * NoxusTime Mobile — Premium Login (overrides + animations)
 * Charge APRÈS mobile.css, override ciblé sans casser le shell.
 * ============================================================ */

/* ---------- Fond premium (radial + linear) ---------- */
.login-wrap {
    background:
        radial-gradient(1100px 600px at 12% -8%, rgba(74, 144, 217, 0.22) 0%, rgba(74, 144, 217, 0) 60%),
        radial-gradient(900px 500px at 100% 110%, rgba(46, 110, 200, 0.16) 0%, rgba(46, 110, 200, 0) 55%),
        linear-gradient(170deg, #EAF2FC 0%, #F6FAFF 38%, #FFFFFF 65%, #F4F8FD 100%);
}

/* Blobs un poil plus discrets */
.login-wrap::before {
    background: radial-gradient(circle, rgba(74, 144, 217, 0.18) 0%, transparent 70%);
    filter: blur(2px);
}
.login-wrap::after {
    background: radial-gradient(circle, rgba(16, 185, 129, 0.10) 0%, transparent 70%);
    filter: blur(2px);
}

/* ---------- Header : logo + titre ---------- */
.login-header {
    opacity: 0;
    transform: translateY(-14px);
    animation: lg-fadeDown 600ms cubic-bezier(0.16, 1, 0.3, 1) 0ms both;
}

.login-header .login-clock {
    background: #fff;
    box-shadow:
        0 10px 28px -10px rgba(74, 144, 217, 0.55),
        0 4px 10px -2px rgba(15, 23, 42, 0.10),
        inset 0 0 0 1px rgba(255, 255, 255, 0.85);
    transition: transform .25s ease, box-shadow .25s ease;
}
.login-header .login-clock:hover {
    transform: rotate(-4deg) scale(1.04);
}

.login-title {
    background: linear-gradient(135deg, #1E293B 0%, #355B9A 60%, #4A90D9 100%);
    -webkit-background-clip: text;
            background-clip: text;
    -webkit-text-fill-color: transparent;
    opacity: 0;
    transform: translateY(6px) scale(0.95);
    animation: lg-fadeUpScale 500ms cubic-bezier(0.16, 1, 0.3, 1) 120ms both;
}

.kiosque-badge {
    -webkit-text-fill-color: initial; /* sinon hérite du clip transparent */
    color: #fff;
    background: linear-gradient(135deg, #4A90D9 0%, #2E6EC8 100%);
    padding: 3px 8px;
    border-radius: 999px;
    box-shadow: 0 4px 12px -3px rgba(74, 144, 217, 0.55);
    font-weight: 700;
    letter-spacing: 0.04em;
}

/* ---------- Sous-titre : typewriter ---------- */
.login-sub {
    opacity: 0;
    animation: lg-fadeIn 400ms ease 220ms both;
    color: var(--text-secondary);
    min-height: 1.4em; /* pas de saut quand le texte est vide au début du typewriter */
}

.login-sub.typewriter::after {
    content: '';
    display: inline-block;
    width: 2px;
    height: 1em;
    margin-left: 2px;
    background: var(--primary);
    vertical-align: -2px;
    animation: lg-caret 0.9s steps(1) infinite;
}
.login-sub.typewriter.is-done::after {
    animation: lg-caretFade 1.4s ease forwards;
}

/* ---------- Carte glassmorphism ---------- */
.login-card {
    background: rgba(255, 255, 255, 0.78);
    backdrop-filter: blur(18px) saturate(140%);
    -webkit-backdrop-filter: blur(18px) saturate(140%);
    border: 1px solid rgba(255, 255, 255, 0.65);
    box-shadow:
        0 22px 60px -22px rgba(15, 23, 42, 0.22),
        0 10px 28px -16px rgba(74, 144, 217, 0.22),
        inset 0 1px 0 rgba(255, 255, 255, 0.85);
    /* Override de l'animation du shell (mt-scaleIn) par notre slide-up premium */
    animation: lg-cardSlideUp 600ms cubic-bezier(0.16, 1, 0.3, 1) 300ms both !important;
    transition: box-shadow .35s ease, transform .35s ease;
}

/* Glow doux quand on focus l'input à l'intérieur */
.login-card:has(.input:focus) {
    box-shadow:
        0 24px 60px -20px rgba(74, 144, 217, 0.35),
        0 0 0 4px rgba(74, 144, 217, 0.10),
        inset 0 1px 0 rgba(255, 255, 255, 0.85);
}

/* ---------- Stagger des enfants de la card ---------- */
.login-card > * {
    opacity: 0;
    animation: lg-fadeUp 500ms cubic-bezier(0.16, 1, 0.3, 1) both;
}
.login-card > *:nth-child(1) { animation-delay: 450ms; }
.login-card > *:nth-child(2) { animation-delay: 500ms; }
.login-card > *:nth-child(3) { animation-delay: 550ms; }
.login-card > *:nth-child(4) { animation-delay: 600ms; }
.login-card > *:nth-child(5) { animation-delay: 650ms; }

/* ---------- Bouton empreinte premium ---------- */
.btn-fingerprint {
    background:
        linear-gradient(180deg, #5BA3E8 0%, #4A90D9 50%, #2E6EC8 100%);
    border-radius: var(--radius-xl);
    box-shadow:
        0 14px 30px -10px rgba(74, 144, 217, 0.55),
        0 6px 14px -4px rgba(46, 110, 200, 0.35),
        inset 0 1px 0 rgba(255, 255, 255, 0.30),
        inset 0 -2px 0 rgba(0, 0, 0, 0.06);
    position: relative;
    overflow: hidden;
    transition: transform .15s ease, box-shadow .25s ease, filter .25s ease;
}

/* Halo pulsé permanent — léger */
.btn-fingerprint::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: radial-gradient(circle at 50% 0%, rgba(255, 255, 255, 0.25) 0%, transparent 60%);
    pointer-events: none;
}

/* Pulse autour au hover (anneau bleu) */
.btn-fingerprint::after {
    content: '';
    position: absolute;
    inset: -6px;
    border-radius: calc(var(--radius-xl) + 6px);
    border: 2px solid rgba(74, 144, 217, 0.45);
    opacity: 0;
    transform: scale(0.96);
    pointer-events: none;
    transition: opacity .25s ease, transform .25s ease;
}
.btn-fingerprint:hover::after,
.btn-fingerprint:focus-visible::after {
    opacity: 1;
    transform: scale(1);
    animation: lg-fpPulse 1.6s ease-in-out infinite;
}

.btn-fingerprint:hover {
    transform: translateY(-1px);
    filter: brightness(1.04);
    box-shadow:
        0 18px 36px -10px rgba(74, 144, 217, 0.60),
        0 8px 18px -4px rgba(46, 110, 200, 0.40),
        inset 0 1px 0 rgba(255, 255, 255, 0.30),
        inset 0 -2px 0 rgba(0, 0, 0, 0.06);
}

.btn-fingerprint:active {
    transform: scale(0.97);
    box-shadow:
        0 6px 14px -4px rgba(46, 110, 200, 0.45),
        inset 0 2px 8px rgba(0, 0, 0, 0.18),
        inset 0 -1px 0 rgba(255, 255, 255, 0.15);
}

.btn-fingerprint .material-icons-round {
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.18));
}

/* ---------- Input badge premium ---------- */
.float-group .input {
    background: rgba(255, 255, 255, 0.70);
    border-color: rgba(74, 144, 217, 0.18);
    transition: border-color .2s ease, box-shadow .25s ease, background .2s ease;
}
.float-group .input:focus {
    background: #fff;
    border-color: var(--primary);
    box-shadow:
        0 0 0 4px rgba(74, 144, 217, 0.14),
        0 8px 20px -10px rgba(74, 144, 217, 0.35);
}

/* ---------- Bouton "Identifier" — finition ---------- */
.btn-primary {
    background: linear-gradient(135deg, #5BA3E8 0%, #4A90D9 50%, #2E6EC8 100%);
    box-shadow:
        0 12px 28px -8px rgba(74, 144, 217, 0.50),
        0 4px 12px -4px rgba(46, 110, 200, 0.30),
        inset 0 1px 0 rgba(255, 255, 255, 0.22);
}
.btn-primary:hover {
    box-shadow:
        0 16px 34px -8px rgba(74, 144, 217, 0.58),
        0 6px 16px -4px rgba(46, 110, 200, 0.40),
        inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

/* Ripple léger via overlay */
.btn-primary::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: radial-gradient(circle at var(--ripple-x, 50%) var(--ripple-y, 50%),
        rgba(255, 255, 255, 0.35) 0%,
        rgba(255, 255, 255, 0) 55%);
    opacity: 0;
    transition: opacity .35s ease;
    pointer-events: none;
}
.btn-primary:active::before {
    opacity: 1;
    transition: opacity 0s;
}

/* ---------- Divider raffiné ---------- */
.login-divider {
    color: rgba(100, 116, 139, 0.85);
}
.login-divider::before,
.login-divider::after {
    background: linear-gradient(90deg, transparent 0%, rgba(74, 144, 217, 0.28) 50%, transparent 100%);
    height: 1px;
}

/* ---------- NFC : icône en mode scan = onde radar ---------- */
.nfc-btn.is-scanning {
    position: relative;
}
.nfc-btn.is-scanning::before,
.nfc-btn.is-scanning::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 12px;
    border: 2px solid rgba(74, 144, 217, 0.55);
    opacity: 0;
    pointer-events: none;
    animation: lg-radar 1.6s ease-out infinite;
}
.nfc-btn.is-scanning::after {
    animation-delay: 0.8s;
}
.nfc-btn.is-scanning .material-icons-round {
    animation: lg-nfcBlink 1.2s ease-in-out infinite;
}

/* ---------- Lien "Mode kiosque" plus discret ---------- */
#kiosqueToggle {
    opacity: 0.65;
    font-size: 0.78rem;
    transition: opacity .2s ease, color .2s ease, background .2s ease;
}
#kiosqueToggle:hover { opacity: 1; }

/* ---------- Footer ---------- */
.login-footer {
    opacity: 0;
    animation: lg-fadeIn 500ms ease 900ms both;
}

/* ---------- Keyframes ---------- */
@keyframes lg-fadeDown {
    from { opacity: 0; transform: translateY(-14px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes lg-fadeUp {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes lg-fadeUpScale {
    from { opacity: 0; transform: translateY(6px) scale(0.95); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes lg-fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}
@keyframes lg-cardSlideUp {
    from { opacity: 0; transform: translateY(28px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes lg-fpPulse {
    0%, 100% { transform: scale(1);    opacity: 0.85; }
    50%      { transform: scale(1.04); opacity: 0.35; }
}
@keyframes lg-radar {
    0%   { opacity: 0.7; transform: scale(0.85); }
    100% { opacity: 0;   transform: scale(1.6); }
}
@keyframes lg-nfcBlink {
    0%, 100% { opacity: 1; }
    50%      { opacity: 0.45; }
}
@keyframes lg-caret {
    0%, 49% { opacity: 1; }
    50%, 100% { opacity: 0; }
}
@keyframes lg-caretFade {
    0%   { opacity: 1; }
    100% { opacity: 0; }
}

/* ---------- Responsive : très petits écrans ---------- */
@media (max-width: 360px) {
    .login-card { padding: 18px 16px; }
    .btn-fingerprint { min-height: 64px; padding: 12px; }
    .btn-fingerprint .material-icons-round { font-size: 2rem; }
}

/* ---------- Préfère animations réduites ---------- */
@media (prefers-reduced-motion: reduce) {
    .login-header,
    .login-title,
    .login-sub,
    .login-card,
    .login-card > *,
    .login-footer {
        animation: none !important;
        opacity: 1 !important;
        transform: none !important;
    }
    .btn-fingerprint:hover::after,
    .btn-fingerprint:focus-visible::after { animation: none !important; }
    .nfc-btn.is-scanning::before,
    .nfc-btn.is-scanning::after { animation: none !important; }
}
