/* ============================================================
   login.css — Tape2Enter v2.0
   Partagé par login.html et reset-password.html
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@700;900&family=DM+Sans:wght@300;400;500&display=swap');

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

body {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #0a0a0f;
    font-family: 'DM Sans', sans-serif;
    overflow: hidden;
    position: relative;
}

/* ── Fond animé ── */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background:
        radial-gradient(ellipse 60% 50% at 20% 20%, rgba(124, 58, 237, 0.18) 0%, transparent 70%),
        radial-gradient(ellipse 40% 40% at 80% 80%, rgba(0, 212, 255, 0.08) 0%, transparent 60%),
        radial-gradient(ellipse 50% 60% at 50% 50%, rgba(218, 34, 255, 0.05) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

/* ── Grille de fond ── */
body::after {
    content: '';
    position: fixed;
    inset: 0;
    background-image:
        linear-gradient(rgba(255,255,255,0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.02) 1px, transparent 1px);
    background-size: 60px 60px;
    pointer-events: none;
    z-index: 0;
}

/* ── Conteneur principal ── */
.login-container {
    position: relative;
    z-index: 1;
    width: 420px;
    max-width: calc(100vw - 40px);
    padding: 48px 40px;
    background: rgba(18, 16, 26, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow:
        0 0 0 1px rgba(124, 58, 237, 0.1),
        0 32px 80px rgba(0, 0, 0, 0.6),
        inset 0 1px 0 rgba(255, 255, 255, 0.06);
    animation: containerIn 0.6s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes containerIn {
    from { opacity: 0; transform: translateY(24px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0)    scale(1); }
}

/* ── Logo ── */
.login-logo {
    text-align: center;
    margin-bottom: 36px;
}

.login-logo-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    border-radius: 16px;
    margin: 0 auto 16px;
}

.login-logo-mark img {
    width: 36px;
    height: 36px;
    object-fit: contain;
}

.login-brand {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.35rem;
    font-weight: 900;
    letter-spacing: 0.08em;
    background: linear-gradient(135deg, #ffffff 0%, #a78bfa 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: block;
    margin-bottom: 4px;
}

.login-subtitle {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.35);
    letter-spacing: 0.02em;
    font-weight: 300;
}

/* ── Titres vues ── */
h1 {
    font-family: 'DM Sans', sans-serif;
    font-size: 22px;
    font-weight: 500;
    color: #ffffff;
    text-align: center;
    margin-bottom: 20px;
    letter-spacing: -0.01em;
}

.view-desc {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.45);
    text-align: center;
    line-height: 1.6;
    margin-bottom: 24px;
}

/* ── Champs ── */
.input-group {
    margin-bottom: 18px;
    position: relative;
}

label {
    display: block;
    font-size: 12px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.45);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    margin-bottom: 8px;
}

input[type="email"],
input[type="password"] {
    width: 100%;
    padding: 13px 16px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    color: #ffffff;
    font-size: 15px;
    font-family: 'DM Sans', sans-serif;
    font-weight: 400;
    transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
    outline: none;
    -webkit-appearance: none;
}

input[type="email"]:hover,
input[type="password"]:hover {
    border-color: rgba(255, 255, 255, 0.18);
    background: rgba(255, 255, 255, 0.06);
}

input[type="email"]:focus,
input[type="password"]:focus {
    border-color: rgba(124, 58, 237, 0.6);
    background: rgba(124, 58, 237, 0.05);
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.12);
}

input[type="email"]::placeholder,
input[type="password"]::placeholder {
    color: rgba(255, 255, 255, 0.2);
}

/* Autofill override */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus {
    -webkit-box-shadow: 0 0 0 1000px rgba(18, 16, 26, 0.9) inset;
    -webkit-text-fill-color: #ffffff;
    caret-color: #ffffff;
    border-color: rgba(124, 58, 237, 0.4) !important;
}

/* ── Ligne options (rester connecté + mot de passe oublié) ── */
.login-options {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

/* ── Checkbox "Rester connecté" ── */
.remember-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    text-transform: none;
    letter-spacing: 0;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.45);
    font-weight: 400;
    user-select: none;
}

.remember-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #7c3aed;
    cursor: pointer;
    flex-shrink: 0;
}

.remember-text {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.5);
    text-transform: none;
    letter-spacing: 0;
    font-weight: 400;
}

/* ── Bouton texte (lien discret) ── */
.link-btn {
    background: none;
    border: none;
    padding: 0;
    color: #a78bfa;
    font-size: 13px;
    font-family: 'DM Sans', sans-serif;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: color 0.15s ease;
    display: inline;
}

.link-btn:hover {
    color: #c4b5fd;
}

/* ── Bouton submit principal ── */
button[type="submit"] {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #7c3aed 0%, #a855f7 100%);
    border: none;
    border-radius: 10px;
    color: #ffffff;
    font-size: 15px;
    font-family: 'DM Sans', sans-serif;
    font-weight: 500;
    letter-spacing: 0.02em;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
    box-shadow: 0 4px 20px rgba(124, 58, 237, 0.4);
}

button[type="submit"]::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.1) 0%, transparent 50%);
    opacity: 0;
    transition: opacity 0.2s ease;
}

button[type="submit"]:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 28px rgba(124, 58, 237, 0.55);
}

button[type="submit"]:hover::before { opacity: 1; }

button[type="submit"]:active {
    transform: translateY(0);
    box-shadow: 0 4px 16px rgba(124, 58, 237, 0.35);
}

button[type="submit"]:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* ── Messages erreur / succès ── */
.error-message,
.success-message {
    min-height: 0;
    margin-top: 16px;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 13px;
    text-align: center;
    display: none;
    animation: msgIn 0.2s ease;
}

.error-message:not(:empty)   { display: block; }
.success-message:not(:empty) { display: block; }

.error-message {
    color: #fca5a5;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.success-message {
    color: #86efac;
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.2);
}

@keyframes msgIn {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── Footer ── */
.login-footer {
    margin-top: 24px;
    text-align: center;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.3);
}

.login-footer a {
    color: #a78bfa;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.15s ease;
}

.login-footer a:hover { color: #c4b5fd; }

/* ── Spinner ── */
.btn-loading {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    vertical-align: middle;
    margin-right: 8px;
}

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

/* ── Utilitaire ── */
.hidden { display: none !important; }

/* ── Transition entre vues ── */
.view-enter {
    animation: viewIn 0.25s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes viewIn {
    from { opacity: 0; transform: translateX(12px); }
    to   { opacity: 1; transform: translateX(0); }
}

/* ── Responsive ── */
@media (max-width: 480px) {
    .login-container { padding: 36px 24px; }
}