/* ============================================================
   conf.aasterisk.org — Aurora Glass UI
   ============================================================ */
:root {
  --bg-0: #070a16;
  --bg-1: #0d1124;
  --glass: rgba(22, 27, 51, 0.55);
  --glass-2: rgba(34, 40, 74, 0.5);
  --stroke: rgba(255, 255, 255, 0.08);
  --stroke-2: rgba(255, 255, 255, 0.14);
  --txt: #eef1ff;
  --muted: #99a0c8;
  --accent: #7c83ff;     /* индиго-фиолет */
  --accent-2: #22d3a6;   /* emerald — «живое» */
  --danger: #f0556b;
  --radius: 16px;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  color: var(--txt);
  background: var(--bg-0);
  -webkit-font-smoothing: antialiased;
}

/* Аврора-фон */
body::before {
  content: "";
  position: fixed; inset: 0; z-index: -1;
  background:
    radial-gradient(60vw 60vw at 12% -8%, rgba(124, 131, 255, 0.30), transparent 60%),
    radial-gradient(55vw 55vw at 98% 8%, rgba(34, 211, 166, 0.20), transparent 55%),
    radial-gradient(60vw 50vw at 50% 115%, rgba(168, 85, 247, 0.20), transparent 60%),
    linear-gradient(180deg, var(--bg-1), var(--bg-0));
}

button { font: inherit; cursor: pointer; border: none; color: var(--txt); }
button:disabled { opacity: 0.4; cursor: not-allowed; }
a { color: var(--accent); }

/* ---------- Glass-утилита ---------- */
.glass {
  background: var(--glass);
  border: 1px solid var(--stroke);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
}

/* ============================================================
   AUTH (вход / регистрация)
   ============================================================ */
.auth-page { display: grid; place-items: center; min-height: 100vh; padding: 24px; }
.card {
  width: 380px; max-width: 100%;
  padding: 34px;
  border-radius: 22px;
  box-shadow: var(--shadow);
  background: var(--glass);
  border: 1px solid var(--stroke-2);
  backdrop-filter: blur(22px) saturate(150%);
  -webkit-backdrop-filter: blur(22px) saturate(150%);
}
.logo {
  display: flex; align-items: center; gap: 12px; margin-bottom: 6px;
}
.logo .dot {
  width: 38px; height: 38px; border-radius: 12px; flex: none;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 8px 24px rgba(124, 131, 255, 0.45);
  display: grid; place-items: center;
}
.logo .dot svg { width: 20px; height: 20px; }
.card h1 { margin: 0; font-size: 21px; letter-spacing: -0.02em; }
.sub { margin: 2px 0 22px; color: var(--muted); font-size: 13px; }

.tabs { display: flex; gap: 6px; margin-bottom: 18px; padding: 5px; border-radius: 12px;
        background: rgba(0,0,0,0.22); border: 1px solid var(--stroke); }
.tab { flex: 1; padding: 10px; border-radius: 9px; background: transparent; color: var(--muted);
       font-size: 14px; font-weight: 500; transition: 0.18s; }
.tab.active { background: rgba(255,255,255,0.08); color: var(--txt); box-shadow: 0 2px 10px rgba(0,0,0,0.25); }

