/* VPN SOPRANO — Support Chat Widget (v17) */

:root{
  --sc-bg:#050016;
  --sc-card: rgba(2, 6, 23, .92);
  --sc-text:#ffffff;
  --sc-muted: rgba(255,255,255,.72);

  --sc-border: rgba(148,163,184,.35);
  --sc-input-bg:#020617;

  --sc-accent:#a855f7; /* фиолетовый */

  /* розовый для кнопки "Закрыть/свернуть" */
  --sc-pink: rgba(232,121,249,1);
  --sc-pink-soft: rgba(232,121,249,.12);

  --sc-danger:#ef4444; /* красный (оставлено для других мест) */
  --sc-danger-soft: rgba(239,68,68,.18);

  --sc-ok:#bbf7d0;
  --sc-ok-bg: rgba(16,185,129,.12);
  --sc-ok-br: rgba(16,185,129,.35);

  --sc-err:#fecaca;
  --sc-err-bg: rgba(220,38,38,.12);
  --sc-err-br: rgba(220,38,38,.35);
}

.sc-overlay, .sc-overlay * ,
.sc-modal, .sc-modal *{
  box-sizing: border-box;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* жёстко прячем скрытые блоки (важно против конфликтов CSS) */
.sc-modal [hidden]{ display:none !important; }

.sc-overlay{
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.55);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 14px;
}

/* контейнер */
.sc-modal{
  width: 100%;
  max-width: 520px;
  background: var(--sc-card);
  border: 1px solid var(--sc-border);
  border-radius: 18px;
  box-shadow: 0 18px 45px rgba(15,23,42,.9);
  overflow: hidden;
  color: var(--sc-text);
  position: relative;
}

/* ===== верхний бренд-блок ===== */
.sc-topbar{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
  padding:14px 14px 10px;
  border-bottom:1px solid var(--sc-border);
}

.sc-brand{
  display:flex;
  align-items:center;
  gap:10px;
  min-width: 0;
}

.sc-brand-logo{
  width:52px;
  height:52px;
  border-radius:14px;
  overflow:hidden;
  border:1px solid rgba(168,85,247,.55);
  box-shadow: 0 0 0 2px rgba(168,85,247,.10) inset;
  background: rgba(255,255,255,.04);
  flex: 0 0 auto;
}

.sc-brand-logo img{
  width:100%;
  height:100%;
  object-fit:cover;
  display:block;
}

.sc-brand-text{
  display:flex;
  flex-direction:column;
  gap:2px;
  line-height:1.05;
  min-width: 0;
}

.sc-brand-main{
  font-weight: 900;
  font-size: 18px;
  letter-spacing: .4px;
  white-space: nowrap;
}

.sc-brand-main .sc-dash{ margin: 0 6px; opacity:.9; }

/* кнопки справа (сначала кабинет, ниже закрыть/свернуть) */
.sc-top-actions{
  display:flex;
  flex-direction: column;
  gap:10px;
  align-items:flex-end;
  flex: 0 0 auto;
}

/* =========================================================
   ✅ КАБИНЕТ — 1:1 как на главной (index.php + style.css)
   ========================================================= */

/* База кнопки как .store-badge из style.css */
.sc-modal .store-badge{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:6px 12px;

  border-radius:999px;
  font-size:13px;
  font-weight:600;

  text-decoration:none;
  white-space:nowrap;

  border:1px solid rgba(148,163,184,.7);
  background:rgba(15,23,42,.96);
  color:#e5e7eb;

  box-shadow:0 0 0 1px rgba(15,23,42,.9);

  transition:
    background .15s ease,
    box-shadow .15s ease,
    transform .12s ease,
    border-color .15s ease,
    color .15s ease;

  /* ширина как на главной */
  min-width:190px;
}

.sc-modal .store-badge:hover,
.sc-modal .store-badge:focus-visible{
  background:
    radial-gradient(circle at 0 0,rgba(168,85,247,.35),transparent 60%),
    rgba(24,24,52,1);
  color:#f9fafb;
  border-color:rgba(168,85,247,.95);
  box-shadow:0 10px 24px rgba(88,28,135,.95),0 0 0 1px rgba(129,140,248,.9);
  transform:translateY(-1px);
}

.sc-modal .store-badge:active{
  transform:translateY(0);
  box-shadow:0 4px 12px rgba(15,23,42,.9),0 0 0 1px rgba(15,23,42,1);
}

/* В шапке на главной убирается пунктир у top-nav-link — здесь просто на всякий */
.sc-modal .top-nav-link{ border-bottom:none; }

/* Фиолетовый “скин” как .cabinet-btn из style.css (БЕЗ изменения формы/размера!) */
.sc-modal .cabinet-btn{
  border: 2px solid rgba(168, 85, 247, 1) !important;
  color: #f9fafb !important;
  background: rgba(15, 23, 42, 0.92) !important;
  box-shadow:
    0 0 0 1px rgba(168, 85, 247, 0.25),
    0 10px 24px rgba(88, 28, 135, 0.55) !important;
}

