/* Réinitialisation minimale, typographie de base, écran de connexion. */

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; overflow: hidden; overscroll-behavior: none; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--text); background: var(--bg); font-size: 16px; line-height: 1.6;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  transition: background .3s ease, color .3s ease;
}

button { font-family: inherit; color: inherit; }
::selection { background: var(--accent-soft); }
.serif { font-family: var(--serif); }

/* ============ CONNEXION ============ */
#login-screen {
  position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center; padding: 20px;
  background:
    radial-gradient(120% 80% at 50% -10%, #cfe3ff 0%, transparent 55%),
    linear-gradient(180deg, #eaf2ff 0%, var(--bg) 70%);
}
:root[data-theme="dark"] #login-screen {
  background: radial-gradient(120% 80% at 50% -10%, #1b2a4a 0%, transparent 55%), linear-gradient(180deg, #12161f 0%, var(--bg) 70%);
}
.login-card {
  background: var(--card); border: 1px solid var(--border); box-shadow: var(--shadow-lg);
  border-radius: var(--r-xl); padding: 44px 40px 38px; width: min(400px, 92vw); text-align: center;
}
.login-card .logo {
  font-size: 38px; line-height: 1; width: 78px; height: 78px; margin: 0 auto;
  display: flex; align-items: center; justify-content: center; border-radius: 22px;
  background: var(--panel-2); box-shadow: inset 0 0 0 1px var(--border);
}
.login-card h1 { font-family: var(--serif); font-size: 30px; margin: 18px 0 4px; letter-spacing: -.01em; font-weight: 600; }
.login-card .subtitle { font-size: 13.5px; color: var(--text-dim); margin-bottom: 26px; }
.login-card form { display: flex; flex-direction: column; gap: 11px; }
.login-card input {
  padding: 14px 16px; border-radius: var(--r-sm); border: 1px solid var(--border);
  background: var(--panel-2); color: var(--text); font-size: 16px; text-align: center;
  outline: none; transition: border-color .2s, box-shadow .2s;
}
.login-card input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }

.login-card button, .contact-form button, #loader-error button {
  padding: 14px; border-radius: var(--r-sm); border: none; cursor: pointer;
  background: var(--btn); color: var(--btn-text); font-size: 15.5px; font-weight: 600;
  transition: transform .12s var(--ease), opacity .2s;
}
.login-card button:hover, .contact-form button:hover, #loader-error button:hover { opacity: .88; }
.login-card button:active, .contact-form button:active { transform: scale(.98); }
.login-error { color: var(--red); font-size: 13.5px; min-height: 20px; margin: 2px 0 0; }
@keyframes shake {
  0%, 100% { transform: translateX(0); } 20% { transform: translateX(-9px); } 40% { transform: translateX(9px); }
  60% { transform: translateX(-6px); } 80% { transform: translateX(6px); }
}
.login-card.shake { animation: shake .45s ease; }

/* ============ CHARGEMENT ============ */
#loader-screen {
  position: fixed; inset: 0; z-index: 900; display: none; align-items: center; justify-content: center;
  flex-direction: column; gap: 18px; color: var(--text-dim); background: var(--bg);
}
.spinner { width: 42px; height: 42px; border-radius: 50%; border: 3px solid var(--border); border-top-color: var(--accent); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
#loader-msg { font-size: 15px; }
#loader-error { display: none; text-align: center; max-width: 420px; padding: 0 20px; }
#loader-error button { margin-top: 14px; padding: 11px 22px; }

/* Squelettes affichés pendant qu'un cours arrive (jamais de page blanche). */
.skeleton { padding: 6px 0; }
.sk-line { height: 14px; border-radius: 7px; margin: 14px 0; background: var(--panel-2); animation: skPulse 1.4s ease-in-out infinite; }
.sk-line.sk-title { height: 30px; width: 62%; margin: 6px 0 26px; }
.sk-line.sk-short { width: 45%; }
.sk-line.sk-medium { width: 78%; }
.sk-block { height: 170px; border-radius: var(--r); margin: 22px 0; background: var(--panel-2); animation: skPulse 1.4s ease-in-out infinite; }
@keyframes skPulse { 0%, 100% { opacity: 1; } 50% { opacity: .5; } }
