/* ============================================================
   Access Guard — front.css
   ============================================================ */

/* ── Reset minimal ────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ── Body ─────────────────────────────────────────────────── */
.ag-lockscreen-body {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0f172a 0%, #1e3a5f 50%, #0f172a 100%);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    padding: 20px;
}

/* ── Fond animé ───────────────────────────────────────────── */
.ag-lockscreen-body::before {
    content: '';
    position: fixed;
    inset: 0;
    background:
        radial-gradient(circle at 20% 30%, rgba(59,130,246,.12) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(16,185,129,.08) 0%, transparent 50%);
    pointer-events: none;
    animation: ag-pulse 8s ease-in-out infinite alternate;
}

@keyframes ag-pulse {
    from { opacity: .6; }
    to   { opacity: 1; }
}

/* ── Carte ────────────────────────────────────────────────── */
.ag-lockscreen {
    width: 100%;
    display: flex;
    justify-content: center;
    position: relative;
    z-index: 1;
}

.ag-lockscreen__card {
    background: rgba(255,255,255,.04);
    border: 1px solid rgba(255,255,255,.10);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-radius: 20px;
    padding: 48px 40px;
    width: 100%;
    max-width: 440px;
    box-shadow:
        0 0 0 1px rgba(255,255,255,.05),
        0 32px 64px rgba(0,0,0,.4);
    animation: ag-slide-up .4s ease-out;
}

@keyframes ag-slide-up {
    from { opacity: 0; transform: translateY(24px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── Marque ───────────────────────────────────────────────── */
.ag-lockscreen__brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    margin-bottom: 28px;
}

.ag-lockscreen__logo {
    height: 56px;
    width: auto;
    object-fit: contain;
    filter: brightness(1.1);
}

.ag-lockscreen__icon {
    font-size: 3rem;
    line-height: 1;
    animation: ag-bounce .6s .2s ease-out both;
}

@keyframes ag-bounce {
    0%   { transform: scale(0); opacity: 0; }
    60%  { transform: scale(1.15); }
    100% { transform: scale(1); opacity: 1; }
}

.ag-lockscreen__site {
    color: rgba(255,255,255,.5);
    font-size: .85rem;
    letter-spacing: .06em;
    text-transform: uppercase;
}

/* ── Titre & message ──────────────────────────────────────── */
.ag-lockscreen__title {
    color: #fff;
    font-size: 1.6rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 10px;
    line-height: 1.2;
}

.ag-lockscreen__message {
    color: rgba(255,255,255,.6);
    font-size: .95rem;
    text-align: center;
    line-height: 1.6;
    margin-bottom: 28px;
}

/* ── Formulaire ───────────────────────────────────────────── */
.ag-lockscreen__form { margin-bottom: 16px; }

.ag-lockscreen__input-group {
    display: flex;
    gap: 8px;
}

.ag-lockscreen__input-group input[type="password"] {
    flex: 1;
    background: rgba(255,255,255,.08);
    border: 1px solid rgba(255,255,255,.15);
    border-radius: 10px;
    color: #fff;
    font-size: 1rem;
    padding: 12px 16px;
    outline: none;
    transition: border-color .2s, background .2s;
}

.ag-lockscreen__input-group input[type="password"]::placeholder {
    color: rgba(255,255,255,.35);
}

.ag-lockscreen__input-group input[type="password"]:focus {
    border-color: rgba(99,179,237,.7);
    background: rgba(255,255,255,.12);
}

.ag-lockscreen__input-group input.ag-error {
    border-color: #f87171;
    animation: ag-shake .3s ease-out;
}

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

#ag-submit-btn {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    border: none;
    border-radius: 10px;
    color: #fff;
    cursor: pointer;
    font-size: .95rem;
    font-weight: 600;
    padding: 12px 20px;
    transition: transform .15s, box-shadow .15s, background .2s;
    white-space: nowrap;
}

#ag-submit-btn:hover {
    background: linear-gradient(135deg, #60a5fa, #3b82f6);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(59,130,246,.4);
}

#ag-submit-btn:active {
    transform: translateY(0);
}

#ag-submit-btn:disabled {
    opacity: .6;
    cursor: not-allowed;
    transform: none;
}

/* ── Erreur / succès ──────────────────────────────────────── */
.ag-lockscreen__error {
    color: #fca5a5;
    font-size: .875rem;
    text-align: center;
    margin-top: 10px;
    padding: 8px 12px;
    background: rgba(239,68,68,.12);
    border-radius: 8px;
    border: 1px solid rgba(239,68,68,.25);
}

.ag-lockscreen__success {
    text-align: center;
    color: #86efac;
    font-size: 1rem;
    padding: 12px;
    background: rgba(34,197,94,.1);
    border-radius: 10px;
    border: 1px solid rgba(34,197,94,.2);
}

/* ── Lien retour ──────────────────────────────────────────── */
.ag-lockscreen__back {
    text-align: center;
    margin-top: 20px;
}

.ag-lockscreen__back a {
    color: rgba(255,255,255,.4);
    font-size: .85rem;
    text-decoration: none;
    transition: color .2s;
}

.ag-lockscreen__back a:hover {
    color: rgba(255,255,255,.8);
}

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 480px) {
    .ag-lockscreen__card {
        padding: 32px 24px;
    }
    .ag-lockscreen__input-group {
        flex-direction: column;
    }
    #ag-submit-btn { width: 100%; }
}

/* ── Vérification appareil ────────────────────────────── */
.ag-lockscreen__checking {
    color: rgba(255,255,255,.6);
    text-align: center;
    font-size: 1rem;
    padding: 20px 0 10px;
    animation: ag-blink 1.4s ease-in-out infinite;
}
.ag-lockscreen__checking.ag-trusted {
    color: #86efac;
    animation: none;
}
@keyframes ag-blink {
    0%,100% { opacity:.5; }
    50%      { opacity:1; }
}

/* ── Case "Se souvenir de cet appareil" ──────────────── */
.ag-remember-label {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 14px;
    color: rgba(255,255,255,.65);
    font-size: .875rem;
    cursor: pointer;
    user-select: none;
}
.ag-remember-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #3b82f6;
    cursor: pointer;
}
.ag-remember-label:hover { color: rgba(255,255,255,.9); }