.sc-modal .cabinet-btn:hover,
.sc-modal .cabinet-btn:focus-visible{
  background:
    radial-gradient(circle at 0 0, rgba(168,85,247,0.35), transparent 60%),
    rgba(15, 23, 42, 0.98) !important;
  border-color: rgba(232, 121, 249, 1) !important;
}

.sc-modal .cabinet-btn:active{
  transform: translateY(0);
  box-shadow:
    0 6px 16px rgba(88, 28, 135, 0.45) !important;
}

/* ===== Закрыть/свернуть — выше и розовая ===== */
.sc-action.sc-closebtn{
  display:inline-flex;
  align-items:center;
  justify-content:center;

  min-width: 190px;   /* как на главной по ширине */
  height: 40px;       /* ВЫШЕ, чем кабинет */
  padding: 0 18px;
  border-radius: 999px;

  background: rgba(232,121,249,.10);
  color: rgba(255,255,255,.95);
  font-weight: 900;

  border: 1px solid rgba(232,121,249,.85);
  box-shadow:
    0 0 0 1px rgba(232,121,249,.12) inset,
    0 10px 24px rgba(232,121,249,.18);

  cursor:pointer;
  font-size: 12px;
  line-height: 1;
  text-shadow: 0.35px 0 0 currentColor, -0.35px 0 0 currentColor;

}

.sc-action.sc-closebtn:hover,
.sc-action.sc-closebtn:focus-visible{
  background:
    radial-gradient(circle at 0 0, rgba(232,121,249,.22), transparent 60%),
    rgba(15,23,42,.96);
  border-color: rgba(232,121,249,1);
}

.sc-action.sc-closebtn:active{ transform: translateY(1px); }

/* ===== заголовок "Чат поддержки" ===== */
.sc-head{
  padding: 12px 14px;
  border-bottom: 1px solid var(--sc-border);
}

.sc-title{
  font-weight: 900;
  font-size: 22px;
}

/* ===== тело ===== */
.sc-body{ padding: 14px; }

.sc-row{ margin-bottom: 10px; }

.sc-label{
  font-size: 13px;
  font-weight: 900;
  margin-bottom: 6px;
  color: var(--sc-text);
  text-align: left;
  padding-left: 6px;
}

/* Ввод/печать — белым жирным */
.sc-input,
.sc-textarea{
  width: 100%;
  border-radius: 12px;
  border: 1px solid var(--sc-border);
  background: var(--sc-input-bg);
  color: var(--sc-text) !important;
  padding: 10px 12px;
  font-size: 14px;
  font-weight: 800 !important;
  caret-color: var(--sc-text) !important;
  outline: none;
  -webkit-text-fill-color: var(--sc-text) !important; /* iOS Safari */
}

/* убираем “белую плёнку” от автозаполнения */
.sc-input:-webkit-autofill,
.sc-textarea:-webkit-autofill{
  -webkit-text-fill-color: var(--sc-text) !important;
  transition: background-color 999999s ease-out 0s;
  -webkit-box-shadow: 0 0 0px 1000px var(--sc-input-bg) inset !important;
  box-shadow: 0 0 0px 1000px var(--sc-input-bg) inset !important;
  border: 1px solid var(--sc-border) !important;
}

.sc-input::placeholder,
.sc-textarea::placeholder{
  color: rgba(255,255,255,.55) !important;
  font-weight: 700;
}

.sc-input:focus,
.sc-textarea:focus{
  border-color: rgba(168,85,247,.65);
  box-shadow: 0 0 0 3px rgba(168,85,247,.18);
}

.sc-textarea{
  min-height: 90px;
  resize: vertical;
}

/* залоченный email (из URL) */
.sc-input.sc-locked{
  opacity: .95;
  cursor: not-allowed;
}

