/* ============================================================
   TableTrust — Споделени стилове
   Версия: 0.2
   Палитра: топла кремава база, теракота акцент, златна детайл
   ============================================================ */

:root {
  /* Палитра */
  --bg: #F8F4ED;
  --bg-alt: #F2EDE2;
  --bg-deep: #EBE4D4;
  --ink: #1F1A17;
  --ink-muted: #6B5F54;
  --ink-soft: #9C8E7D;
  --line: #D9D1C0;
  --line-soft: #E8E2D7;
  --terracotta: #A0432D;
  --terracotta-deep: #7E3220;
  --terracotta-soft: #C66E55;
  --gold: #B8924A;
  --gold-soft: #D4B575;
  --sage: #6B8264;
  --warning: #B8754A;
  --error: #9C3A2A;
  
  /* Шрифтови стекове */
  --font-display: 'Fraunces', 'Times New Roman', serif;
  --font-body: 'Manrope', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', 'Courier New', monospace;
  
  /* Преходи */
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ============================================================
   БАЗА И RESET
   ============================================================ */
* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.55;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  
  background-image: 
    radial-gradient(at 15% 20%, rgba(160, 67, 45, 0.04) 0px, transparent 50%),
    radial-gradient(at 85% 80%, rgba(184, 146, 74, 0.04) 0px, transparent 50%);
}

/* Фин хартиен grain ефект */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  opacity: 0.4;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.12 0 0 0 0 0.1 0 0 0 0 0.09 0 0 0 0.4 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  mix-blend-mode: multiply;
}

.container {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 32px;
  position: relative;
  z-index: 2;
  width: 100%;
}

.container-narrow {
  max-width: 560px;
  margin: 0 auto;
  padding: 0 32px;
  position: relative;
  z-index: 2;
  width: 100%;
}

main { flex: 1; }

/* ============================================================
   ХЕДЪР
   ============================================================ */
header {
  padding: 28px 0 22px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--line);
  position: relative;
  z-index: 10;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
}

.brand-mark {
  width: 36px;
  height: 36px;
  background: var(--ink);
  color: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 16px;
  font-variation-settings: 'opsz' 14;
  border-radius: 2px;
  user-select: none;
  cursor: default;
  transition: all 0.25s var(--ease);
}

.brand-mark.admin-trigger { cursor: pointer; }
.brand-mark.admin-trigger:hover { background: var(--terracotta); }
.brand-mark.admin-pulse { 
  animation: adminPulse 0.4s var(--ease);
}

@keyframes adminPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); background: var(--gold); }
}

.brand-name {
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 500;
  letter-spacing: -0.01em;
  font-variation-settings: 'opsz' 24;
}

/* ============================================================
   ХЕДЪР - НАВИГАЦИОННА ЛЕНТА (малки login бутони)
   ============================================================ */
.header-nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav-link {
  text-decoration: none;
  color: var(--ink-muted);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  padding: 8px 14px;
  border-radius: 2px;
  transition: all 0.2s var(--ease);
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.nav-link:hover {
  color: var(--ink);
  background: var(--bg-alt);
}

.nav-link.primary {
  color: var(--bg);
  background: var(--ink);
}

.nav-link.primary:hover {
  background: var(--terracotta);
}

.nav-divider {
  width: 1px;
  height: 18px;
  background: var(--line);
  margin: 0 6px;
}

/* ============================================================
   HERO (за главната и за компактни страници)
   ============================================================ */
.hero {
  padding: 64px 0 48px;
}

.hero-eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--terracotta);
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.hero-eyebrow::before {
  content: '';
  width: 32px;
  height: 1px;
  background: var(--terracotta);
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(44px, 7vw, 84px);
  font-weight: 400;
  line-height: 0.98;
  letter-spacing: -0.025em;
  font-variation-settings: 'opsz' 144;
  margin-bottom: 20px;
}

.hero-title em {
  font-style: italic;
  color: var(--terracotta);
  font-weight: 300;
  font-variation-settings: 'opsz' 144, 'wght' 300;
}

.hero-tagline {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 400;
  font-style: italic;
  color: var(--ink-muted);
  font-variation-settings: 'opsz' 24;
  max-width: 580px;
}

/* ============================================================
   ФУТЪР
   ============================================================ */
footer {
  border-top: 1px solid var(--line);
  padding: 36px 0;
  margin-top: 60px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ink-muted);
}

footer a {
  color: var(--ink-muted);
  text-decoration: none;
  transition: color 0.2s;
}

footer a:hover { color: var(--terracotta); }

/* ============================================================
   ФОРМИ — обща система за всички форми
   ============================================================ */
.form-page {
  padding: 64px 0;
}

.form-card {
  background: var(--bg);
  border: 1px solid var(--line);
  padding: 48px 44px;
  border-radius: 4px;
  box-shadow: 0 24px 60px -30px rgba(31, 26, 23, 0.15);
}

.form-eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--terracotta);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.form-eyebrow::before {
  content: '';
  width: 24px;
  height: 1px;
  background: var(--terracotta);
}

