:root {
  --bg: #0b1020;
  --card: #161c33;
  --card-translucent: rgba(22, 28, 51, 0.7);
  --secondary: #222a47;
  --muted: #2a3252;
  --border: rgba(74, 86, 130, 0.45);
  --input-bg: rgba(42, 50, 82, 0.4);
  --foreground: #eef0f7;
  --muted-foreground: #97a0c0;
  --primary: #3bd3e6;
  --primary-15: rgba(59, 211, 230, 0.15);
  --primary-20: rgba(59, 211, 230, 0.2);
  --primary-40: rgba(59, 211, 230, 0.4);
  --primary-foreground: #0b1020;
  --danger: #ef4565;
  --accent-3: #8b6cf0;
  --radius: 0.85rem;
  --font: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
}

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

html,
body {
  height: 100%;
}

body {
  overflow-y: auto;     /*scrollbar visible */
  overflow-x: hidden;  /* pas de débordement horizontal */

  font-family: var(--font);
  background: var(--bg);
  color: var(--foreground);
  /*overflow: hidden;*/
  position: relative;
  -webkit-font-smoothing: antialiased;
}
.call-card::-webkit-scrollbar {
    width: 6px;           /*largeur de la barre*/
}

.call-card::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,.2);
    border-radius: 999px;    /*arrondi pour l'esthétique*/
}

.call-card .login-card {
    width: 100%;
}

/* Tablettes */
@media (max-width: 768px) {

  .stage {
    padding: .75rem;
    align-items: stretch;
  }

  .container {
    width: 100%;
  }

  .call-card {
    width: 100%;
    max-width: none;
    border-radius: 1rem;
    padding: 1rem;
    gap: 1rem;
  }

  .call-head {
    align-items: flex-start;
    gap: .75rem;
  }

  .count-pill {
    align-self: flex-end;
  }

  .self-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 1rem;
  }

  .self-left {
    justify-content: center;
  }

  .controls {
    justify-content: center;
    flex-wrap: wrap;
  }

  .coords-container {
    flex-wrap: wrap;
    gap: .75rem;
    padding: 1rem;
  }

  .coord-box {
    flex: 1 1 90px;
  }

  .coord-box input {
    width: 100%;
    min-width: 70px;
    font-size: 1rem;
  }

  .participant-list {
    max-height: 30vh;
  }

  .participant {
    padding: .65rem;
  }
}

/* Smartphones */
@media (max-width: 480px) {

  .call-card {
    padding: .9rem;
    border-radius: .8rem;
  }

  .room-name {
    font-size: 1rem;
  }

  .field-label {
    font-size: .72rem;
  }

  .btn-icon {
    width: 48px;
    height: 48px;
  }

  .icon-md {
    width: 20px;
    height: 20px;
  }

  .avatar-self {
    width: 42px;
    height: 42px;
    font-size: .8rem;
  }

  .participant {
    gap: .6rem;
  }

  .avatar-p {
    width: 36px;
    height: 36px;
  }

  .p-name {
    font-size: .82rem;
  }

  .volume {
    height: 5px;
  }

  .coord-box label {
    font-size: .7rem;
  }

  .coord-box input {
    font-size: .95rem;
    padding: .5rem;
  }
}

.hidden {
  display: none !important;
}

/* ---------- Starfield ---------- */
.starfield {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}

.glow {
  position: absolute;
  border-radius: 9999px;
  filter: blur(120px);
}

.glow-1 {
  top: -30%;
  left: 50%;
  width: 60vh;
  height: 60vh;
  transform: translateX(-50%);
  background: var(--primary-15);
}

.glow-2 {
  bottom: -10%;
  right: -10%;
  width: 42vh;
  height: 42vh;
  background: rgba(139, 108, 240, 0.15);
}

.stars span {
  position: absolute;
  border-radius: 9999px;
  background: var(--foreground);
  animation: twinkle var(--d, 4s) ease-in-out infinite;
}

@keyframes twinkle {
  0%,
  100% {
    opacity: 0.2;
  }
  50% {
    opacity: 1;
  }
}

@keyframes pulse-ring {
  0% {
    transform: scale(0.95);
    opacity: 0.7;
  }
  70% {
    transform: scale(1.25);
    opacity: 0;
  }
  100% {
    opacity: 0;
  }
}

/*----------- Social links ---------- */
.footer {
    position: fixed;
    left: 0;
    bottom: 0;
    width: 100%;
    z-index: 1000;

    background: rgba(10,10,20,.8);
    backdrop-filter: blur(10px);
    border-top: 1px solid rgba(255,255,255,.1);
    padding: 12px 20px;
}

.footer-content {
    max-width: 1200px;
    margin: auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #bbb;
    font-size: 14px;
}

.social-links {
    display: flex;
    gap: 18px;
}

.social-links a {
    color: #fff;
    font-size: 22px;
    transition: .25s;
}

.social-links a:hover {
    color: #8b5cf6;
    transform: translateY(-3px) scale(1.1);
}


/*---------- Status Text---------- */
.green {
  color: #00ff00;
}

.red {
  color: #ff5252;
}

.orange {
  color: orange;
}

