:root {
  --bg: #0f1222;
  --text: #e9ecff;
  --muted: #aab1d7;
  --accent: #7aa2ff;
  --shadow: 0 8px 30px rgba(0, 0, 0, 0.35);

  /* effet verre liquide */
  --glass-bg: rgba(255, 255, 255, 0.15);
  --glass-border: rgba(255, 255, 255, 0.25);
  --glass-highlight: rgba(255, 255, 255, 0.4);
  --glass-blur: 30px;
  --glass-sat: 160%;
}

/* Fond global */
html,
body {
    height: 100%;
    margin: 0;
    font-family: 'Lato', sans-serif;
    color: white;
    background: radial-gradient(ellipse at bottom, #1B2735 0%, #090A0F 100%);
    overflow-x: hidden;
    overflow-y: hidden;
}

body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

main {
    flex: 1 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    z-index: 5;
}

.nav-logo img {
  height: 1.4em;
  vertical-align: middle;
}


h1 img {
  height: 1.8em;
  vertical-align: middle;
}

.app-navbar {
  position: sticky;
  top: 0;
  z-index: 2000;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 24px;
  backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-sat));
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-sat));
  background: var(--glass-bg);
  border-bottom: 1px solid var(--glass-border);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.nav-logo a {
  text-decoration: none;
  font-weight: 600;
  color: var(--text);
  font-size: 1.3rem;
}

/* --- Liens principaux --- */
.nav-links {
  display: flex;
  gap: 24px;
  align-items: center;
}
.nav-item {
  text-decoration: none;
  color: var(--muted);
  font-weight: 500;
  transition: color 0.25s, transform 0.25s;
}
.nav-item:hover {
  color: var(--accent);
  transform: translateY(-1px);
}

/* --- Auth Desktop --- */
.nav-auth {
  display: flex;
  gap: 10px;
}
.nav-button {
  text-decoration: none;
  color: var(--text);
  border: 1px solid var(--glass-border);
  padding: 6px 14px;
  border-radius: 18px;
  background: rgba(255,255,255,0.08);
  transition: all 0.25s ease;
  font-weight: 500;
}
.nav-button:hover {
  background: rgba(255,255,255,0.18);
}
.nav-button.accent {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}
.nav-button.accent:hover {
  filter: brightness(1.1);
}

/* --- Bouton mobile --- */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.6rem;
  color: var(--text);
  cursor: pointer;
}

/* --- Menu Mobile --- */
@media (max-width: 780px) {
  .nav-links {
    display: none;
    flex-direction: column;
    position: absolute;
    top: 70px;
    right: 16px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 18px;
    box-shadow: var(--shadow);
    padding: 16px;
    width: 200px;
    backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-sat));
    -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-sat));
    z-index: 2100;
    animation: fadeIn 0.3s ease;
  }
  .nav-links.open {
    display: flex;
  }
  .nav-item {
    color: var(--text);
    padding: 8px 0;
    text-align: right;
  }
  .nav-auth {
    display: none;
  }
  .nav-auth-mobile {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 10px;
  }
  .nav-toggle {
    display: block;
  }
}

/* Overlay pour menu mobile (pages login/register) */
.nav-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.35); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); opacity: 0; visibility: hidden; transition: opacity .25s ease, visibility .25s ease; z-index: 1900; }
.nav-overlay.show { opacity: 1; visibility: visible; }

/* --- Animation --- */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* --- Responsive --- */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.6rem;
  color: var(--text);
  cursor: pointer;
}
@media (max-width: 780px) {
  .nav-links, .nav-auth {
    display: none;
  }
  .nav-toggle {
    display: block;
  }
}

/* HEADER */
.app-header {
  padding: clamp(16px, 3vw, 32px);
  text-align: center;
}
h1 {
  font-size: clamp(28px, 5vw, 44px);
  margin: 0;
}

/* Login styles */
.auth-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
    pointer-events: none;
}

.auth-form {
    background: rgba(24, 96, 124, 0.2);
    backdrop-filter: blur(10px);
    padding: 40px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.2);
    width: 100%;
    max-width: 400px;
    pointer-events: all;
}

.auth-form h2 {
    color: #fff;
    text-align: center;
    margin-bottom: 30px;
    font-size: 28px;
    font-weight: 500;
}

.form-group {
    position: relative;
    margin-bottom: 30px;
}

.form-group input {
    width: 100%;
    padding: 10px 0;
    font-size: 16px;
    color: #fff;
    background: transparent;
    border: none;
    border-bottom: 2px solid rgba(255, 255, 255, 0.3);
    outline: none;
    transition: 0.3s;
}

.form-group label {
    position: absolute;
    top: 0;
    left: 0;
    padding: 10px 0;
    font-size: 16px;
    color: rgba(255, 255, 255, 0.7);
    pointer-events: none;
    transition: 0.3s;
}

.form-group input:focus,
.form-group input:valid {
    border-bottom-color: #7aa2ff;
}

.form-group input:focus~label,
.form-group input:valid~label {
    top: -20px;
    font-size: 12px;
    color: #7aa2ff;
}

.auth-button {
    background: #7aa2ff;
    border: none;
    padding: 12px 40px;
    color: #1B2735;
    font-size: 16px;
    font-weight: 600;
    border-radius: 25px;
    cursor: pointer;
    width: 100%;
    transition: 0.3s;
}

.auth-button:hover {
    background: #7aa2ff;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(96, 88, 213, 0.3);
}

.auth-link {
    text-align: center;
    margin-top: 15px;
    color: rgba(255, 255, 255, 0.7);
}

