/* Mobile-first responsive Call Front */
:root {
  --bg: #050505;
  --card: rgba(20, 20, 20, 0.94);
  --card-border: #2a2a2a;
  --text: #ffffff;
  --muted: #b8b8b8;
  --gold: #f5c518;
  --gold-dark: #d4a017;
  --wa: #25d366;
  --tg: #2aabee;
  --radius: 14px;
  --font: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  --page-pad: 14px;
  --gap: 10px;
  --cols: 2;
}

*,
*::before,
*::after { box-sizing: border-box; }

html {
  margin: 0;
  padding: 0;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  line-height: 1.4;
}

a {
  color: inherit;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

.page {
  width: 100%;
  max-width: 420px;
  margin: 0 auto;
  padding: calc(16px + env(safe-area-inset-top, 0px)) var(--page-pad) calc(28px + env(safe-area-inset-bottom, 0px));
}

.brand {
  text-align: center;
  margin-bottom: 16px;
}
.brand img {
  max-width: min(200px, 58vw);
  margin: 0 auto;
}

.section { margin-top: 18px; }
.section-title {
  text-align: center;
  font-size: 1.05rem;
  font-weight: 700;
  margin: 0 0 6px;
}
.section-title .accent { color: var(--gold); }
.section-sub {
  text-align: center;
  color: var(--muted);
  font-size: .78rem;
  margin: 0 0 12px;
  padding: 0 4px;
}

/* Sabit giriş — canlı destek kutusuyla aynı dil (çerçevesiz) */
.login-box {
  border: 1px solid transparent;
  border-radius: var(--radius);
  padding: 16px 12px;
  text-align: center;
  background: linear-gradient(180deg, rgba(36, 36, 36, 0.98), rgba(18, 18, 18, 0.96));
}
.login-label {
  text-align: center;
  color: var(--muted);
  font-size: .86rem;
  font-weight: 600;
  letter-spacing: .02em;
  margin: 0 0 12px;
}
.login-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 320px;
  min-height: 46px;
  padding: 12px 16px;
  border: 0;
  border-radius: 10px;
  background: linear-gradient(180deg, #ffe14a, var(--gold-dark));
  color: #111;
  font-weight: 800;
  font-size: .92rem;
  word-break: break-word;
  text-align: center;
}

/* Temsilciler — mobile: 2 kolon, kalan ortalı */
.agents {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--gap);
}
.agent-card {
  flex: 0 0 calc((100% - (var(--cols) - 1) * var(--gap)) / var(--cols));
  max-width: calc((100% - (var(--cols) - 1) * var(--gap)) / var(--cols));
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 12px 8px;
  text-align: center;
}
.agent-avatar {
  width: 40px;
  height: 40px;
  margin: 0 auto 8px;
  border-radius: 50%;
  background: var(--gold);
  color: #111;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: .95rem;
}
.agent-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  margin: 0 auto 6px;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(37, 211, 102, 0.12);
  border: 1px solid rgba(37, 211, 102, 0.35);
  color: #7dffa8;
  font-size: .62rem;
  font-weight: 700;
  letter-spacing: .03em;
  text-transform: uppercase;
}
.online-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #25d366;
  animation: online-pulse 1.6s ease-out infinite;
  flex-shrink: 0;
}
@keyframes online-pulse {
  0% { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.65); }
  70% { box-shadow: 0 0 0 8px rgba(37, 211, 102, 0); }
  100% { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0); }
}
.agent-name {
  font-weight: 700;
  font-size: .88rem;
  line-height: 1.25;
  word-break: break-word;
}
.agent-title {
  color: var(--muted);
  font-size: .6rem;
  letter-spacing: .03em;
  margin: 3px 0 10px;
  line-height: 1.3;
  min-height: 1.3em;
}
.agent-actions {
  display: grid;
  gap: 6px;
}
.btn-wa,
.btn-tg {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 8px 6px;
  border: 0;
  border-radius: 8px;
  color: #fff;
  font-size: .72rem;
  font-weight: 700;
}
.btn-wa { background: var(--wa); }
.btn-tg { background: var(--tg); }
.btn-tg[hidden] { display: none !important; }
button.btn-wa {
  width: 100%;
  cursor: pointer;
  font-family: inherit;
}

