/* HACCP Online — styles.css */
* { box-sizing: border-box; }
:root {
  --bg: #f8fafc;
  --card: #fff;
  --text: #0f172a;
  --muted: #64748b;
  --line: #e2e8f0;
  --primary: #0f766e;        /* teal */
  --primary-hover: #115e59;
  --primary-light: #ccfbf1;
  --accent: #f59e0b;
  --ok: #10b981;
  --danger: #dc2626;
  --warn: #f59e0b;
}

body {
  margin: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-hover); text-decoration: underline; }

.container { max-width: 980px; margin: 0 auto; padding: 0 20px; }

/* Hero */
.hero {
  background: linear-gradient(135deg, #0f766e 0%, #134e4a 100%);
  color: #fff;
  padding: 24px 0 60px;
}
.hero-flex {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 60px;
}
.logo-link { text-decoration: none; }
.logo { color: #fff; font-weight: 700; font-size: 19px; letter-spacing: -0.3px; }
.topnav { display: flex; gap: 22px; align-items: center; }
.topnav a { color: rgba(255,255,255,0.92); font-weight: 500; font-size: 15px; }
.topnav a:hover { color: #fff; text-decoration: none; }

.hero h1 {
  font-size: 52px; line-height: 1.1; margin: 0 0 18px;
  letter-spacing: -1.5px; font-weight: 800;
}
.hero .lead {
  font-size: 19px; max-width: 640px; color: rgba(255,255,255,0.95); margin: 0 0 28px;
  line-height: 1.55;
}
.hero .hint { color: rgba(255,255,255,0.75); font-size: 13px; margin-top: 14px; }

.btn-primary {
  background: var(--primary); color: #fff !important; padding: 12px 26px;
  border-radius: 10px; font-weight: 700; border: none; cursor: pointer;
  display: inline-block; font-size: 15px;
  transition: background 0.15s, transform 0.1s;
  text-decoration: none !important;
}
.btn-primary:hover { background: var(--primary-hover); }
.btn-primary:active { transform: scale(0.97); }
.btn-hero {
  background: #fff; color: var(--primary) !important; padding: 16px 32px;
  font-size: 17px; font-weight: 700;
}
.btn-hero:hover { background: rgba(255,255,255,0.92); }
.btn-secondary {
  background: #fff; color: var(--primary); padding: 11px 22px;
  border-radius: 10px; font-weight: 600; border: 1.5px solid var(--line); cursor: pointer;
}
.btn-secondary:hover { border-color: var(--primary); }

/* Cards */
main { padding: 40px 0 60px; }
.card {
  background: var(--card); border-radius: 14px; border: 1px solid var(--line);
  padding: 30px; margin-bottom: 24px;
  box-shadow: 0 1px 3px rgba(15,23,42,0.04);
}
.card h2 { margin: 0 0 12px; font-size: 22px; letter-spacing: -0.3px; }
.card p { margin: 0 0 10px; }
.card .hint { font-size: 13px; color: var(--muted); }

/* Features grid */
.features-card { padding-top: 22px; }
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 24px;
  margin-top: 14px;
}
.feature { padding: 4px 2px; }
.feature-icon { font-size: 32px; line-height: 1; margin-bottom: 10px; }
.feature h3 { margin: 0 0 6px; font-size: 16px; letter-spacing: -0.2px; }
.feature p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.55; }

/* Subscribe / registrace */
.subscribe-card {
  background: linear-gradient(135deg, #ccfbf1, #fef3c7);
  border-color: var(--primary-light);
}
.subscribe-form {
  display: flex; gap: 8px; margin: 14px 0; flex-wrap: wrap;
}
.subscribe-form input {
  flex: 1; min-width: 200px;
  padding: 12px 14px; font-size: 15px;
  border: 1.5px solid var(--line); border-radius: 8px;
  font-family: inherit; background: #fff;
}
.subscribe-form input:focus {
  outline: none; border-color: var(--primary);
}
.subscribe-form .btn-primary { white-space: nowrap; }

/* FAQ */
.faq details {
  border-bottom: 1px solid var(--line); padding: 14px 0;
}
.faq details:last-child { border-bottom: 0; }
.faq summary {
  cursor: pointer; font-weight: 600; font-size: 16px; padding-right: 24px;
  position: relative; list-style: none;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::before { content: '+ '; color: var(--primary); font-weight: 700; }
.faq details[open] summary::before { content: '− '; }
.faq summary + p { margin-top: 10px; color: var(--text); }

/* Footer */
.footer {
  background: #0f172a; color: rgba(255,255,255,0.85);
  padding: 40px 0; margin-top: 60px;
  font-size: 14px;
}
.footer a { color: rgba(255,255,255,0.85); }
.footer a:hover { color: #fff; }
.footer-small { font-size: 12px; color: rgba(255,255,255,0.6); margin-top: 8px; }

/* === DASHBOARD === */
.appbar {
  background: #fff; border-bottom: 1px solid var(--line);
  padding: 12px 0; position: sticky; top: 0; z-index: 50;
}
.appbar-inner {
  display: flex; align-items: center; justify-content: space-between;
}
.appbar .logo { color: var(--primary); font-size: 18px; font-weight: 700; }
.appbar-nav { display: flex; gap: 18px; align-items: center; font-size: 14px; }
.appbar-nav .user-email { color: var(--muted); }
.appbar-nav a, .appbar-nav button {
  background: none; border: 0; color: var(--text); cursor: pointer;
  font-size: 14px; font-family: inherit; padding: 4px 0;
}
.appbar-nav a:hover, .appbar-nav button:hover { color: var(--primary); text-decoration: underline; }

.banner {
  background: linear-gradient(135deg, #fef3c7, #fde68a);
  border: 1px solid #fcd34d; border-radius: 12px;
  padding: 14px 18px; margin-bottom: 24px; font-size: 14px;
}
.banner.danger { background: #fee2e2; border-color: #fecaca; color: #991b1b; }
.banner.ok { background: #d1fae5; border-color: #6ee7b7; color: #065f46; }

main.dash { padding: 28px 0 60px; }

/* Section header */
.section-head {
  display: flex; justify-content: space-between; align-items: center;
  margin: 8px 0 16px;
}
.section-head h2 { margin: 0; font-size: 22px; }

/* Grid cards */
.grid-cards {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}
.tile {
  background: #fff; border: 1px solid var(--line); border-radius: 12px;
  padding: 18px; cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.tile:hover { border-color: var(--primary); box-shadow: 0 4px 12px rgba(15,118,110,0.08); }
.tile-title { font-weight: 700; font-size: 16px; margin: 0 0 4px; }
.tile-sub { font-size: 13px; color: var(--muted); margin: 0 0 8px; }
.tile-stats { font-size: 13px; color: var(--text); }
.tile-stats strong { color: var(--primary); }

.tile.add {
  border-style: dashed; background: transparent; color: var(--muted);
  display: flex; align-items: center; justify-content: center;
  min-height: 110px; font-weight: 600;
}
.tile.add:hover { color: var(--primary); background: var(--primary-light); }

/* Forms */
.form-inline {
  display: grid; gap: 10px; margin-top: 14px;
  grid-template-columns: 1fr;
}
@media (min-width: 720px) {
  .form-inline.cols-2 { grid-template-columns: 1fr 1fr; }
  .form-inline.cols-3 { grid-template-columns: 1fr 1fr 1fr; }
  .form-inline.cols-4 { grid-template-columns: 1.5fr 1fr 1fr 1fr; }
}
.field { display: flex; flex-direction: column; gap: 4px; }
.field label { font-size: 13px; color: var(--muted); font-weight: 500; }
.field input, .field select, .field textarea {
  padding: 10px 12px; font-size: 14px; font-family: inherit;
  border: 1.5px solid var(--line); border-radius: 8px;
  background: #fff; color: var(--text);
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--primary);
}
.form-actions {
  display: flex; gap: 8px; justify-content: flex-end;
  margin-top: 12px; flex-wrap: wrap;
}
.btn-ghost {
  background: transparent; border: 1.5px solid var(--line);
  color: var(--text); padding: 11px 22px; border-radius: 10px;
  font-weight: 600; cursor: pointer; font-family: inherit; font-size: 14px;
}
.btn-ghost:hover { border-color: var(--primary); color: var(--primary); }
.btn-danger {
  background: var(--danger); color: #fff !important; padding: 11px 22px;
  border-radius: 10px; font-weight: 600; border: none; cursor: pointer;
}

/* OCR Big CTA */
.cta-ocr {
  background: linear-gradient(135deg, var(--primary), #134e4a);
  color: #fff; border-radius: 14px; padding: 22px 24px;
  display: flex; align-items: center; gap: 18px;
  cursor: pointer; border: none; width: 100%; text-align: left;
  font-family: inherit; transition: transform 0.1s;
}
.cta-ocr:hover { transform: scale(1.005); }
.cta-ocr:active { transform: scale(0.99); }
.cta-ocr-icon { font-size: 38px; line-height: 1; }
.cta-ocr-text { flex: 1; }
.cta-ocr-title { font-size: 18px; font-weight: 700; margin: 0 0 4px; }
.cta-ocr-sub { font-size: 14px; opacity: 0.9; margin: 0; }
.cta-ocr-arrow { font-size: 22px; opacity: 0.7; }

/* Modal */
.modal-bg {
  position: fixed; inset: 0; background: rgba(15,23,42,0.5);
  z-index: 100; display: none; align-items: center; justify-content: center;
  padding: 16px; backdrop-filter: blur(2px);
}
.modal-bg.open { display: flex; }
.modal {
  background: #fff; border-radius: 16px; padding: 24px;
  width: 100%; max-width: 520px; max-height: 90vh; overflow-y: auto;
  box-shadow: 0 20px 50px rgba(0,0,0,0.2);
}
.modal-head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 16px;
}
.modal-head h3 { margin: 0; font-size: 20px; }
.modal-close {
  background: none; border: none; font-size: 24px; cursor: pointer;
  color: var(--muted); width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 6px;
}
.modal-close:hover { background: var(--bg); color: var(--text); }

/* OCR result */
.ocr-preview {
  background: var(--bg); border-radius: 10px; padding: 14px;
  margin: 16px 0;
}
.ocr-preview img {
  max-width: 100%; max-height: 280px; border-radius: 8px; display: block;
  margin: 0 auto;
}
.ocr-temp {
  text-align: center; margin: 16px 0;
}
.ocr-temp-val {
  font-size: 42px; font-weight: 800; color: var(--primary);
  letter-spacing: -1px;
}
.ocr-temp-val.anomaly { color: var(--danger); }
.ocr-confidence {
  font-size: 13px; color: var(--muted); margin-top: 4px;
}

/* Spinner */
.spinner {
  display: inline-block; width: 18px; height: 18px;
  border: 2.5px solid rgba(15,118,110,0.2);
  border-top-color: var(--primary); border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Záznamy list */
.zaznam-list { list-style: none; padding: 0; margin: 12px 0 0; }
.zaznam-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 4px; border-bottom: 1px solid var(--line);
  font-size: 14px;
}
.zaznam-item:last-child { border-bottom: none; }
.zaznam-icon { font-size: 18px; }
.zaznam-info { flex: 1; }
.zaznam-title { font-weight: 600; }
.zaznam-sub { font-size: 12px; color: var(--muted); }
.zaznam-val {
  font-weight: 700; color: var(--primary); white-space: nowrap;
}
.zaznam-val.anomaly { color: var(--danger); }

.empty-state {
  text-align: center; padding: 40px 20px; color: var(--muted);
}
.empty-state-icon { font-size: 48px; margin-bottom: 8px; }

.hidden { display: none !important; }

/* Mobile */
@media (max-width: 640px) {
  .hero { padding: 20px 0 44px; }
  .hero-flex { margin-bottom: 36px; }
  .hero h1 { font-size: 36px; }
  .hero .lead { font-size: 16px; }
  .btn-hero { padding: 14px 24px; font-size: 16px; }
  .card { padding: 22px; }
  .features-grid { grid-template-columns: 1fr; gap: 18px; }
  .appbar-nav .user-email { display: none; }
  .grid-cards { grid-template-columns: 1fr; }
  .modal { padding: 18px; }
  .ocr-temp-val { font-size: 36px; }
}
