/* ===========================================================================
   LEOLOCALTECH-REMOTE-VOIP — Oberfläche
   Farben und Grundformen sind absichtlich dieselben wie in
   LEOLOCALTECH-ANDROID-MANAGE, damit beide Werkzeuge zusammengehören.
   =========================================================================== */
:root {
  --bg:        #05060d;
  --bg-2:      #0b0d1a;
  --panel:     rgba(18, 21, 38, 0.85);
  --panel-2:   rgba(12, 14, 28, 0.9);
  --line:      rgba(120, 140, 220, 0.18);
  --text:      #e8ecff;
  --muted:     #8b93b8;
  --red:       #ff2d55;
  --red-glow:  rgba(255, 45, 85, 0.55);
  --blue:      #2f7bff;
  --blue-glow: rgba(47, 123, 255, 0.55);
  --green:     #1fd17a;
  --green-glow:rgba(31, 209, 122, 0.45);
  --amber:     #ffb020;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  color: var(--text);
  background:
    radial-gradient(1200px 700px at 18% -10%, rgba(255,45,85,0.16), transparent 60%),
    radial-gradient(1100px 700px at 88% 110%, rgba(47,123,255,0.18), transparent 60%),
    var(--bg);
  background-attachment: fixed;
}
.hidden { display: none !important; }

/* ---------------- Anmeldung ---------------- */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-card {
  width: 360px; max-width: 100%;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 34px 28px;
  text-align: center;
  backdrop-filter: blur(14px);
  box-shadow: 0 0 60px rgba(0,0,0,0.6), 0 0 1px var(--blue-glow);
}
.login-logo { width: 96px; height: 96px; border-radius: 50%; object-fit: cover;
  box-shadow: 0 0 32px var(--red-glow), 0 0 48px var(--blue-glow); }
.login-card h1 { margin: 18px 0 2px; font-size: 22px; letter-spacing: 3px; }
.login-card .sub { margin: 0 0 22px; color: var(--muted); font-size: 13px; }
.login-card input, .modal input, .modal textarea, .modal select {
  width: 100%; margin: 7px 0; padding: 12px 14px;
  background: var(--panel-2); border: 1px solid var(--line);
  border-radius: 10px; color: var(--text); font-size: 14px; outline: none;
}
.login-card input:focus, .modal input:focus, .modal select:focus {
  border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-glow);
}
button {
  cursor: pointer; border: none; border-radius: 10px;
  font-weight: 600; font-size: 14px; color: #fff;
  padding: 12px 16px;
  background: linear-gradient(100deg, var(--red), var(--blue));
  box-shadow: 0 6px 20px rgba(0,0,0,0.4), 0 0 18px rgba(47,123,255,0.25);
  transition: transform .08s ease, filter .15s ease;
}
button:hover { filter: brightness(1.1); }
button:active { transform: translateY(1px); }
button[disabled] { opacity: .5; cursor: default; filter: none; }
.login-card button { width: 100%; margin-top: 12px; }
.error { color: var(--red); font-size: 13px; min-height: 18px; margin-top: 10px; }

/* ---------------- Kopfzeile ---------------- */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 12px 20px;
  border-bottom: 1px solid var(--line);
  background: rgba(5,6,13,0.7); backdrop-filter: blur(10px);
  position: sticky; top: 0; z-index: 20;
}
.brand { display: flex; align-items: center; gap: 12px; font-weight: 700; letter-spacing: 2px; }
.brand img { width: 38px; height: 38px; border-radius: 50%; object-fit: cover;
  box-shadow: 0 0 16px var(--red-glow), 0 0 22px var(--blue-glow); }
.topbar-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.whoami { color: var(--muted); font-size: 13px; }
.whoami b { color: var(--text); }
.reg { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; color: var(--muted);
  border: 1px solid var(--line); border-radius: 999px; padding: 5px 11px; }
.reg .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--amber);
  box-shadow: 0 0 10px var(--amber); display: inline-block; }
.reg.ok .dot { background: var(--green); box-shadow: 0 0 10px var(--green-glow); }
.reg.bad .dot { background: var(--red); box-shadow: 0 0 10px var(--red-glow); }
button.ghost {
  background: transparent; border: 1px solid var(--line); box-shadow: none;
  color: var(--muted); padding: 8px 14px;
}
button.ghost:hover { color: var(--text); border-color: var(--blue); }
button.ghost.on { color: #fff; border-color: var(--red); background: rgba(255,45,85,0.15); }
button.mini { padding: 5px 10px; font-size: 12px; border-radius: 8px; }

/* ---------------- Aufteilung ---------------- */
.layout { display: grid; grid-template-columns: 340px 1fr; gap: 18px; padding: 18px; align-items: start; }
@media (max-width: 900px) { .layout { grid-template-columns: 1fr; } }

.panel {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 16px; padding: 14px 16px; margin-bottom: 16px;
  backdrop-filter: blur(12px);
  box-shadow: 0 10px 40px rgba(0,0,0,0.35);
}
.panel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; gap: 8px; }
.panel-head h2 { font-size: 13px; letter-spacing: 2px; text-transform: uppercase; color: var(--muted); margin: 0; }
.hint { font-size: 11px; color: var(--muted); }

