/* coreme.ru — дизайн-система в стиле apple.com */

:root {
  --bg: #f5f5f7;
  --surface: #ffffff;
  --text: #1d1d1f;
  --text-secondary: #6e6e73;
  --accent: #0071e3;
  --accent-hover: #0077ed;
  --border: rgba(0, 0, 0, 0.08);
  --dark: #000000;
  --dark-2: #161617;
  --dark-text: #f5f5f7;
  --dark-secondary: #a1a1a6;
  --success: #34c759;
  --error: #ff3b30;
  --warning: #ff9500;
  --radius-card: 18px;
  --radius-input: 12px;
  --radius-pill: 980px;
  --nav-h: 48px;
  --shadow-card: 0 12px 30px rgba(0, 0, 0, 0.08);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI",
          system-ui, "Helvetica Neue", Arial, sans-serif;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.47059;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { font-weight: 600; letter-spacing: -0.015em; }
.container { max-width: 1024px; margin: 0 auto; padding: 0 20px; }

/* ---------- навигация ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--nav-h);
  background: rgba(251, 251, 253, 0.8);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  max-width: 1024px;
  height: 100%;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.nav-logo {
  font-size: 19px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.02em;
}
.nav-logo:hover { text-decoration: none; }
.nav-logo-dot { color: var(--text-secondary); }
.nav-links { display: flex; gap: 20px; }
.nav-right { display: flex; align-items: center; gap: 16px; }
.nav-item { color: var(--text); font-size: 14px; }
.nav-item:hover { text-decoration: none; color: var(--accent); }
.nav-form { display: inline-flex; margin: 0; }
.nav-logout {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 14px;
  font-family: inherit;
  cursor: pointer;
  padding: 0;
}
.nav-logout:hover { color: var(--accent); text-decoration: underline; }

/* ---------- кнопки ---------- */
.btn {
  display: inline-block;
  border-radius: var(--radius-pill);
  padding: 10px 22px;
  font-size: 17px;
  font-weight: 400;
  border: none;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease, transform 0.1s ease;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: scale(0.98); }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-secondary {
  background: transparent;
  border: 1px solid var(--accent);
  color: var(--accent);
}
.btn-secondary:hover { background: rgba(0, 113, 227, 0.06); }
.btn-small { padding: 6px 16px; font-size: 14px; }
.btn-hero {
  background: #fff;
  color: #000;
  padding: 14px 30px;
  font-size: 19px;
}
.btn-hero:hover { background: #e8e8ed; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ---------- hero ---------- */
.hero {
  background: var(--dark);
  color: var(--dark-text);
  text-align: center;
  padding: 96px 20px 110px;
}
.hero-eyebrow {
  font-size: 17px;
  font-weight: 600;
  color: #2997ff;
  letter-spacing: 0.02em;
  margin-bottom: 12px;
}
.hero-title {
  font-size: clamp(40px, 7vw, 80px);
  line-height: 1.05;
  letter-spacing: -0.015em;
  margin-bottom: 20px;
}
.hero-sub {
  font-size: clamp(19px, 2.5vw, 26px);
  color: var(--dark-secondary);
  max-width: 640px;
  margin: 0 auto 32px;
}
.hero-cta { margin-top: 8px; }

/* ---------- секции ---------- */
.section { padding: 70px 0; }
.section-light { background: var(--surface); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.section-title {
  font-size: clamp(28px, 4vw, 44px);
  text-align: center;
  margin-bottom: 8px;
}
.section-sub {
  text-align: center;
  color: var(--text-secondary);
  font-size: 19px;
  margin-bottom: 40px;
}
.page-center { text-align: center; padding: 40px 0; }
.error-code { font-size: 96px; letter-spacing: -0.02em; margin-bottom: 8px; }

/* ---------- карточки ---------- */
.grid-apps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
}
.card {
  display: block;
  background: var(--surface);
  border-radius: var(--radius-card);
  padding: 32px;
  color: var(--text);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.card:hover {
  text-decoration: none;
  transform: scale(1.01) translateY(-2px);
  box-shadow: var(--shadow-card);
}
.card-icon { font-size: 48px; margin-bottom: 16px; }
.card h3 { font-size: 24px; margin-bottom: 6px; }
.card-tagline { color: var(--accent); font-weight: 500; margin-bottom: 10px; }
.card p { color: var(--text-secondary); font-size: 15px; }
.card-cta { display: inline-block; margin-top: 18px; font-size: 15px; }

/* ---------- шаги ---------- */
.grid-steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 28px;
}
.step h3 { font-size: 21px; margin-bottom: 8px; }
.step p { color: var(--text-secondary); font-size: 15px; }
.step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  margin-bottom: 14px;
}

/* ---------- формы ---------- */
.auth-wrap { max-width: 420px; margin: 0 auto; }
.form-card {
  background: var(--surface);
  border-radius: var(--radius-card);
  padding: 36px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
}
.form-title { font-size: 28px; text-align: center; margin-bottom: 4px; }
.form-sub { text-align: center; color: var(--text-secondary); font-size: 15px; margin-bottom: 26px; }
.field { margin-bottom: 18px; }
.field label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 6px; }
.field input[type="email"],
.field input[type="password"],
.field input[type="text"] {
  width: 100%;
  padding: 12px 14px;
  font-size: 16px;
  font-family: inherit;
  border: 1px solid #d2d2d7;
  border-radius: var(--radius-input);
  background: var(--surface);
  color: var(--text);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.field input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(0, 113, 227, 0.25);
}
.form-actions { margin-top: 24px; }
.form-actions .btn { width: 100%; }
.form-alt { text-align: center; margin-top: 18px; font-size: 14px; color: var(--text-secondary); }

