:root {
  --bg-gradient-start: #111827;
  --bg-gradient-end: #020617;
  --accent: #facc15;
  --accent-soft: rgba(250, 204, 21, 0.16);
  --card-bg: #020617;
  --card-border: rgba(148, 163, 184, 0.4);
  --text-main: #e5e7eb;
  --text-muted: #9ca3af;
  --error: #f87171;
  --success: #4ade80;
  --input-bg: rgba(15, 23, 42, 0.9);
  --input-border: rgba(148, 163, 184, 0.5);
  --shadow-soft: 0 24px 60px rgba(15, 23, 42, 0.85);
  --radius-lg: 18px;
  --radius-xl: 26px;
  --transition-fast: 180ms ease-out;
  --transition-med: 220ms ease-out;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: "Poppins", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body {
  min-height: 100vh;
  background: radial-gradient(circle at top, #1e293b, #020617 55%, #000 100%);
  color: var(--text-main);
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 24px;
}

/* APP SHELL */

.app-shell {
  width: 100%;
  max-width: 1080px;
  background: linear-gradient(
    135deg,
    rgba(15, 23, 42, 0.96),
    rgba(17, 24, 39, 0.98)
  );
  border-radius: 32px;
  border: 1px solid rgba(148, 163, 184, 0.4);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  backdrop-filter: blur(16px);
  position: relative;
}

.halo {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 12% 0%, rgba(250, 204, 21, 0.13), transparent 55%),
    radial-gradient(circle at 100% 10%, rgba(59, 130, 246, 0.13), transparent 55%);
  opacity: 0.9;
  mix-blend-mode: screen;
}

.app-content {
  position: relative;
  z-index: 1;
  padding: 20px 24px 24px;
}

/* NAVBAR */

.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  gap: 20px;
}

.logo-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-icon {
  width: 38px;
  height: 38px;
  border-radius: 14px;
  background: radial-gradient(circle at 30% 0%, #facc15, #f97316);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 30px rgba(250, 204, 21, 0.55);
  position: relative;
  overflow: hidden;
}

.logo-icon::before,
.logo-icon::after {
  content: "";
  position: absolute;
  border-radius: 999px;
  border: 1px solid rgba(250, 250, 250, 0.7);
  opacity: 0.7;
}

.logo-icon::before {
  width: 18px;
  height: 18px;
}

.logo-icon::after {
  width: 8px;
  height: 8px;
}

.logo-text-main {
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: 0.03em;
  display: flex;
  align-items: center;
  gap: 4px;
}

.logo-pill {
  font-size: 0.7rem;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(148, 163, 184, 0.5);
  color: var(--text-muted);
}

.logo-sub {
  font-size: 0.74rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  background: rgba(15, 23, 42, 0.9);
  padding: 4px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.4);
}

.nav-link,
.nav-cta {
  border-radius: 999px;
  border: none;
  padding: 6px 12px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background var(--transition-fast), color var(--transition-fast),
    transform var(--transition-fast), box-shadow var(--transition-fast),
    filter var(--transition-fast);
  font-size: 0.82rem;
  text-decoration: none;
}

.nav-link span.icon,
.nav-cta span.icon {
  font-size: 0.9rem;
}

.nav-link:hover {
  background: rgba(15, 23, 42, 0.95);
  color: var(--text-main);
  transform: translateY(-1px);
}

.nav-cta {
  margin-left: 6px;
  padding: 6px 13px;
  background: linear-gradient(135deg, #facc15, #f97316);
  color: #111827;
  font-weight: 600;
  box-shadow: 0 10px 25px rgba(249, 115, 22, 0.4);
}

.nav-cta:hover {
  transform: translateY(-1px) scale(1.01);
  filter: brightness(1.04);
  box-shadow: 0 16px 35px rgba(249, 115, 22, 0.5);
}

/* LAYOUT */

.main-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.9fr);
  gap: 26px;
  align-items: stretch;
}