.form-title {
  font-family: var(--font-display);
  font-size: 36px;
  font-weight: 400;
  line-height: 1.05;
  letter-spacing: -0.02em;
  font-variation-settings: 'opsz' 48;
  margin-bottom: 12px;
}

.form-title em { font-style: italic; color: var(--terracotta); }

.form-lede {
  font-size: 15px;
  color: var(--ink-muted);
  line-height: 1.6;
  margin-bottom: 36px;
}

.form-group {
  margin-bottom: 22px;
}

.form-label {
  display: block;
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--ink-muted);
  margin-bottom: 8px;
}

.form-label .required { color: var(--terracotta); }

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 13px 16px;
  font-family: var(--font-body);
  font-size: 15px;
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 2px;
  transition: all 0.2s var(--ease);
  outline: none;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--ink);
  background: var(--bg-alt);
}

.form-input::placeholder { color: var(--ink-soft); }

.form-textarea {
  min-height: 100px;
  resize: vertical;
  font-family: var(--font-body);
}

.form-help {
  font-size: 12px;
  color: var(--ink-soft);
  margin-top: 6px;
  line-height: 1.5;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.form-row-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

/* PIN/код въвеждане - специален вид */
.form-pin {
  text-align: center;
  font-family: var(--font-mono);
  font-size: 22px;
  letter-spacing: 0.5em;
  padding: 16px;
}

/* ============================================================
   БУТОНИ
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 28px;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-decoration: none;
  border: 1px solid transparent;
  border-radius: 2px;
  cursor: pointer;
  transition: all 0.25s var(--ease);
  background: transparent;
  color: var(--ink);
  white-space: nowrap;
}

.btn-primary {
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
}

.btn-primary:hover {
  background: var(--terracotta);
  border-color: var(--terracotta);
  transform: translateY(-1px);
  box-shadow: 0 8px 20px -8px rgba(160, 67, 45, 0.4);
}

.btn-secondary {
  background: var(--bg);
  border-color: var(--line);
  color: var(--ink);
}

.btn-secondary:hover {
  border-color: var(--ink);
  background: var(--bg-alt);
}

.btn-ghost {
  color: var(--ink-muted);
}

.btn-ghost:hover {
  color: var(--terracotta);
}

.btn-block {
  width: 100%;
}

.btn-arrow::after {
  content: '→';
  transition: transform 0.25s var(--ease);
}

.btn:hover .btn-arrow::after,
.btn-arrow:hover::after {
  transform: translateX(4px);
}

/* ============================================================
   FORM FOOTER — линкове под бутона (напр. "Имам акаунт")
   ============================================================ */
.form-footer {
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  text-align: center;
  font-size: 13px;
  color: var(--ink-muted);
}

.form-footer a {
  color: var(--terracotta);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s;
}

.form-footer a:hover {
  color: var(--terracotta-deep);
  text-decoration: underline;
}

/* ============================================================
   БЕЛЕЖКИ / СЪОБЩЕНИЯ (info, success, warning, error)
   ============================================================ */
.notice {
  padding: 14px 18px;
  border-radius: 2px;
  font-size: 13px;
  line-height: 1.55;
  margin-bottom: 22px;
  border-left: 3px solid;
}

.notice-info {
  background: rgba(184, 146, 74, 0.08);
  border-left-color: var(--gold);
  color: var(--ink);
}

.notice-success {
  background: rgba(107, 130, 100, 0.1);
  border-left-color: var(--sage);
  color: var(--ink);
}

.notice-warning {
  background: rgba(184, 117, 74, 0.1);
  border-left-color: var(--warning);
  color: var(--ink);
}

.notice-error {
  background: rgba(156, 58, 42, 0.08);
  border-left-color: var(--error);
  color: var(--ink);
}

.notice strong {
  font-weight: 600;
}

/* ============================================================
   ВХОДЯЩА АНИМАЦИЯ
   ============================================================ */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  animation: reveal 0.9s var(--ease) forwards;
}

@keyframes reveal {
  to { opacity: 1; transform: translateY(0); }
}

.reveal:nth-child(1) { animation-delay: 0.05s; }
.reveal:nth-child(2) { animation-delay: 0.15s; }
.reveal:nth-child(3) { animation-delay: 0.25s; }
.reveal:nth-child(4) { animation-delay: 0.35s; }
.reveal:nth-child(5) { animation-delay: 0.45s; }
.reveal:nth-child(6) { animation-delay: 0.55s; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 900px) {
  .container, .container-narrow { padding: 0 22px; }
  
  header { padding: 22px 0 18px; }
  
  .header-nav { gap: 2px; }
  .nav-link { padding: 6px 10px; font-size: 12px; }
  .nav-divider { display: none; }
  
  .hero { padding: 48px 0 32px; }
  
  .form-card { padding: 32px 24px; }
  .form-title { font-size: 28px; }
  
  .form-row, .form-row-3 {
    grid-template-columns: 1fr;
  }
  
  footer {
    flex-direction: column;
    gap: 16px;
    text-align: center;
  }
}

@media (max-width: 560px) {
  .nav-link.label { display: none; }
  .nav-link .nav-icon { display: inline; }
  header {
    flex-wrap: wrap;
    gap: 12px;
  }
}