/* кнопки */
.sc-btn{
  width: 100%;
  border: none;
  border-radius: 14px;
  padding: 12px 12px;
  background: linear-gradient(120deg, #a855f7, #e879f9, #22c55e);
  color: #0b1020;
  font-weight: 900;
  cursor: pointer;
  position: relative;
  font-size: 16px;
  line-height: 1.1;

}

.sc-btn[disabled]{ opacity: .65; cursor: not-allowed; }

.sc-btn.is-loading{
  opacity: .75;
  pointer-events: none;
}

.sc-btn.is-loading::after{
  content:"";
  position:absolute;
  right:14px;
  top:50%;
  width:16px;
  height:16px;
  margin-top:-8px;
  border-radius:50%;
  border:2px solid rgba(11,16,32,.35);
  border-top-color: rgba(11,16,32,.95);
  animation: scspin .8s linear infinite;
}

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

.sc-note{
  margin-top: 10px;
  color: var(--sc-muted);
  font-size: 12px;
  line-height: 1.35;
  text-align: center;
  font-weight: 700;
}

/* алерты */
.sc-error{
  margin: 10px 0 0;
  color: var(--sc-err);
  background: var(--sc-err-bg);
  border: 1px solid var(--sc-err-br);
  padding: 10px 12px;
  border-radius: 12px;
  font-weight: 900;
  display: none;
  text-align: center;
}

.sc-ok{
  margin: 10px 0 0;
  color: var(--sc-ok);
  background: var(--sc-ok-bg);
  border: 1px solid var(--sc-ok-br);
  padding: 10px 12px;
  border-radius: 12px;
  font-weight: 900;
  display: none;
  text-align: center;
}

/* чат */
.sc-chat{
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sc-msgs{
  height: 280px;
  overflow: auto;
  border: 1px solid var(--sc-border);
  border-radius: 14px;
  background: rgba(0,0,0,.16);
  padding: 10px;
}

.sc-bubble{
  max-width: 85%;
  padding: 8px 10px;
  border-radius: 14px;
  margin: 6px 0;
  font-size: 14px;
  line-height: 1.35;
  border: 1px solid var(--sc-border);
  word-break: break-word;

  color: var(--sc-text) !important;
  font-weight: 800 !important;
}

.sc-client{ margin-left: auto; background: rgba(168,85,247,.16); }
.sc-admin{ margin-right: auto; background: rgba(255,255,255,.06); }
.sc-system{ margin-right: auto; background: rgba(59,130,246,.10); }

.sc-sendrow{
  display: flex;
  gap: 8px;
}

.sc-sendrow .sc-textarea{
  min-height: 44px;
  resize: none;
}

.sc-sendbtn{
  min-width: 110px;
  border: none;
  border-radius: 14px;
  padding: 10px 12px;
  background: rgba(5,46,22,.92);
  border: 1px solid rgba(52,211,153,.7);
  color: #bbf7d0;
  font-weight: 900;
  cursor: pointer;
}

.sc-sendbtn[disabled]{ opacity: .65; cursor: not-allowed; }

/* ===== close menu (Свернуть / Закрыть) ===== */
.sc-close-menu{
  position:absolute;
  inset:0;
  background: rgba(0,0,0,.55);
  display:none;
  align-items:center;
  justify-content:center;
  padding:14px;
  z-index: 5;
}

.sc-close-box{
  width:100%;
  max-width: 420px;
  background: rgba(2, 6, 23, .96);
  border: 1px solid var(--sc-border);
  border-radius: 18px;
  padding: 14px;
  box-shadow: 0 18px 45px rgba(15,23,42,.9);
}

.sc-close-title{
  font-weight: 900;
  font-size: 16px;
  text-align:center;
  margin-bottom: 12px;
}

.sc-close-actions{
  display:flex;
  gap:10px;
}

.sc-close-actions .sc-mini{
  flex:1;
  height: 46px;
  border-radius: 16px;
  font-weight: 900;
  border: 1px solid var(--sc-border);
  background: rgba(255,255,255,.06);
  color: var(--sc-text);
  cursor:pointer;
}

.sc-close-actions .sc-mini.sc-danger{
  border-color: rgba(239,68,68,.65);
  background: rgba(239,68,68,.10);
}

/* ===== rate ===== */
.sc-rate{
  padding: 14px;
  color: var(--sc-text);
  text-align: center;
}

.sc-rate-title{
  font-weight: 900;
  font-size: 16px;
  margin-bottom: 10px;
}

.sc-rate-actions{
  display: flex;
  gap: 10px;
}

.sc-rate-btn{
  flex: 1;
  border-radius: 14px;
  padding: 12px 10px;
  border: 1px solid var(--sc-border);
  background: rgba(255,255,255,.06);
  color: var(--sc-text);
  font-size: 20px;
  cursor: pointer;
}

.sc-rate-btn:hover{
  background: rgba(168,85,247,.14);
}

.sc-rate-skip{
  margin-top: 10px;
  color: rgba(255,255,255,.75);
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  user-select:none;
}

.sc-rate-skip:hover{ color: var(--sc-text); }

/* mobile */
@media (max-width:720px){
  .sc-modal{ max-width: 100%; }
  .sc-msgs{ height: 240px; }
  .sc-sendbtn{ min-width: 90px; }

  /* ✅ Кабинет на мобилке — как на главной (по тексту) */
  .sc-modal .cabinet-btn{
    min-width: 0 !important;
    width: fit-content !important;
    padding: 5px 10px !important;
    font-size: 12px !important;
    line-height: 1 !important;
    white-space: nowrap;
  }

  /* "Закрыть/свернуть" на мобилке тоже не тянем фикс. шириной */
  .sc-action.sc-closebtn{
    min-width: 0 !important;
    width: fit-content !important;
  }
}



/* =========================
   iPhone Safari: STOP INPUT ZOOM (global)
   ========================= */
@media (max-width: 720px){
  .sc-modal .sc-input,
  .sc-modal .sc-textarea{
    font-size: 16px !important;
  }
}