.auth-link a {
    color: #7aa2ff;
    text-decoration: none;
    transition: 0.3s;
}

.auth-link a:hover {
    color: #7aa2ff;
    text-decoration: underline;
}

/* Global site loader styles */
.site-loader {
    position: fixed;
    inset: 0;
    background: radial-gradient(ellipse at center, rgba(2, 6, 23, 0.95) 0%, rgba(2, 6, 23, 0.98) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity .4s ease, visibility .4s ease;
}

.site-loader.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.loader-inner {
    position: relative;
    width: 260px;
    height: 260px;
}

@keyframes snow {
    0% {
        opacity: 0;
        transform: translateY(0px);
    }

    20% {
        opacity: 1;
    }

    100% {
        opacity: 1;
        transform: translateY(650px);
    }
}

@keyframes astronautFloat {
    0% {
        opacity: 0;
        transform: translateY(0);
    }

    10% {
        opacity: 0.8;
    }

    90% {
        opacity: 0.8;
    }

    100% {
        opacity: 0;
        transform: translateY(calc(100vh + 300px)) rotate(360deg);
    }
}

@keyframes astronaut {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.bg-astronaut {
    width: 250px;
    height: 300px;
    position: absolute;
    z-index: 11;
    top: -300px;
    left: calc(50% - 125px);
    animation: astronautFloat 20s linear infinite;
}

.schoolbag {
    width: 100px;
    height: 150px;
    position: absolute;
    z-index: 1;
    top: calc(50% - 75px);
    left: calc(50% - 50px);
    background-color: #94b7ca;
    border-radius: 50px 50px 0 0 / 30px 30px 0 0;
}

.head {
    width: 97px;
    height: 80px;
    position: absolute;
    z-index: 3;
    background: -webkit-linear-gradient(left, #e3e8eb 0%, #e3e8eb 50%, #fbfdfa 50%, #fbfdfa 100%);
    border-radius: 50%;
    top: 34px;
    left: calc(50% - 47.5px);
}

.head:after {
    content: "";
    width: 60px;
    height: 50px;
    position: absolute;
    top: calc(50% - 25px);
    left: calc(50% - 30px);
    background: -webkit-linear-gradient(top, #15aece 0%, #15aece 50%, #0391bf 50%, #0391bf 100%);
    border-radius: 15px;
}

.head:before {
    content: "";
    width: 12px;
    height: 25px;
    position: absolute;
    top: calc(50% - 12.5px);
    left: -4px;
    background-color: #618095;
    border-radius: 5px;
    box-shadow: 92px 0px 0px #618095;
}

.body {
    width: 85px;
    height: 100px;
    position: absolute;
    z-index: 2;
    background-color: #fffbff;
    border-radius: 40px / 20px;
    top: 105px;
    left: calc(50% - 41px);
    background: -webkit-linear-gradient(left, #e3e8eb 0%, #e3e8eb 50%, #fbfdfa 50%, #fbfdfa 100%);
}

.panel {
    width: 60px;
    height: 40px;
    position: absolute;
    top: 20px;
    left: calc(50% - 30px);
    background-color: #b7cceb;
}

.panel:before {
    content: "";
    width: 30px;
    height: 5px;
    position: absolute;
    top: 9px;
    left: 7px;
    background-color: #fbfdfa;
    box-shadow: 0px 9px 0px #fbfdfa, 0px 18px 0px #fbfdfa;
}

.panel:after {
    content: "";
    width: 8px;
    height: 8px;
    position: absolute;
    top: 9px;
    right: 7px;
    background-color: #fbfdfa;
    border-radius: 50%;
    box-shadow: 0px 14px 0px 2px #fbfdfa;
}

.arm {
    width: 80px;
    height: 30px;
    position: absolute;
    top: 121px;
    z-index: 2;
}

.arm-left {
    left: 30px;
    background-color: #e3e8eb;
    border-radius: 0 0 0 39px;
}

.arm-right {
    right: 30px;
    background-color: #fbfdfa;
    border-radius: 0 0 39px 0;
}

.arm-left:before,
.arm-right:before {
    content: "";
    width: 30px;
    height: 70px;
    position: absolute;
    top: -40px;
}

.arm-left:before {
    border-radius: 50px 50px 0px 120px / 50px 50px 0 110px;
    left: 0;
    background-color: #e3e8eb;
}

.arm-right:before {
    border-radius: 50px 50px 120px 0 / 50px 50px 110px 0;
    right: 0;
    background-color: #fbfdfa;
}

.arm-left:after,
.arm-right:after {
    content: "";
    width: 30px;
    height: 10px;
    position: absolute;
    top: -24px;
}

.arm-left:after {
    background-color: #6e91a4;
    left: 0;
}

.arm-right:after {
    right: 0;
    background-color: #b6d2e0;
}

.leg {
    width: 30px;
    height: 40px;
    position: absolute;
    z-index: 2;
    bottom: 70px;
}

.leg-left {
    left: 76px;
    background-color: #e3e8eb;
    transform: rotate(20deg);
}

.leg-right {
    right: 73px;
    background-color: #fbfdfa;
    transform: rotate(-20deg);
}

.leg-left:before,
.leg-right:before {
    content: "";
    width: 50px;
    height: 25px;
    position: absolute;
    bottom: -26px;
}

.leg-left:before {
    left: -20px;
    background-color: #e3e8eb;
    border-radius: 30px 0 0 0;
    border-bottom: 10px solid #6d96ac;
}

.leg-right:before {
    right: -20px;
    background-color: #fbfdfa;
    border-radius: 0 30px 0 0;
    border-bottom: 10px solid #b0cfe4;
}