/* Username kapısı */
.user-gate {
  border: 1px solid var(--card-border);
  background: var(--card);
  border-radius: var(--radius);
  padding: 14px 12px;
}
.user-gate.is-blocked {
  border-color: rgba(245, 197, 24, 0.45);
  text-align: center;
}
.user-gate-label {
  display: block;
  font-size: .72rem;
  color: var(--muted);
  margin-bottom: 8px;
  font-weight: 600;
}
.user-gate-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}
.user-gate-input {
  min-height: 44px;
  border-radius: 10px;
  border: 1px solid #3a3a3a;
  background: #0d0d0d;
  color: #fff;
  padding: 0 12px;
  font-size: .9rem;
  font-family: inherit;
}
.user-gate-input:focus {
  outline: none;
  border-color: var(--gold);
}
.user-gate-btn {
  min-height: 44px;
  padding: 0 16px;
  border: 0;
  border-radius: 10px;
  background: linear-gradient(180deg, #ffe14a, var(--gold-dark));
  color: #111;
  font-weight: 800;
  font-size: .86rem;
  cursor: pointer;
  font-family: inherit;
}
.user-gate-btn:disabled { opacity: .7; cursor: wait; }
.user-gate-error {
  margin: 10px 0 0;
  color: #ff6b6b;
  font-size: .78rem;
}
.user-gate-msg {
  margin: 0 0 12px;
  color: var(--gold);
  font-size: .92rem;
  font-weight: 700;
  line-height: 1.4;
}
.user-gate-reset {
  border: 1px solid #444;
  background: transparent;
  color: #ddd;
  border-radius: 8px;
  min-height: 40px;
  padding: 0 14px;
  cursor: pointer;
  font-family: inherit;
  font-size: .8rem;
}

/* WhatsApp seçim modalı */
.wa-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 12px;
}
.wa-modal[hidden] { display: none !important; }
.wa-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
}
.wa-modal-dialog {
  position: relative;
  width: min(420px, 100%);
  max-height: min(70vh, 480px);
  overflow: auto;
  background: #141414;
  border: 1px solid #333;
  border-radius: 16px 16px 12px 12px;
  padding: 14px 14px 16px;
  box-shadow: 0 -8px 40px rgba(0, 0, 0, 0.45);
}
.wa-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}
.wa-modal-head h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
}
.wa-modal-close {
  border: 0;
  background: transparent;
  color: #aaa;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  padding: 0 4px;
}
.wa-modal-sub {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: .78rem;
}
.wa-modal-list {
  display: grid;
  gap: 8px;
}
.wa-modal-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 46px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(37, 211, 102, 0.12);
  border: 1px solid rgba(37, 211, 102, 0.35);
  color: #fff;
  font-weight: 700;
  font-size: .86rem;
}
.wa-modal-item-go {
  color: #7dffa8;
  font-size: .72rem;
  letter-spacing: .04em;
  text-transform: uppercase;
}
@media (min-width: 640px) {
  .wa-modal { align-items: center; }
  .wa-modal-dialog { border-radius: 16px; }
}

/* Canlı destek */
.support-box {
  background: linear-gradient(180deg, rgba(28, 28, 28, 0.96), rgba(14, 14, 14, 0.94));
  border: 1px solid transparent;
  border-radius: var(--radius);
  padding: 16px 12px;
  text-align: center;
}
.support-box[hidden] { display: none !important; }
.support-box p {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: .86rem;
}
.support-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 320px;
  min-height: 46px;
  padding: 12px 16px;
  border-radius: 10px;
  background: linear-gradient(180deg, #ffe14a, var(--gold-dark));
  color: #111;
  font-weight: 800;
  font-size: .92rem;
}

