/* ============================================================
   css/account.css — личный кабинет FSI Studio.
   ============================================================ */
.acc-root { color: var(--text); }
.acc-head { margin-bottom: 22px; }
.acc-head .title {
  font-family: 'Wix Madefor Display', sans-serif; font-size: clamp(1.7rem, 4vw, 2.4rem); margin: 0 0 6px;
  background: linear-gradient(120deg, #fff 10%, var(--btn) 90%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.acc-head p { color: rgba(234,230,247,0.7); margin: 0; }

/* ---- Гость (не вошёл) ---- */
.acc-guard { display: none; text-align: center; padding: 70px 20px; }
.acc-guard.show { display: block; }
.acc-guard svg { width: 60px; height: 60px; opacity: .55; margin-bottom: 16px; }
.acc-guard h2 { font-family: 'Wix Madefor Display', sans-serif; margin: 0 0 10px; }
.acc-guard p { color: rgba(234,230,247,0.7); margin: 0 0 22px; }

/* ---- Каркас ---- */
.acc-shell { display: none; grid-template-columns: 270px minmax(0,1fr); gap: 24px; align-items: start; }
.acc-shell.show { display: grid; }

.acc-side { position: sticky; top: calc(var(--nav-height) + 24px); display: flex; flex-direction: column; gap: 16px; padding: 20px; border-radius:12px; }
.acc-user { display: flex; align-items: center; gap: 13px; padding-bottom: 16px; border-bottom: 1px solid rgba(255,255,255,0.07); }
.acc-user img { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; border: 2px solid rgba(164,102,255,0.4); background:#2a1a40; }
.acc-user .au-nick { font-family: 'Wix Madefor Display', sans-serif; font-weight: 700; font-size: 1.05rem; color: #fff; }
.acc-user .au-mail { font-size: 0.8rem; color: rgba(234,230,247,0.55); word-break: break-all; }
.acc-user .au-id {
  margin-top: 7px; display: inline-flex; align-items: center; gap: 6px; max-width: 100%;
  font-family: ui-monospace, 'Cascadia Code', Consolas, monospace; font-size: 0.72rem; letter-spacing: 0.4px;
  color: #cbb6ff; background: rgba(164,102,255,0.12); border: 1px solid rgba(164,102,255,0.28);
  padding: 4px 9px; border-radius:9px; cursor: pointer; transition: background .18s ease, color .18s ease; font-weight: 600;
}
.acc-user .au-id::after { content: '⧉'; font-size: 0.78rem; opacity: 0.7; }
.acc-user .au-id:hover { background: rgba(164,102,255,0.22); color: #fff; }
.acc-user .au-id.copied { background: rgba(61,220,132,0.18); color: #8ef0b6; border-color: rgba(61,220,132,0.4); }
.acc-user .au-id.copied::after { content: ''; }

/* ID для техподдержки (карточка «Поддержка») */
.support-id {
  display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap;
  background: linear-gradient(135deg, rgba(164,102,255,0.13), rgba(142,83,225,0.05));
  border: 1px solid rgba(164,102,255,0.22); border-radius:14px; padding: 14px 16px; margin-bottom: 14px;
}
.support-id .sid-l { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.support-id .sid-label { font-size: 0.78rem; color: rgba(234,230,247,0.6); }
.support-id .sid-code {
  font-family: ui-monospace, 'Cascadia Code', Consolas, monospace; font-weight: 700;
  font-size: 1.3rem; letter-spacing: 1.5px; color: #fff;
}
.support-id .sid-copy { padding: 9px 16px; white-space: nowrap; }
.support-id .sid-copy.copied { background: rgba(61,220,132,0.18); color: #8ef0b6; border-color: rgba(61,220,132,0.4); }
.acc-tabs { display: flex; flex-direction: column; gap: 6px; }
.acc-tab-btn {
  display: flex; align-items: center; gap: 11px; width: 100%; padding: 12px 14px; border-radius:12px;
  border: 1px solid transparent; background: transparent; color: rgba(234,230,247,0.8);
  font-family: inherit; font-weight: 600; font-size: 0.95rem; cursor: pointer; text-align: left; transition: all .2s ease;
}
.acc-tab-btn svg { width: 19px; height: 19px; flex: 0 0 19px; }
.acc-tab-btn:hover { background: rgba(255,255,255,0.04); color: #fff; }
.acc-tab-btn.active { background: linear-gradient(135deg, rgba(142,83,225,0.28), rgba(164,102,255,0.16)); border-color: rgba(164,102,255,0.4); color: #fff; }
.acc-logout { margin-top: 6px; color: #ff9b9b !important; }
.acc-logout:hover { background: rgba(255,107,107,0.1) !important; }

/* ---- Контент ---- */
.acc-content { min-width: 0; }
.acc-pane { display: none; }
.acc-pane.active { display: block; animation: accFade .35s ease; }
@keyframes accFade { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.acc-card { padding: 24px; border-radius:12px; margin-bottom: 18px; }
.acc-card h3 { font-family: 'Wix Madefor Display', sans-serif; font-size: 1.15rem; margin: 0 0 16px; display: flex; align-items: center; gap: 9px; }
.acc-card h3::before { content: ''; width: 4px; height: 18px; border-radius:3px; background: linear-gradient(180deg, var(--btn), var(--accent)); }

.acc-field { margin-bottom: 14px; }
.acc-field label { display: block; font-size: 0.84rem; color: rgba(234,230,247,0.6); margin-bottom: 6px; }
.acc-input, .acc-select {
  width: 100%; padding: 12px 14px; border-radius:11px; font-family: inherit; font-size: 0.95rem;
  background: rgba(0,0,0,0.25); border: 1px solid rgba(255,255,255,0.1); color: var(--text);
}
.acc-input:focus, .acc-select:focus { outline: none; border-color: rgba(164,102,255,0.6); box-shadow: 0 0 0 3px rgba(164,102,255,0.15); }
.acc-select option { background: #1a1226; }
.acc-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

.acc-btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 12px 22px; border-radius:12px; border: 0; cursor: pointer;
  font-family: inherit; font-weight: 700; font-size: 0.93rem; transition: transform .15s ease, box-shadow .15s ease, background .2s;
}
.acc-btn.primary { background: linear-gradient(90deg, var(--btn), #8e5dff); color: #fff; box-shadow: 0 8px 22px rgba(164,102,255,0.25); }
.acc-btn.primary:hover { transform: translateY(-2px); box-shadow: 0 12px 28px rgba(164,102,255,0.38); }
.acc-btn.ghost { background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.12); color: var(--text); }
.acc-btn.ghost:hover { background: rgba(255,255,255,0.1); }
.acc-btn.danger { background: rgba(255,107,107,0.12); border: 1px solid rgba(255,107,107,0.35); color: #ff9b9b; }
.acc-btn.danger:hover { background: rgba(255,107,107,0.2); }
.acc-btn:disabled { opacity: .6; cursor: default; transform: none; }

.acc-msg { display: none; margin: 0 0 14px; padding: 10px 14px; border-radius:10px; font-size: 0.88rem; }
.acc-msg.err { display: block; background: rgba(255,107,107,0.1); border: 1px solid rgba(255,107,107,0.3); color: #ff9b9b; }
.acc-msg.ok { display: block; background: rgba(61,220,132,0.1); border: 1px solid rgba(61,220,132,0.3); color: #8ef0b6; }

/* ---- Аватар-пикер ---- */
.av-grid { display: flex; flex-wrap: wrap; gap: 12px; }
.av-opt { width: 72px; height: 72px; border-radius: 50%; cursor: pointer; overflow: hidden; border: 3px solid transparent; transition: all .2s ease; background:#2a1a40; }
.av-opt img { width: 100%; height: 100%; object-fit: cover; display: block; }
.av-opt:hover { transform: scale(1.06); }
.av-opt.sel { border-color: var(--btn); box-shadow: 0 0 0 3px rgba(164,102,255,0.25); }

/* ---- Чипы привязанных продуктов / история ---- */
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { padding: 7px 13px; border-radius:12px; background: rgba(164,102,255,0.12); border: 1px solid rgba(164,102,255,0.25); font-size: 0.85rem; }
.acc-empty { color: rgba(234,230,247,0.5); font-size: 0.92rem; padding: 6px 0; }
.hist-list { display: grid; gap: 8px; }
.hist-item { display: flex; justify-content: space-between; gap: 10px; padding: 11px 14px; border-radius:11px; background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.05); font-size: 0.9rem; }
.hist-item .hi-meta { color: rgba(234,230,247,0.55); font-size: 0.82rem; }

/* привязка контактов */
.link-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 0; border-bottom: 1px solid rgba(255,255,255,0.06); flex-wrap: wrap; }
.link-row:last-child { border-bottom: 0; }
.link-row .lr-l { display: flex; align-items: center; gap: 11px; }
.link-row .lr-ic { width: 38px; height: 38px; border-radius:11px; display: flex; align-items: center; justify-content: center; background: rgba(255,255,255,0.05); }
.link-row .lr-ic svg { width: 20px; height: 20px; }
.link-row .lr-val { font-size: 0.85rem; color: rgba(234,230,247,0.6); }
.badge-v { font-size: 0.72rem; font-weight: 700; padding: 3px 9px; border-radius:14px; }
.badge-v.yes { background: rgba(61,220,132,0.16); color: #8ef0b6; }
.badge-v.no { background: rgba(255,209,102,0.16); color: #ffd98a; }

.danger-zone { border-color: rgba(255,107,107,0.25) !important; }

/* ---- Переключатель Продукты/Заказы ---- */
.po-switch { display: inline-flex; gap: 4px; padding: 5px; border-radius:13px; background: rgba(0,0,0,0.28); margin-bottom: 18px; }
.po-btn { padding: 10px 20px; border: 0; border-radius:9px; background: transparent; color: rgba(234,230,247,0.7); font-family: inherit; font-weight: 700; font-size: 0.9rem; cursor: pointer; transition: all .2s ease; }
.po-btn.active { background: linear-gradient(135deg, var(--btn), #8e5dff); color: #fff; }

/* ============================================================
   Карточка-лицензия (стиль пластиковой карты / прав)
   ============================================================ */
.lic-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px,1fr)); gap: 20px; }
.lic-card {
  position: relative; border-radius:12px; padding: 22px; overflow: hidden; aspect-ratio: 1.6 / 1; min-height: 210px;
  color: #fff; background: linear-gradient(135deg, #3a2168 0%, #6a3bb0 45%, #8e53e1 100%);
  box-shadow: 0 18px 50px -12px rgba(142,83,225,0.55), inset 0 1px 0 rgba(255,255,255,0.15);
  display: flex; flex-direction: column; justify-content: space-between;
}
.lic-card.na { background: linear-gradient(135deg, #3a2168, #4a4a55); filter: saturate(.6); }
/* голографический блик */
.lic-card::after {
  content: ''; position: absolute; top: -60%; left: -30%; width: 60%; height: 220%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.18), transparent);
  transform: rotate(18deg); animation: licShine 5.5s ease-in-out infinite;
}
@keyframes licShine { 0%, 70% { left: -40%; } 100% { left: 130%; } }
/* водяной знак-логотип */
.lic-card .lic-wm { position: absolute; right: -10px; bottom: -14px; font-family: 'Wix Madefor Display', sans-serif; font-weight: 700; font-size: 5rem; opacity: 0.10; letter-spacing: -2px; }
.lic-top { display: flex; align-items: flex-start; justify-content: space-between; position: relative; z-index: 1; }
.lic-brand { display: flex; align-items: center; gap: 8px; font-family: 'Wix Madefor Display', sans-serif; font-weight: 700; }
.lic-brand img { height: 26px; border-radius:6px; }
.lic-status { font-size: 0.68rem; font-weight: 800; padding: 4px 10px; border-radius:12px; background: rgba(0,0,0,0.3); }
.lic-status.active { color: #8ef0b6; } .lic-status.expired, .lic-status.revoked { color: #ff9b9b; }
.lic-chip { width: 42px; height: 32px; border-radius:7px; position: relative; z-index: 1; margin: 4px 0;
  background: linear-gradient(135deg, #ffe7a8, #d8a942); box-shadow: inset 0 0 0 1px rgba(0,0,0,0.2); }
.lic-chip::before, .lic-chip::after { content: ''; position: absolute; left: 6px; right: 6px; height: 1px; background: rgba(0,0,0,0.25); }
.lic-chip::before { top: 11px; } .lic-chip::after { top: 20px; }
.lic-name { font-family: 'Wix Madefor Display', sans-serif; font-size: 1.25rem; font-weight: 700; position: relative; z-index: 1; }
.lic-key { font-family: 'Consolas', ui-monospace, monospace; font-size: 1.05rem; letter-spacing: 2px; position: relative; z-index: 1; margin: 2px 0; word-break: break-all; }
.lic-foot { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; position: relative; z-index: 1; font-size: 0.74rem; }
.lic-foot .lf-label { opacity: 0.6; text-transform: uppercase; letter-spacing: .06em; font-size: 0.62rem; }
.lic-foot b { font-size: 0.92rem; font-weight: 700; }
.lic-reveal { margin-top: 10px; align-self: flex-start; padding: 8px 14px; border-radius:9px; border: 1px solid rgba(255,255,255,0.3);
  background: rgba(255,255,255,0.12); color: #fff; font-family: inherit; font-weight: 700; font-size: 0.8rem; cursor: pointer; position: relative; z-index: 1; transition: background .2s; }
.lic-reveal:hover { background: rgba(255,255,255,0.22); }

/* ---- Адаптив ---- */
@media (max-width: 860px) {
  .acc-shell.show { grid-template-columns: 1fr; }
  .acc-side { position: static; flex-direction: column; }
  .acc-tabs { flex-direction: row; flex-wrap: wrap; }
  .acc-tab-btn { flex: 1; min-width: 140px; justify-content: center; }
}
@media (max-width: 520px) {
  .acc-row { grid-template-columns: 1fr; }
  .lic-grid { grid-template-columns: 1fr; }
}
