/* ==========================================================================
   base.css — палитрата, шрифтовете и общите елементи (бутони, полета, карти)
   Ползва се и от сайта, и от CRM-а. Нищо специфично за календара тук.
   ========================================================================== */

:root {
  /* --- кремавата палитра (раздел 3 от спецификацията) --- */
  --bg:        #FAF6EF;   /* фон основен  */
  --bg-2:      #F2EBE0;   /* фон секции   */
  --card:      #FFFCF7;   /* карти        */
  --text:      #2E2A25;   /* текст основен*/
  --text-2:    #7B7268;   /* текст вторичен */
  --line:      #E4DACA;   /* линии и рамки */
  --accent:    #B98B4E;   /* акцент, бутони */
  --accent-2:  #9E7539;   /* акцент при hover */
  --second:    #7D8F79;   /* второстепенен */
  --free:      #7D8F79;   /* свободен слот */
  --busy:      #C9736A;   /* зает слот     */

  /* --- производни, за да не се повтарят rgba-та из целия файл --- */
  --line-soft: #EFE6D8;
  --accent-05: rgba(185, 139, 78, .05);
  --accent-12: rgba(185, 139, 78, .12);
  --accent-25: rgba(185, 139, 78, .25);
  --shadow-1:  0 1px 2px rgba(46, 42, 37, .05);
  --shadow-2:  0 8px 28px rgba(46, 42, 37, .13);

  --r-sm: 6px;
  --r:    10px;
  --r-lg: 16px;

  /* Шрифтове.
     ВНИМАНИЕ: спецификацията предлага Fraunces за заглавия, но Fraunces НЯМА
     кирилица — на български се сипва в резервен шрифт и целият вид се разваля.
     Затова заглавията са Lora (има кирилица и същия топъл serif характер),
     а текстът е Inter. */
  --font-title: 'Lora', Georgia, 'Times New Roman', serif;
  --font-body:  'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }

/* Атрибутът hidden трябва да бие класовете с display:flex / grid.
   Без това правило скритите панели си стоят на екрана. */
[hidden] { display: none !important; }

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  font-family: var(--font-title);
  font-weight: 600;
  letter-spacing: -.01em;
  margin: 0;
}
h1 { font-size: 26px; }
h2 { font-size: 20px; }
h3 { font-size: 16px; }

a { color: var(--accent-2); }

.muted   { color: var(--text-2); }
.small   { font-size: 13px; }
.spacer  { flex: 1; }
.nowrap  { white-space: nowrap; }
.hidden  { display: none !important; }

/* --------------------------------------------------------------- карти --- */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-1);
}

/* ------------------------------------------------------------- бутони --- */
.btn {
  font: inherit;
  font-weight: 500;
  /* Заради <a class="btn"> („Обади се"): без това връзката стои подчертана,
     в синьо и с друга височина от съседните <button>. */
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 14px;
  border-radius: var(--r);
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--text);
  cursor: pointer;
  white-space: nowrap;
  transition: background .12s ease, border-color .12s ease, color .12s ease;
}
.btn:hover  { background: var(--bg-2); border-color: var(--accent-25); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #FFFCF7;
}
.btn-primary:hover { background: var(--accent-2); border-color: var(--accent-2); }

.btn-ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--bg-2); border-color: transparent; color: var(--text); }

.btn-warn { color: #9C4A41; border-color: #E3C4BF; background: #FBF1EF; }
.btn-warn:hover { background: #F6E3E0; border-color: var(--busy); }

.btn-sm { padding: 5px 10px; font-size: 13px; }

.icon-btn {
  font: inherit;
  width: 32px; height: 32px;
  display: grid; place-items: center;
  border-radius: var(--r-sm);
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-2);
  cursor: pointer;
}
.icon-btn:hover { background: var(--bg-2); color: var(--text); }

/* -------------------------------------------------------------- полета --- */
.field { display: flex; flex-direction: column; gap: 5px; }
.field > label { font-size: 12.5px; color: var(--text-2); font-weight: 500; }

input[type="text"], input[type="email"], input[type="password"],
input[type="date"], input[type="time"], input[type="tel"],
input[type="search"], input[type="number"],
select, textarea {
  font: inherit;
  color: var(--text);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 9px 11px;
  width: 100%;
  transition: border-color .12s ease, box-shadow .12s ease;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-12);
}
textarea { resize: vertical; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* ------------------------------------------------------------- етикети --- */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 12px; font-weight: 500;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--bg-2);
  color: var(--text-2);
}

/* ------------------------------------------------- съобщение на екрана --- */
#toaster {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%);
  display: flex; flex-direction: column; gap: 8px; align-items: center;
  z-index: 100; pointer-events: none;
}
.toast {
  background: var(--text);
  color: var(--bg);
  padding: 10px 16px;
  border-radius: var(--r);
  box-shadow: var(--shadow-2);
  font-size: 14px;
  max-width: 90vw;
  animation: toast-in .18s ease;
}
.toast.err  { background: #8E3F37; }
.toast.ok   { background: #4F6249; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