@media (max-width: 860px) {
  .app-shell {
    border-radius: 24px;
  }

  .navbar {
    flex-direction: column;
    align-items: flex-start;
  }

  .main-layout {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 640px) {
  .app-content {
    padding: 16px;
  }
}

/* HERO */

.hero {
  padding: 18px 18px 16px;
}

.hero-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  padding: 4px 9px;
  font-size: 0.75rem;
  color: var(--text-muted);
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(148, 163, 184, 0.4);
  margin-bottom: 10px;
}

.hero-label-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 12px rgba(250, 204, 21, 0.8);
}

.hero-title {
  font-size: clamp(1.7rem, 2vw, 2rem);
  font-weight: 700;
  margin-bottom: 8px;
  letter-spacing: 0.01em;
}

.hero-highlight {
  background: linear-gradient(135deg, #facc15, #f97316);
  -webkit-background-clip: text;
  color: transparent;
}

.hero-subtitle {
  font-size: 0.9rem;
  color: var(--text-muted);
  max-width: 420px;
  margin-bottom: 16px;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 10px;
}

.chip {
  padding: 6px 9px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.5);
  font-size: 0.75rem;
  color: var(--text-muted);
  background: rgba(15, 23, 42, 0.85);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.chip-dot {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: rgba(250, 204, 21, 0.9);
}

.hero-footer-text {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* FORM CARD */

.form-card {
  background: radial-gradient(circle at top left, rgba(250, 204, 21, 0.1), transparent 55%),
  radial-gradient(circle at bottom right, rgba(56, 189, 248, 0.1), transparent 55%),
  var(--card-bg);
  border-radius: var(--radius-xl);
  border: 1px solid var(--card-border);
  padding: 18px 18px 16px;
  box-shadow: 0 20px 45px rgba(15, 23, 42, 0.9);
  position: relative;
  overflow: hidden;
}

.form-header {
  margin-bottom: 14px;
}

.form-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 4px;
}

.form-title {
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.form-pill {
  font-size: 0.7rem;
  padding: 2px 7px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.6);
  color: var(--text-muted);
  background: rgba(15, 23, 42, 0.95);
}

.form-subtitle {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ALERTES */

.alert {
  display: none;
  padding: 8px 10px;
  border-radius: 12px;
  font-size: 0.8rem;
  margin-bottom: 12px;
  border: 1px solid transparent;
}

.alert.error {
  background: rgba(248, 113, 113, 0.08);
  border-color: rgba(248, 113, 113, 0.7);
  color: #fecaca;
}

.alert.success {
  background: rgba(74, 222, 128, 0.08);
  border-color: rgba(74, 222, 128, 0.7);
  color: #bbf7d0;
}

.alert-visible {
  display: block !important;
}

/* FORM */

form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.field label {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.field label .required {
  color: rgba(248, 113, 113, 0.9);
  margin-left: 4px;
}

.input-wrap {
  position: relative;
}

.input-wrap input {
  width: 100%;
  border-radius: 12px;
  border: 1px solid var(--input-border);
  background: var(--input-bg);
  color: var(--text-main);
  padding: 8px 11px;
  font-size: 0.85rem;
  outline: none;
  transition: border-color var(--transition-fast),
  box-shadow var(--transition-fast), background var(--transition-fast),
  transform var(--transition-fast);
}

.input-wrap input::placeholder {
  color: rgba(148, 163, 184, 0.7);
}

.input-wrap input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px rgba(250, 204, 21, 0.6);
  transform: translateY(-0.5px);
  background: rgba(15, 23, 42, 0.95);
}

.input-wrap input.error {
  border-color: rgba(248, 113, 113, 0.9);
  box-shadow: 0 0 0 1px rgba(248, 113, 113, 0.5);
}

.field-message {
  font-size: 0.75rem;
  color: var(--text-muted);
  min-height: 14px;
}

.field-message.error {
  color: var(--error);
}

/* OPTIONS ROW */

.options-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 4px;
}

.remember {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  color: var(--text-muted);
  cursor: pointer;
}

.remember input[type="checkbox"] {
  width: 15px;
  height: 15px;
  accent-color: #facc15;
  cursor: pointer;
}

.link-small {
  font-size: 0.78rem;
  color: var(--accent);
  text-decoration: none;
}

.link-small:hover {
  text-decoration: underline;
}

/* FOOTER FORM */

.form-footer {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
}

.btn-submit {
  border-radius: 999px;
  border: none;
  padding: 9px 14px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: linear-gradient(135deg, #facc15, #f97316);
  color: #111827;
  box-shadow: 0 14px 30px rgba(249, 115, 22, 0.55);
  transition: transform var(--transition-med), box-shadow var(--transition-med),
  filter var(--transition-med);
}

.btn-submit:hover {
  transform: translateY(-1px) scale(1.01);
  filter: brightness(1.03);
  box-shadow: 0 18px 40px rgba(249, 115, 22, 0.6);
}

.btn-submit:active {
  transform: translateY(0) scale(0.99);
  box-shadow: 0 10px 22px rgba(249, 115, 22, 0.5);
}

.btn-submit .icon {
  font-size: 1rem;
}

.login-hint {
  font-size: 0.78rem;
  color: var(--text-muted);
  text-align: center;
}

.login-hint a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
}

.login-hint a:hover {
  text-decoration: underline;
}

@media (max-width: 480px) {
  .options-row {
    flex-direction: column;
    align-items: flex-start;
  }
}
.loader {
  position: fixed;
  inset: 0;
  background: rgba(6, 10, 20, 0.65);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  z-index: 999;
}

.loader-visible {
  opacity: 1;
  pointer-events: auto;
}

.loader-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  padding: 1.5rem 2rem;
  background: rgba(15, 23, 42, 0.95);
  border-radius: 1rem;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
}

