/* ============================================================
   Питай Мира — дизайн система
   Палитрата (и радиуси/типография) идват от design/mira-mockup.html.
   Дизайнерът сменя стойностите тук; целият UI ги наследява.
   ============================================================ */
:root {
  --mira-coral: #E8674A;       /* основен акцент — топло коралово */
  --mira-coral-soft: #FBE9E3;
  --mira-teal: #1F5F5B;        /* контраст — дълбоко синьо-зелено */
  --mira-cream: #FAF6F0;       /* фон */
  --mira-ink: #2B2926;         /* текст */
  --mira-muted: #8A837B;
  --mira-line: #EFE7DC;
  --radius: 18px;
  --radius-sm: 12px;
  --font: 'Segoe UI', system-ui, -apple-system, Roboto, sans-serif;
  --shadow-soft: 0 6px 24px rgba(232, 103, 74, .10);
  --shadow-card: 0 10px 24px rgba(31, 95, 91, .10);
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font);
  background: var(--mira-cream);
  color: var(--mira-ink);
  min-height: 100vh;
  line-height: 1.55;
  display: flex;
  flex-direction: column;
}

a { color: var(--mira-teal); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- Header ---------- */
.site-header {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 16px 20px; flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 12px; font-weight: 700; font-size: 20px; color: var(--mira-teal); }
.brand:hover { text-decoration: none; }
.brand .avatar { width: 44px; height: 44px; flex: none; }
.nav { display: flex; align-items: center; gap: 14px; font-size: 15px; }
.nav form { display: inline; }
.nav .credits { }

.credits {
  background: #fff; border: 1px solid var(--mira-line); border-radius: 999px;
  padding: 8px 16px; font-size: 14px; color: var(--mira-muted); white-space: nowrap;
}
.credits b, .credits strong { color: var(--mira-teal); }

/* бутон, който изглежда като линк за „Изход" */
.linklike { background: none; border: none; color: var(--mira-teal); font: inherit; cursor: pointer; padding: 0; }
.linklike:hover { text-decoration: underline; }

/* ---------- Main / контейнер ---------- */
main { flex: 1; width: 100%; max-width: 820px; margin: 0 auto; padding: 12px 20px 56px; }
.narrow { max-width: 560px; }
.center { text-align: center; }

h1 { font-size: 28px; line-height: 1.2; margin-bottom: 8px; }
h2 { font-size: 21px; margin: 22px 0 12px; }
h3 { font-size: 17px; }
.sub { color: var(--mira-muted); font-size: 16px; margin-bottom: 22px; }
p { margin-bottom: 10px; }
.text-danger { color: #C0392B; }
.text-success { color: var(--mira-teal); }

/* ---------- Херо ---------- */
.hero { text-align: center; padding-top: 8px; }
.hero-avatar { width: 92px; height: 92px; margin: 6px auto 12px; display: block; }

.ask {
  display: flex; background: #fff; border: 2px solid var(--mira-coral); border-radius: var(--radius);
  padding: 6px 6px 6px 18px; align-items: center; gap: 10px; box-shadow: var(--shadow-soft);
}
.ask input {
  flex: 1; min-width: 0; border: none; outline: none; font-size: 16px;
  font-family: var(--font); background: transparent; color: var(--mira-ink);
}

/* ---------- Бутони ---------- */
.btn, button.btn, a.btn {
  display: inline-block; background: var(--mira-coral); color: #fff; border: none;
  border-radius: 14px; padding: 13px 24px; font-size: 16px; font-weight: 600;
  font-family: var(--font); cursor: pointer; text-decoration: none; text-align: center;
  transition: filter .12s, transform .12s;
}
.btn:hover { filter: brightness(1.06); text-decoration: none; }
.btn:disabled { opacity: .55; cursor: default; }
.btn-ghost {
  background: #fff; color: var(--mira-teal); border: 1px solid var(--mira-line);
}
.btn-block { display: block; width: 100%; }
.btn-lg { padding: 15px 30px; font-size: 17px; }

/* базови бутони без клас — леко брандирани */
button {
  font-family: var(--font); cursor: pointer; border-radius: var(--radius-sm);
  border: 1px solid var(--mira-line); background: #fff; color: var(--mira-ink);
  padding: 9px 16px; font-size: 15px;
}
button:hover { border-color: var(--mira-coral); }

/* ---------- Плочки ---------- */
.tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-top: 22px; }
.tile {
  background: #fff; border: 1px solid var(--mira-line); border-radius: var(--radius);
  padding: 18px 14px; cursor: pointer; text-align: center; text-decoration: none; color: inherit;
  transition: transform .12s, box-shadow .12s, border-color .12s; display: block;
}
.tile:hover { transform: translateY(-3px); box-shadow: var(--shadow-card); border-color: var(--mira-coral); text-decoration: none; }
.tile .ico { font-size: 26px; margin-bottom: 8px; }
.tile .t { font-weight: 600; font-size: 15px; }
.tile .d { font-size: 12.5px; color: var(--mira-muted); margin-top: 4px; }

/* „Виж всичко, което Мира умее" — под плочките (линк на началото, бутон в /app) */
.see-all {
  display: inline-block; margin: 14px auto 0; padding: 10px 18px; cursor: pointer;
  background: transparent; border: 1px solid var(--mira-coral); border-radius: 999px;
  color: var(--mira-coral); font-weight: 600; font-size: 14.5px; text-decoration: none;
}
.see-all:hover { background: var(--mira-coral-soft); text-decoration: none; }

.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 12px; }
.wide {
  background: var(--mira-coral-soft); border: 1px dashed var(--mira-coral); border-radius: var(--radius);
  padding: 16px; cursor: pointer; font-weight: 600; color: var(--mira-teal); text-decoration: none; display: block;
}
.wide:hover { text-decoration: none; filter: brightness(1.01); }
.wide small { display: block; font-weight: 400; color: var(--mira-muted); margin-top: 4px; }