.form { display: flex; flex-direction: column; gap: 12px; }
.form.hidden { display: none; }
input, .input {
  padding: 13px 14px; border-radius: 12px; font-size: 14px; color: var(--txt);
  background: rgba(0,0,0,0.25); border: 1px solid var(--stroke);
  transition: border-color 0.18s, box-shadow 0.18s;
}
input::placeholder { color: #6b72a0; }
input:focus { outline: none; border-color: var(--accent);
              box-shadow: 0 0 0 3px rgba(124,131,255,0.22); }

.btn-primary {
  padding: 13px; border-radius: 12px; font-weight: 600; font-size: 14px;
  background: linear-gradient(135deg, var(--accent), #6a5cff);
  box-shadow: 0 10px 26px rgba(108, 99, 255, 0.4);
  transition: transform 0.12s, filter 0.18s;
}
.btn-primary:hover:not(:disabled) { filter: brightness(1.08); }
.btn-primary:active { transform: translateY(1px); }

.msg { min-height: 18px; margin-top: 14px; font-size: 13px; text-align: center; }
.msg.err { color: var(--danger); }
.msg.ok { color: var(--accent-2); }

/* ============================================================
   CONFERENCE
   ============================================================ */
.conf-page { display: flex; flex-direction: column; height: 100vh; overflow: hidden; }

.topbar {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 18px; flex: none;
  border-bottom: 1px solid var(--stroke);
  background: rgba(10, 13, 30, 0.5);
  backdrop-filter: blur(14px);
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; letter-spacing: -0.01em; }
.brand .dot { width: 30px; height: 30px; border-radius: 9px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  display: grid; place-items: center; }
.brand .dot svg { width: 16px; height: 16px; }
.room-pill { font-size: 13px; color: var(--muted); padding: 6px 12px; border-radius: 999px;
  background: rgba(255,255,255,0.05); border: 1px solid var(--stroke); }
.room-pill b { color: var(--txt); }
.spacer { flex: 1; }
.me-chip { display: flex; align-items: center; gap: 9px; font-size: 13px; color: var(--muted); }
.avatar { width: 30px; height: 30px; border-radius: 50%; flex: none;
  display: grid; place-items: center; font-size: 13px; font-weight: 700; color: #0b0f20;
  background: linear-gradient(135deg, var(--accent-2), var(--accent)); }

.stage { flex: 1; display: flex; min-height: 0; }

/* --- видео-зона --- */
.video-area { flex: 1; display: flex; flex-direction: column; min-width: 0; position: relative; }
.status-banner { padding: 9px 16px; font-size: 13px; color: var(--muted); }
.status-banner .live { color: var(--accent-2); font-weight: 600; }

.videos {
  flex: 1; min-height: 0; overflow: auto;
  display: grid; gap: 14px; padding: 6px 18px 16px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  align-content: start;
}
.tile {
  position: relative; border-radius: var(--radius); overflow: hidden;
  background: #05070f; aspect-ratio: 16 / 10;
  border: 1px solid var(--stroke); box-shadow: 0 10px 28px rgba(0,0,0,0.35);
}
.tile video { width: 100%; height: 100%; object-fit: cover; display: block; background: #05070f; }
.tile .label {
  position: absolute; left: 10px; bottom: 10px; padding: 4px 10px; border-radius: 8px;
  font-size: 12px; font-weight: 500;
  background: rgba(0,0,0,0.55); backdrop-filter: blur(6px); border: 1px solid var(--stroke);
}
.tile.self { border-color: rgba(124,131,255,0.5); box-shadow: 0 0 0 1px rgba(124,131,255,0.3), 0 10px 28px rgba(0,0,0,0.35); }

/* плитка без камеры — аватар-заглушка */
.tile .cam-off { position: absolute; inset: 0; display: none; place-items: center;
  background: radial-gradient(circle at 50% 38%, #1b2142, #05070f); }
.tile.no-cam video { display: none; }
.tile.no-cam .cam-off { display: grid; }
.avatar.big { width: 88px; height: 88px; border-radius: 50%; font-size: 36px;
  display: grid; place-items: center; font-weight: 700; color: #04120d;
  background: linear-gradient(135deg, var(--accent-2), var(--accent)); }

/* --- панель управления (плавающая «пилюля») --- */
.controlbar {
  position: absolute; left: 50%; bottom: 18px; transform: translateX(-50%);
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 999px;
  background: var(--glass-2); border: 1px solid var(--stroke-2);
  backdrop-filter: blur(20px) saturate(150%); box-shadow: var(--shadow);
}
.ctrl {
  width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(255,255,255,0.08); border: 1px solid var(--stroke);
  transition: 0.15s;
}
.ctrl svg { width: 21px; height: 21px; }
.ctrl:hover:not(:disabled) { background: rgba(255,255,255,0.16); }
.ctrl.off { background: var(--danger); border-color: transparent; }
.ctrl.active { background: linear-gradient(135deg, var(--accent-2), #1bbf95); border-color: transparent; color: #04120d; }
.ctrl.hangup { background: var(--danger); width: 56px; }
.ctrl.hangup:hover { filter: brightness(1.08); }
.ctrl.join { width: auto; padding: 0 22px; border-radius: 999px; font-weight: 600;
  background: linear-gradient(135deg, var(--accent-2), #1bbf95); color: #04120d; }
.room-field {
  width: 92px; text-align: center; padding: 11px 10px; border-radius: 999px;
  background: rgba(0,0,0,0.3); border: 1px solid var(--stroke); color: var(--txt); font-size: 14px;
}
.ctrl.tgl-side { display: none; }

/* --- боковая панель (чат / участники) --- */
.side {
  width: 340px; flex: none; display: flex; flex-direction: column; min-height: 0;
  border-left: 1px solid var(--stroke); background: rgba(10, 13, 30, 0.45);
  backdrop-filter: blur(16px);
}
.side.collapsed { display: none; }
.side-tabs { display: flex; gap: 6px; padding: 12px 12px 0; flex: none; }
.side-tabs button {
  flex: 1; padding: 10px; border-radius: 10px 10px 0 0; background: transparent; color: var(--muted);
  font-size: 13px; font-weight: 600; border-bottom: 2px solid transparent;
}
.side-tabs button.active { color: var(--txt); border-bottom-color: var(--accent); }
.side-tabs .count { font-size: 11px; color: #0b0f20; background: var(--accent-2);
  border-radius: 999px; padding: 1px 7px; margin-left: 5px; font-weight: 700; }

.pane { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.pane.hidden { display: none; }

/* чат */
.messages { flex: 1; min-height: 0; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.msg-row { display: flex; flex-direction: column; max-width: 86%; }
.msg-row.mine { align-self: flex-end; align-items: flex-end; }
.msg-meta { font-size: 11px; color: var(--muted); margin: 0 4px 3px; }
.bubble {
  padding: 9px 13px; border-radius: 14px; font-size: 14px; line-height: 1.4; word-break: break-word;
  background: var(--glass-2); border: 1px solid var(--stroke);
}
.msg-row.mine .bubble {
  background: linear-gradient(135deg, var(--accent), #6a5cff); border-color: transparent;
  border-bottom-right-radius: 4px;
}
.msg-row:not(.mine) .bubble { border-bottom-left-radius: 4px; }
.sys-line { align-self: center; font-size: 12px; color: var(--muted);
  background: rgba(255,255,255,0.05); padding: 4px 12px; border-radius: 999px; }

/* файл-карточка */
.file-card { display: flex; align-items: center; gap: 11px; text-decoration: none; color: var(--txt);
  padding: 4px 2px; }
.file-ic { width: 38px; height: 38px; border-radius: 10px; flex: none; display: grid; place-items: center;
  background: rgba(255,255,255,0.12); }
.file-ic svg { width: 18px; height: 18px; }
.file-info { display: flex; flex-direction: column; min-width: 0; }
.file-name { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 180px; }
.file-size { font-size: 11px; color: var(--muted); }
.msg-row.mine .file-ic { background: rgba(255,255,255,0.22); }

/* композер */
.composer { display: flex; align-items: center; gap: 8px; padding: 12px; flex: none;
  border-top: 1px solid var(--stroke); }
.composer input[type="text"] { flex: 1; border-radius: 999px; padding: 11px 14px; }
.icon-btn { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(255,255,255,0.08); border: 1px solid var(--stroke); flex: none; transition: 0.15s; }
.icon-btn:hover { background: rgba(255,255,255,0.16); }
.icon-btn svg { width: 19px; height: 19px; }
.icon-btn.send { background: linear-gradient(135deg, var(--accent), #6a5cff); border-color: transparent; }

/* участники */
.people-list { list-style: none; margin: 0; padding: 12px; display: flex; flex-direction: column; gap: 8px; overflow-y: auto; }
.people-list li { display: flex; align-items: center; gap: 11px; padding: 9px 11px; border-radius: 12px;
  background: rgba(255,255,255,0.04); border: 1px solid var(--stroke); font-size: 14px; }
.people-list .avatar { width: 32px; height: 32px; }
.people-list .on { width: 8px; height: 8px; border-radius: 50%; background: var(--accent-2); margin-left: auto;
  box-shadow: 0 0 8px var(--accent-2); }

/* мобильный */
@media (max-width: 760px) {
  .side { position: absolute; inset: 0 0 0 auto; width: min(90vw, 360px); z-index: 20; box-shadow: var(--shadow); }
  .ctrl.tgl-side { display: grid; }
  .room-pill { display: none; }
}