.list { list-style: none; margin: 0; padding: 0; max-height: 300px; overflow: auto; }
.list li {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 10px; border-radius: 10px; border: 1px solid transparent;
  cursor: pointer;
}
.list li:hover { background: rgba(47,123,255,0.1); border-color: var(--line); }
.list li .nm { flex: 1; min-width: 0; }
.list li .nm b { display: block; font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list li .nm span { display: block; font-size: 11.5px; color: var(--muted); }
.list li .tag { font-size: 11px; padding: 3px 8px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); }
.list li .tag.on { color: var(--green); border-color: rgba(31,209,122,0.4); }
.list li .tag.busy { color: var(--amber); border-color: rgba(255,176,32,0.4); }
.list li .del { background: none; box-shadow: none; color: var(--muted); padding: 4px 7px; font-size: 13px; }
.list li .del:hover { color: var(--red); }
.list .leer { color: var(--muted); font-size: 12.5px; cursor: default; padding: 8px 10px; }
.list .leer:hover { background: none; border-color: transparent; }
.ava {
  width: 34px; height: 34px; border-radius: 50%; flex: 0 0 auto;
  display: grid; place-items: center; font-size: 13px; font-weight: 700;
  background: linear-gradient(140deg, rgba(255,45,85,0.35), rgba(47,123,255,0.35));
  border: 1px solid var(--line);
}
.ava.in  { background: linear-gradient(140deg, rgba(31,209,122,0.3), rgba(47,123,255,0.3)); }
.ava.miss{ background: linear-gradient(140deg, rgba(255,45,85,0.45), rgba(255,45,85,0.15)); }

/* ---------------- Wähltastatur ---------------- */
.phone { display: block; }
.dialer { max-width: 460px; margin: 0 auto; padding: 20px; }
.display { display: flex; align-items: center; gap: 8px; }
.display input {
  flex: 1; width: 100%; padding: 14px 16px; font-size: 24px; letter-spacing: 2px;
  text-align: center; background: var(--panel-2); border: 1px solid var(--line);
  border-radius: 12px; color: var(--text); outline: none;
}
.display input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-glow); }
button.icon { background: transparent; border: 1px solid var(--line); box-shadow: none;
  color: var(--muted); padding: 12px 14px; font-size: 16px; }
button.icon:hover { color: var(--text); border-color: var(--blue); }

.callstate { display: flex; align-items: center; gap: 10px; justify-content: center;
  min-height: 34px; margin: 12px 0 4px; font-size: 13px; }
.cs-label { color: var(--muted); text-transform: uppercase; letter-spacing: 1.5px; font-size: 11px; }
.cs-peer { font-weight: 600; }
.cs-timer { font-variant-numeric: tabular-nums; color: var(--green); }

.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 10px 0 16px; }
.keypad button {
  background: var(--panel-2); border: 1px solid var(--line); box-shadow: none;
  padding: 12px 0; display: grid; gap: 1px; line-height: 1.1;
}
.keypad button:hover { border-color: var(--blue); background: rgba(47,123,255,0.12); }
.keypad button b { font-size: 21px; font-weight: 600; }
.keypad button i { font-size: 9.5px; color: var(--muted); font-style: normal; letter-spacing: 1.5px; min-height: 11px; }

.actions { display: grid; gap: 10px; }
button.call   { background: linear-gradient(100deg, var(--green), #15a85f); padding: 15px; font-size: 15px; letter-spacing: 1px; }
button.hangup { background: linear-gradient(100deg, var(--red), #c01437); padding: 15px; font-size: 15px; letter-spacing: 1px; }

.incall { display: flex; align-items: center; gap: 10px; margin-top: 14px; }
.level { flex: 1; height: 8px; border-radius: 999px; background: var(--panel-2); border: 1px solid var(--line); overflow: hidden; }
.level span { display: block; height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--green), var(--blue)); transition: width .08s linear; }

/* ---------------- Eingehender Anruf ---------------- */
.ring-back { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center;
  background: rgba(3,4,10,0.78); backdrop-filter: blur(6px); }
.ring-card { width: 340px; max-width: 92vw; text-align: center; padding: 30px 26px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 20px;
  box-shadow: 0 20px 70px rgba(0,0,0,0.6); }
.ring-card h2 { margin: 18px 0 6px; font-size: 15px; letter-spacing: 2px; text-transform: uppercase; color: var(--muted); }
.ring-who { margin: 0 0 22px; font-size: 22px; font-weight: 700; }
.ring-actions { display: grid; gap: 10px; }
.ring-pulse { display: inline-grid; place-items: center; position: relative; }
.ring-pulse img { width: 86px; height: 86px; border-radius: 50%; object-fit: cover; position: relative; z-index: 1; }
.ring-pulse::after {
  content: ''; position: absolute; inset: -10px; border-radius: 50%;
  border: 2px solid var(--green); animation: pulse 1.6s ease-out infinite;
}
@keyframes pulse {
  0%   { transform: scale(0.9); opacity: .9; }
  100% { transform: scale(1.5); opacity: 0; }
}

/* ---------------- Dialog + Hinweis ---------------- */
.modal-back { position: fixed; inset: 0; z-index: 70; display: grid; place-items: center;
  background: rgba(3,4,10,0.7); backdrop-filter: blur(5px); padding: 20px; }
.modal { width: 380px; max-width: 100%; background: var(--panel); border: 1px solid var(--line);
  border-radius: 16px; padding: 22px; box-shadow: 0 20px 70px rgba(0,0,0,0.6); }
.modal h3 { margin: 0 0 14px; font-size: 15px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--muted); }
.modal label { display: block; font-size: 12px; color: var(--muted); margin-top: 10px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; }

.toast { position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%);
  background: var(--panel); border: 1px solid var(--line); color: var(--text);
  padding: 11px 18px; border-radius: 999px; font-size: 13px; z-index: 90;
  box-shadow: 0 10px 40px rgba(0,0,0,0.5); max-width: 90vw; text-align: center; }