/* Sosyal — sadece kare ikon */
.social-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}
.social-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border: 1px solid #3a3a3a;
  border-radius: 12px;
  background: rgba(16, 16, 16, 0.95);
  transition: border-color .15s ease, background .15s ease, transform .12s ease;
}
.social-btn:hover,
.social-btn:focus-visible {
  border-color: var(--gold);
  background: #1a1a1a;
  outline: none;
}
.social-btn:active { transform: scale(0.96); }
.social-icon {
  display: inline-flex;
  width: 20px;
  height: 20px;
  color: var(--gold);
}
.social-icon svg {
  width: 20px;
  height: 20px;
  display: block;
}

.footer {
  margin-top: 24px;
  text-align: center;
  color: #777;
  font-size: .7rem;
  padding: 0 6px;
}

.loading,
.error {
  text-align: center;
  color: var(--muted);
  padding: 48px 16px;
}
.error { color: #ff6b6b; }

/* ---- Çok dar telefon ---- */
@media (max-width: 360px) {
  :root {
    --page-pad: 10px;
    --gap: 8px;
  }
  .agent-card { padding: 10px 6px; }
  .agent-avatar { width: 36px; height: 36px; font-size: .85rem; }
  .btn-wa,
  .btn-tg {
    min-height: 38px;
    font-size: .66rem;
    padding: 7px 4px;
  }
  .social-btn { width: 44px; height: 44px; }
}

/* ---- Büyük telefon / küçük tablet ---- */
@media (min-width: 480px) {
  .page {
    max-width: 520px;
    padding-left: 18px;
    padding-right: 18px;
  }
  .agent-name { font-size: .92rem; }
  .agent-title { font-size: .64rem; }
  .btn-wa,
  .btn-tg { font-size: .76rem; min-height: 42px; }
  .social-btn { width: 52px; height: 52px; }
  .social-icon,
  .social-icon svg { width: 22px; height: 22px; }
}

/* ---- Tablet+: 3 kolon ---- */
@media (min-width: 640px) {
  :root {
    --cols: 3;
    --gap: 12px;
  }
  .page {
    max-width: 680px;
    padding: 28px 22px 40px;
  }
  .section { margin-top: 24px; }
  .section-title { font-size: 1.2rem; }
  .section-sub { font-size: .84rem; margin-bottom: 16px; }
  .login-box { padding: 18px 14px; }
  .login-btn { width: auto; min-width: 260px; min-height: 48px; font-size: .95rem; }
  .agent-card { padding: 14px 10px; }
  .agent-avatar { width: 46px; height: 46px; }
  .agent-status { font-size: .68rem; }
  .agent-name { font-size: .95rem; }
  .agent-title { font-size: .66rem; }
  .btn-wa,
  .btn-tg { font-size: .78rem; }
  .support-btn { width: auto; min-width: 260px; }
  .social-btn { width: 54px; height: 54px; border-radius: 13px; }
}

/* ---- Masaüstü ---- */
@media (min-width: 900px) {
  .page {
    max-width: 760px;
    padding: 32px 24px 48px;
  }
  .brand img { max-width: 240px; }
  .agents { gap: 14px; }
  .agent-card {
    flex-basis: calc((100% - 28px) / 3);
    max-width: calc((100% - 28px) / 3);
    transition: border-color .15s ease, transform .15s ease;
  }
  .agent-card:hover {
    border-color: #444;
    transform: translateY(-2px);
  }
  .social-list { gap: 12px; }
  .social-btn { width: 56px; height: 56px; }
  .social-icon,
  .social-icon svg { width: 24px; height: 24px; }
}

/* Landscape telefon */
@media (max-height: 480px) and (orientation: landscape) {
  .page { padding-top: 12px; padding-bottom: 16px; }
  .section { margin-top: 12px; }
  .agent-card { padding: 8px; }
  .agent-title { margin-bottom: 6px; }
}