/* ---------- Stage ---------- */
.stage {
  position: relative;
  z-index: 1;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

/* ---------- Card ---------- */
.card {
  width: 100%;
  border: 1px solid var(--border);
  background: var(--card-translucent);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 1.5rem;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.login-card {
  padding: 2rem;
}

.call-card {
  max-height: calc(100vh - 2rem);
  overflow-y: auto;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

/* ---------- Login ---------- */
.login-head {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-bottom: 2rem;
}

.logo-badge {
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--primary-15);
  box-shadow: inset 0 0 0 1px var(--primary-40);
  color: var(--primary);
  margin-bottom: 1rem;
}

.title {
  font-size: 1.8rem;
  font-weight: bold;
  letter-spacing: 0.05em;
}

.subtitle {
  margin-top: 0.25rem;
  font-size: 0.875rem;
  color: var(--muted-foreground);
  line-height: 1.5;
}

.form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

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

.field-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 500;
}

input[type="text"],
.select {
  padding: 0 .85rem;
  height: 2.75rem;
  width: 100%;
  border-radius: 0.65rem;
  border: 1px solid var(--border);
  background: var(--input-bg);
  color: var(--foreground);
  font-size: 0.9rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

input[type="text"]::placeholder {
  color: var(--muted-foreground);
}

input[type="text"]:focus,
.select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-20);
}

.select {
  padding-right: 2.5rem;
  appearance: none;
  -webkit-appearance: none;

  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2397a0c0' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.85rem center;
  background-size: 16px;
  cursor: pointer;
}

.select option {
  background: var(--card);
  color: var(--foreground);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border: none;
  border-radius: 0.65rem;
  font-family: inherit;
  font-weight: 500;
  cursor: pointer;
  transition: filter 0.15s, background 0.15s, opacity 0.15s;
}

.btn-block {
  height: 2.75rem;
  width: 100%;
  font-size: 1rem;
  margin-top: 0.5rem;
}

.btn-primary {
  background: var(--primary);
  color: var(--primary-foreground);
}

.btn-primary:hover:not(:disabled) {
  filter: brightness(1.08);
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn-icon {
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 9999px;
  flex-shrink: 0;
}

.btn-secondary {
  background: var(--danger);
  color: var(--foreground);
}

.btn-danger {
  background: var(--danger);
  color: #fff;
}

.btn-danger:hover {
  filter: brightness(1.08);
}

/* ---------- Call header ---------- */
.call-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.eyebrow {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--primary);
}

.room-name {
  font-size: 1.125rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.count-pill {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--secondary);
  border-radius: 9999px;
  padding: 0.4rem 0.75rem;
  font-size: 0.75rem;
  color: var(--muted-foreground);
}

/* ---------- Self bar ---------- */
.self-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  background: rgba(34, 42, 71, 0.6);
  border-radius: 1rem;
  padding: 1rem;
}

.self-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}

.avatar-wrap {
  position: relative;
  flex-shrink: 0;
}

.avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 9999px;
  font-weight: 600;
}

.avatar-self {
  width: 2.75rem;
  height: 2.75rem;
  font-size: 0.85rem;
  background: var(--primary);
  color: var(--primary-foreground);
}

.pulse-ring {
  position: absolute;
  inset: 0;
  border-radius: 9999px;
  background: var(--primary-40);
  animation: pulse-ring 2.4s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

.self-name {
  font-size: 0.9rem;
  font-weight: 500;
}

.self-status {
  font-size: 0.75rem;
  color: var(--muted-foreground);
}

.controls {
  display: flex;
  gap: 0.5rem;
}

/* ---------- Participants ---------- */
.participants {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.participant-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  max-height: 15rem;
  overflow-y: auto;
}

.participant {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  border: 1px solid var(--border);
  background: rgba(34, 42, 71, 0.4);
  border-radius: 0.75rem;
  padding: 0.75rem;
}

.avatar-p {
  width: 2.25rem;
  height: 2.25rem;
  font-size: 0.7rem;
  background: var(--muted);
  color: var(--muted-foreground);
  transition: box-shadow 0.2s, background 0.2s, color 0.2s;
}

.avatar-p.speaking {
  background: var(--primary-20);
  color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary);
}

.p-body {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  flex: 1;
  min-width: 0;
}

.p-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.p-name {
  font-size: 0.875rem;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.p-volume-label {
  flex-shrink: 0;
  font-size: 0.75rem;
  color: var(--muted-foreground);
  font-variant-numeric: tabular-nums;
}

.p-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.mute-toggle {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  color: var(--muted-foreground);
  display: inline-flex;
  flex-shrink: 0;
  transition: color 0.15s;
}

.mute-toggle:hover {
  color: var(--foreground);
}

.mute-toggle.muted {
  color: var(--danger);
}

/* ---------- Range slider ---------- */
.volume {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 0.375rem;
  border-radius: 9999px;
  background: var(--muted);
  cursor: pointer;
  outline: none;
}

.volume:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.volume::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 0.95rem;
  height: 0.95rem;
  border-radius: 9999px;
  background: var(--primary);
  border: 2px solid var(--card);
  cursor: pointer;
}

.volume::-moz-range-thumb {
  width: 0.95rem;
  height: 0.95rem;
  border-radius: 9999px;
  background: var(--primary);
  border: 2px solid var(--card);
  cursor: pointer;
}

/* ---------- Icons ---------- */
.icon-sm {
  width: 0.875rem;
  height: 0.875rem;
}
.icon-md {
  width: 1.25rem;
  height: 1.25rem;
}
.icon-lg {
  width: 1.75rem;
  height: 1.75rem;
}
.icon-vol {
  width: 1rem;
  height: 1rem;
}

.coords-container {
  display: flex;
  background: rgba(34, 42, 71, 0.6);
  border-radius: 1rem;
  padding: 1.2rem;
  justify-content: center;
  gap: 20px;
}
.coord-box {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.coord-box label { font-size: 0.8rem; color: var(--muted-foreground); margin-bottom: 5px; }
.coord-box input {
  width: 100px;
  font-size: 1.2rem;
  border-radius: 1rem;
  text-align: center;
}