/* ---------- Карти ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px; }
.card {
  background: #fff; border: 1px solid var(--mira-line); border-radius: var(--radius);
  padding: 18px; box-shadow: var(--shadow-soft);
}
.card h3 { margin-bottom: 6px; }
.card p { margin-bottom: 8px; font-size: 14.5px; }
.card-value { font-size: 26px; font-weight: 700; color: var(--mira-teal); }
.card-label { color: var(--mira-muted); font-size: 14px; }
.card-sub { color: var(--mira-muted); font-size: 12.5px; margin-top: 4px; }
.price { font-size: 1.5rem; font-weight: 700; color: var(--mira-coral); }

/* ---------- Ленти/съобщения ---------- */
.credits-bar {
  background: var(--mira-coral-soft); border: 1px solid var(--mira-line);
  padding: 12px 16px; border-radius: var(--radius-sm); margin-bottom: 16px; color: var(--mira-teal);
}
.credits-bar a { color: var(--mira-teal); font-weight: 600; }

/* ---------- Wizard ---------- */
.wizard { background: #fff; border: 1px solid var(--mira-line); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow-soft); }
.wizard .step-count { color: var(--mira-muted); font-size: 14px; margin-bottom: 6px; }
.progress { height: 6px; background: var(--mira-coral-soft); border-radius: 999px; overflow: hidden; margin-bottom: 18px; }
.progress > span { display: block; height: 100%; background: var(--mira-coral); border-radius: 999px; transition: width .2s; }
.wizard-step { margin: 8px 0 16px; }
.wizard-step label { display: block; font-weight: 600; margin-bottom: 8px; }
.wizard-step small { display: block; color: var(--mira-muted); margin-top: 6px; }
.wizard-step input[type=text], .wizard-step input[type=date], .wizard-step input[type=number],
.wizard-step textarea, .wizard-step select,
.field input, .field textarea, .field select {
  width: 100%; padding: 12px 14px; font-size: 16px; font-family: var(--font);
  border: 1px solid var(--mira-line); border-radius: var(--radius-sm); background: #fff; color: var(--mira-ink);
}
.wizard-step input:focus, .wizard-step textarea:focus, .wizard-step select:focus,
.field input:focus, .field textarea:focus, .field select:focus { outline: none; border-color: var(--mira-coral); }
.wizard-nav { display: flex; gap: 10px; justify-content: space-between; align-items: center; }

/* ---------- Период (daterange) ---------- */
.daterange { display: flex; gap: 12px; flex-wrap: wrap; }
.dr-field { flex: 1; min-width: 130px; }
.dr-label { display: block; font-size: 13px; color: var(--mira-muted); margin-bottom: 4px; }

/* ---------- Редакция до прегледа ---------- */
.preview-grid { display: grid; grid-template-columns: 1fr; gap: 18px; margin: 16px 0; }
.edit-panel { background: #fff; border: 1px solid var(--mira-line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow-soft); }
.edit-panel .field:last-child { margin-bottom: 0; }
@media (min-width: 760px) {
  .preview-grid { grid-template-columns: 320px 1fr; align-items: start; }
}

/* ---------- „Мира работи…" ---------- */
.working { text-align: center; padding: 30px 0; }
.working .avatar { width: 96px; height: 96px; margin: 0 auto 16px; display: block; animation: bob 2s ease-in-out infinite; }
@keyframes bob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
.dots { display: inline-flex; gap: 6px; margin-top: 8px; }
.dots span { width: 9px; height: 9px; border-radius: 50%; background: var(--mira-coral); animation: blink 1.2s infinite both; }
.dots span:nth-child(2) { animation-delay: .2s; }
.dots span:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%,80%,100% { opacity: .25; } 40% { opacity: 1; } }

/* ---------- Резултат (лист) ---------- */
.sheet-wrap { position: relative; display: block; user-select: none; margin: 16px 0; }
.sheet {
  background: #fff; border: 1px solid var(--mira-line); box-shadow: 0 6px 24px rgba(0,0,0,.10);
  padding: 2.4rem; width: 100%; max-width: 620px; margin: 0 auto; min-height: 420px;
  font-family: Georgia, "Times New Roman", serif; line-height: 1.7; border-radius: 8px;
}
.sheet-watermark {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  transform: rotate(-24deg); font-size: 2.2rem; font-weight: bold; letter-spacing: .12rem;
  color: rgba(232, 103, 74, .16); pointer-events: none; user-select: none; text-align: center;
}

/* ---------- Форми (login/register) ---------- */
.auth-card { background: #fff; border: 1px solid var(--mira-line); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow-soft); max-width: 420px; margin: 0 auto; }
.field { margin-bottom: 14px; }
.field label { display: block; font-weight: 600; margin-bottom: 6px; font-size: 14.5px; }

/* ---------- Таблици ---------- */
.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; background: #fff; border-radius: var(--radius); overflow: hidden; }
th, td { border-bottom: 1px solid var(--mira-line); padding: 10px 12px; text-align: left; font-size: 14.5px; }
th { background: var(--mira-coral-soft); color: var(--mira-ink); font-weight: 600; }
.toolbar { display: flex; gap: 10px; align-items: center; margin-bottom: 16px; flex-wrap: wrap; }

/* ---------- Админ: действия по версии, преглед, опасна зона ---------- */
.admin-action { display: inline-block; margin-right: 8px; font-size: 13.5px; color: var(--mira-coral); text-decoration: underline; }
.admin-preview { margin: 18px 0; border: 1px solid var(--mira-line); border-radius: var(--radius); padding: 14px; background: var(--mira-coral-soft); }
.admin-preview-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.danger-zone { margin: 26px 0 8px; border: 1px solid #E3B4AC; border-radius: var(--radius); padding: 16px; background: #FCF3F1; }
.danger-zone h2 { margin-top: 0; color: #C0392B; }
.btn-danger { background: #C0392B; color: #fff; border: none; border-radius: 8px; padding: 9px 16px; font-weight: 600; cursor: pointer; }
.btn-danger:hover { background: #a33124; }
.btn-danger:disabled { opacity: .6; cursor: default; }

/* ---------- Footer ---------- */
.site-footer { text-align: center; padding: 26px 20px 32px; color: var(--mira-muted); font-size: 13px; }
.site-footer .tag { margin-bottom: 6px; }
.site-footer .tag b { color: var(--mira-coral); }
.site-footer a { color: var(--mira-muted); margin: 0 8px; }

/* ---------- Blazor error ---------- */
#blazor-error-ui {
  display: none; position: fixed; bottom: 0; left: 0; right: 0;
  background: #fff3cd; color: #664d03; padding: 10px 16px; box-shadow: 0 -2px 10px rgba(0,0,0,.1);
}
#blazor-error-ui .reload { color: var(--mira-coral); }

/* ---------- По-широки екрани ---------- */
@media (min-width: 620px) {
  h1 { font-size: 32px; }
  .tiles { grid-template-columns: repeat(3, 1fr); gap: 14px; }
  main { padding-top: 20px; }
}
