/* ═══════════════════════════════════════════════════════
   SiteAI — public/assets/css/app.css
   Базовый CSS для всех frontend-страниц (auth, dashboard, admin).
   Шаблоны и публичные сайты клиентов используют свои стили.
═══════════════════════════════════════════════════════ */

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

:root {
  --bg: #06060f;
  --surface: #0c0c1a;
  --surface-2: #14142a;
  --border: #1a1a30;
  --border-2: #2a2a48;
  --text: #e2e2f0;
  --muted: #6b6b8a;
  --accent: #00b4d8;
  --accent-2: #7c3aed;
  --grad: linear-gradient(135deg, #00b4d8, #7c3aed);
  --green: #10b981;
  --red:   #ef4444;
  --yellow:#f59e0b;
  --font:  'Instrument Sans', system-ui, -apple-system, sans-serif;
  --serif: 'Newsreader', Georgia, serif;
}

html, body { height: 100%; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 22px; border-radius: 8px;
  font-size: 14px; font-weight: 600; line-height: 1;
  border: 1px solid transparent; cursor: pointer; transition: .2s;
  font-family: inherit;
}
.btn-primary {
  background: var(--grad);
  color: #fff;
  box-shadow: 0 4px 16px rgba(0,180,216,.18);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(0,180,216,.28); }
.btn-ghost {
  background: transparent; color: var(--text);
  border-color: var(--border);
}
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn-danger { background: var(--red); color: #fff; }
.btn-danger:hover { background: #dc2626; }
.btn-sm { padding: 7px 14px; font-size: 13px; }
.btn-lg { padding: 15px 32px; font-size: 16px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ── Auth pages ── */
.auth-page {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  background: radial-gradient(ellipse at top, rgba(124,58,237,.12), transparent 60%),
              radial-gradient(ellipse at bottom, rgba(0,180,216,.08), transparent 60%),
              var(--bg);
}
.auth-card {
  width: 100%; max-width: 440px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 40px 32px;
}
.auth-logo {
  font-family: var(--serif);
  font-size: 28px; font-weight: 600;
  text-align: center; margin-bottom: 8px;
}
.auth-logo span {
  background: var(--grad);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.auth-sub {
  color: var(--muted); font-size: 14px;
  text-align: center; margin-bottom: 28px;
}
.auth-card h2 {
  font-family: var(--serif);
  font-size: 24px; font-weight: 600;
  margin-bottom: 24px; text-align: center;
}

/* ── Forms ── */
.form-row { margin-bottom: 14px; }
.form-row label {
  display: block;
  font-size: 12px; font-weight: 600;
  color: var(--muted); letter-spacing: .04em; text-transform: uppercase;
  margin-bottom: 6px;
}
.input {
  width: 100%; padding: 11px 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-family: inherit; font-size: 14px;
  outline: none; transition: .15s;
}
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(0,180,216,.12); }
.input::placeholder { color: var(--muted); opacity: .6; }

.form-error {
  background: rgba(239,68,68,.08);
  border: 1px solid rgba(239,68,68,.3);
  color: #ffb4b4;
  padding: 10px 14px; border-radius: 8px;
  font-size: 13px; margin-bottom: 14px;
  display: none;
}
.form-error.visible { display: block; }

.form-success {
  background: rgba(16,185,129,.08);
  border: 1px solid rgba(16,185,129,.3);
  color: #86efac;
  padding: 10px 14px; border-radius: 8px;
  font-size: 13px; margin-bottom: 14px;
  display: none;
}
.form-success.visible { display: block; }

.btn-block { width: 100%; }

.auth-foot {
  text-align: center; margin-top: 22px;
  font-size: 13px; color: var(--muted);
}
.auth-foot a { color: var(--accent); font-weight: 500; }
.auth-foot a:hover { text-decoration: underline; }

/* ── Dashboard ── */
.app-shell { min-height: 100vh; }
.app-header {
  height: 60px;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.app-logo {
  font-family: var(--serif);
  font-size: 22px; font-weight: 600;
}
.app-logo span {
  background: var(--grad);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.app-nav { display: flex; gap: 4px; align-items: center; }
/* MOBILE-NAV-v1 */
.app-header { position: relative; }
.mnav-burger { display: none; }
.app-nav a {
  padding: 8px 14px; border-radius: 6px;
  font-size: 14px; color: var(--muted); transition: .15s;
}
.app-nav a:hover, .app-nav a.active {
  background: var(--surface-2); color: var(--text);
}
.app-user {
  display: flex; align-items: center; gap: 12px;
  font-size: 13px; color: var(--muted);
}
.app-user-name { color: var(--text); font-weight: 500; }

.app-main {
  padding: 32px 24px;
  max-width: 1280px; margin: 0 auto;
}

/* ── Page header ── */
.page-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 28px; flex-wrap: wrap; gap: 16px;
}
.page-head h1 {
  font-family: var(--serif);
  font-size: 32px; font-weight: 600;
  letter-spacing: -.01em;
}
.page-head .sub {
  color: var(--muted); font-size: 14px; margin-top: 4px;
}

/* ── Cards / Empty state ── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
}

.empty {
  background: var(--surface);
  border: 1px dashed var(--border-2);
  border-radius: 14px;
  padding: 60px 24px; text-align: center;
}
.empty-icon { font-size: 40px; margin-bottom: 12px; opacity: .5; }
.empty h3 { font-family: var(--serif); font-size: 22px; font-weight: 600; margin-bottom: 8px; }
.empty p { color: var(--muted); margin-bottom: 20px; max-width: 420px; margin-left: auto; margin-right: auto; }

/* ── Sites grid (dashboard) ── */
.sites-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 18px;
}
.site-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  transition: .2s;
  cursor: pointer; text-decoration: none; color: inherit;
}
.site-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.site-card-name { font-weight: 600; font-size: 16px; margin-bottom: 4px; }
.site-card-meta { font-size: 13px; color: var(--muted); margin-bottom: 14px; }
.site-status {
  display: inline-block; padding: 3px 10px; border-radius: 99px;
  font-size: 11px; font-weight: 600; letter-spacing: .04em;
  text-transform: uppercase;
}
.site-status-draft   { background: rgba(107,107,138,.15); color: var(--muted); }
.site-status-active  { background: rgba(16,185,129,.15);  color: var(--green); }
.site-status-suspended { background: rgba(245,158,11,.15); color: var(--yellow); }

/* ── Toast ── */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: var(--surface); border: 1px solid var(--border);
  padding: 12px 22px; border-radius: 10px;
  font-size: 14px; font-weight: 500;
  box-shadow: 0 12px 32px rgba(0,0,0,.4);
  display: none; z-index: 200;
}
.toast.visible { display: block; animation: toastUp .25s ease; }
.toast.success { border-color: var(--green); color: var(--green); }
.toast.error   { border-color: var(--red); color: #ffb4b4; }
@keyframes toastUp { from { transform: translate(-50%, 16px); opacity: 0; } to { transform: translate(-50%, 0); opacity: 1; } }

@media (max-width: 600px) {
  .auth-card { padding: 28px 20px; }
  /* MOBILE-NAV-v1: вместо скрытия — выпадающее меню по бургеру */
  .mnav-burger { display: inline-flex; align-items: center; justify-content: center; font-size: 20px; padding: 6px 12px; }
  .app-nav { display: none; position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--panel, #11131c); border-bottom: 1px solid var(--border, rgba(255,255,255,.12));
    padding: 6px 10px 12px; z-index: 90; box-shadow: 0 16px 34px rgba(0,0,0,.5); }
  .app-nav.open { display: flex; }
  .app-nav a { padding: 13px 12px; font-size: 15px; border-radius: 8px; }
  .app-main { padding: 20px 16px; }
  .page-head h1 { font-size: 26px; }
}

/* ── i18n switcher (LV/RU/EN buttons) ── */
.i18n-switcher {
  display: inline-flex;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 99px;
  padding: 3px;
  gap: 2px;
}
.i18n-btn {
  padding: 5px 11px;
  font-family: inherit;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .04em;
  background: transparent;
  border: none;
  color: rgba(255,255,255,.55);
  border-radius: 99px;
  cursor: pointer;
  transition: background .15s, color .15s;
  line-height: 1;
}
.i18n-btn:hover {
  color: #fff;
  background: rgba(255,255,255,.08);
}
.i18n-btn.active {
  background: #fff;
  color: #0a0a0a;
}
.i18n-btn.active:hover {
  background: #fff;
  color: #0a0a0a;
}

/* Light-theme variant for pages with light topbar (auth pages) */
.auth-page .i18n-switcher,
.i18n-switcher.light {
  background: #f4f4f3;
  border-color: #e5e5e3;
}
.auth-page .i18n-btn,
.i18n-switcher.light .i18n-btn {
  color: #6b6b6b;
}
.auth-page .i18n-btn:hover,
.i18n-switcher.light .i18n-btn:hover {
  color: #111;
  background: rgba(0,0,0,.04);
}
.auth-page .i18n-btn.active,
.i18n-switcher.light .i18n-btn.active {
  background: #0a0a0a;
  color: #fff;
}

/* Hide untranslated empty TEXT elements (data-i18n placeholder pattern).
   FORMFIELD-CLOAK-FIX: <input>/<textarea>/<select> are inherently :empty and
   carry data-i18n only to feed their placeholder via data-i18n-attr — never hide them. */
[data-i18n]:empty:not(input):not(textarea):not(select) { visibility: hidden; }