/* ---------- сообщения ---------- */
.flash {
  border-radius: var(--radius-input);
  padding: 12px 16px;
  margin-bottom: 18px;
  font-size: 15px;
}
.flash-error { background: rgba(255, 59, 48, 0.1); color: #c42015; border: 1px solid rgba(255, 59, 48, 0.3); }
.flash-ok { background: rgba(52, 199, 89, 0.1); color: #1d7d36; border: 1px solid rgba(52, 199, 89, 0.3); }
.flash-info { background: rgba(0, 113, 227, 0.08); color: var(--accent); border: 1px solid rgba(0, 113, 227, 0.25); }

/* ---------- бейджи статусов ---------- */
.badge {
  display: inline-block;
  padding: 3px 12px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 600;
}
.badge-queued { background: #e8e8ed; color: #4d4d55; }
.badge-running { background: rgba(0, 113, 227, 0.12); color: var(--accent); animation: pulse 1.6s ease-in-out infinite; }
.badge-done { background: rgba(52, 199, 89, 0.14); color: #1d7d36; }
.badge-error { background: rgba(255, 59, 48, 0.12); color: #c42015; }
@keyframes pulse { 50% { opacity: 0.45; } }

/* ---------- прогресс ---------- */
.progress {
  height: 4px;
  border-radius: 2px;
  background: #e8e8ed;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
  transition: width 0.6s ease;
}

/* ---------- таблицы ---------- */
.table-wrap { overflow-x: auto; background: var(--surface); border-radius: var(--radius-card); padding: 8px 20px; }
.table { width: 100%; border-collapse: collapse; font-size: 15px; }
.table th {
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--text-secondary);
  padding: 14px 12px 10px;
  border-bottom: 1px solid var(--border);
}
.table td { padding: 12px; border-bottom: 1px solid var(--border); }
.table tr:last-child td { border-bottom: none; }
.table .mono { font-family: "SF Mono", ui-monospace, Consolas, monospace; font-size: 13px; }

/* ---------- панель загрузки ---------- */
.upload-zone {
  border: 2px dashed #d2d2d7;
  border-radius: var(--radius-card);
  padding: 48px 24px;
  text-align: center;
  background: var(--surface);
  transition: border-color 0.2s ease, background 0.2s ease;
}
.upload-zone.dragover { border-color: var(--accent); background: rgba(0, 113, 227, 0.04); }
.upload-zone input[type="file"] { display: none; }
.upload-zone .drop-title { font-size: 21px; font-weight: 600; margin-bottom: 6px; }
.upload-zone .drop-sub { color: var(--text-secondary); font-size: 14px; }
.file-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-input);
  padding: 10px 14px;
  margin-top: 10px;
  font-size: 14px;
}
.file-row .file-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-row .file-size { color: var(--text-secondary); flex-shrink: 0; }
.file-row .file-remove { color: var(--error); cursor: pointer; flex-shrink: 0; }

/* ---------- лог ---------- */
.log-box {
  background: var(--dark-2);
  color: #d7d7dc;
  border-radius: var(--radius-card);
  padding: 18px 20px;
  font-family: "SF Mono", ui-monospace, Consolas, monospace;
  font-size: 12.5px;
  line-height: 1.55;
  max-height: 380px;
  overflow-y: auto;
  white-space: pre-wrap;
}

/* ---------- админ-фильтры ---------- */
.admin-filters select,
.admin-filters input[type="text"] {
  padding: 8px 12px;
  font-size: 14px;
  font-family: inherit;
  border: 1px solid #d2d2d7;
  border-radius: var(--radius-input);
  background: var(--surface);
  min-width: 140px;
}
.admin-filters input:focus, .admin-filters select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(0, 113, 227, 0.25);
}

/* ---------- админ-навигация ---------- */
.admin-nav {
  background: var(--dark-2);
  border-bottom: 1px solid var(--border);
}
.admin-nav-inner {
  display: flex;
  gap: 24px;
  align-items: center;
  height: 44px;
}
.admin-nav a { color: var(--dark-text); font-size: 14px; }
.admin-nav a:hover { color: #2997ff; text-decoration: none; }

/* ---------- футер ---------- */
.footer {
  background: var(--bg);
  border-top: 1px solid var(--border);
  padding: 34px 0 40px;
}
.footer-inner { max-width: 1024px; margin: 0 auto; padding: 0 20px; }
.footer-tag { font-weight: 600; margin-bottom: 4px; }
.footer p { color: var(--text-secondary); font-size: 13px; }
.footer-fine { margin-top: 12px; }

/* ---------- служебное ---------- */
.mt-8 { margin-top: 8px; } .mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; }
.mt-32 { margin-top: 32px; } .mt-48 { margin-top: 48px; }
.muted { color: var(--text-secondary); }
.small { font-size: 13px; }
.hidden { display: none; }
.flex-between { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
@media (max-width: 600px) {
  .nav-links { display: none; }
  .hero { padding: 64px 20px 80px; }
  .section { padding: 48px 0; }
}