.loader-spinner {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  border: 3px solid rgba(148, 163, 184, 0.4);
  border-top-color: #fff;
  animation: spin 0.8s linear infinite;
}

.loader-text {
  color: #e5e7eb;
  font-size: 0.95rem;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
.form-footer {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  align-items: flex-start;
}

.submit-block {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.5rem;
  width: 100%;
}

.inline-loader {
  display: none;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  color: #9ca3af; /* gris discret */
}

.inline-loader-visible {
  display: flex;
}

.inline-spinner {
  width: 18px;
  height: 18px;
  border-radius: 999px;
  border: 2px solid rgba(148, 163, 184, 0.4);
  border-top-color: #fbbf24; /* proche de ton orange */
  animation: spin 0.8s linear infinite;
}

.btn-submit[disabled] {
  opacity: 0.6;
  cursor: default;
}

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

/* Modal forgot password */
.modal.hidden { display: none !important; }
.modal { position: fixed; inset: 0; z-index: 9999; display: grid; place-items: center; }

.modal-backdrop {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(6px);
}

.modal-card {
  position: relative;
  width: min(520px, calc(100% - 24px));
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-soft);
  padding: 18px;
  z-index: 1;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
}

.modal-header h3 { font-size: 1rem; }
.modal-subtitle { color: var(--text-muted); font-size: 0.85rem; margin-bottom: 14px; }

.modal-close {
  border: 1px solid rgba(148, 163, 184, 0.5);
  background: transparent;
  color: var(--text-main);
  border-radius: 10px;
  padding: 6px 10px;
  cursor: pointer;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 14px;
}

#forgotMsg { font-size: 0.78rem; margin-top: 6px; color: var(--text-muted); }
#forgotMsg.error { color: #fecaca; }
#forgotMsg.success { color: #bbf7d0; }
.verify-box{
  margin-top: 12px;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid rgba(148,163,184,0.35);
  background: rgba(15,23,42,0.55);
}
.verify-title{
  font-weight: 700;
  font-size: .9rem;
  margin-bottom: 4px;
}
.verify-text{
  color: var(--text-muted);
  font-size: .82rem;
  margin-bottom: 10px;
}
