:root {
  --bg: #0f1115;
  --card: #171a21;
  --card-2: #1d212b;
  --border: #2a2e38;
  --text: #eef0f4;
  --text-dim: #9aa0ac;
  --accent: #6C5CE7;
  --accent-2: #00cec9;
  --good: #00cec9;
  --bad: #ff6b6b;
  --radius: 16px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
  padding-bottom: 76px;
}

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

.auth-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.auth-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 32px 28px;
  width: 100%;
  max-width: 380px;
  border: 1px solid var(--border);
}
.auth-card.wide { max-width: 480px; }

.logo {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-size: 30px;
  margin: 0 0 4px;
  text-align: center;
}
.subtitle { color: var(--text-dim); text-align: center; margin: 0 0 24px; font-size: 14px; }

label { display: block; font-size: 13px; color: var(--text-dim); margin: 14px 0 6px; }

input, select, button {
  width: 100%;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--card-2);
  color: var(--text);
  font-size: 15px;
}
input:focus, select:focus { outline: none; border-color: var(--accent); }

.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.btn-primary {
  margin-top: 22px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border: none;
  font-weight: 600;
  cursor: pointer;
  color: #fff;
}
.btn-primary:active { opacity: 0.85; }

.switch { text-align: center; margin-top: 18px; font-size: 14px; color: var(--text-dim); }

.alert {
  background: rgba(255,107,107,0.12);
  border: 1px solid var(--bad);
  color: var(--bad);
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 14px;
  margin-bottom: 14px;
}
.alert.good-alert {
  background: rgba(0,206,201,0.12);
  border-color: var(--good);
  color: var(--good);
}

/* --- App shell --- */
.topnav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}
.topnav-logo {
  font-weight: 700;
  font-size: 18px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.topnav-icon { font-size: 18px; }

.page { max-width: 560px; margin: 0 auto; padding: 20px 16px; }

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
}
.card h2 { margin: 0 0 14px; font-size: 17px; }

.hero-card { text-align: center; }
.calc-row {
  display: flex;
  gap: 8px;
  align-items: center;
}
.currency-prefix {
  background: var(--card-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 10px;
  font-size: 13px;
  color: var(--text-dim);
}
.calc-row input { flex: 1; }
.calc-row .btn-primary { width: auto; margin-top: 0; padding: 12px 18px; }

.result-box { margin-top: 20px; }
.result-big {
  font-size: 30px;
  font-weight: 700;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.stats-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 16px; }
.stat-card { text-align: center; margin-bottom: 0; }
.stat-label { display: block; font-size: 12px; color: var(--text-dim); margin-bottom: 6px; }
.stat-value { font-size: 20px; font-weight: 700; }
.stat-value.good { color: var(--good); }
.stat-value.bad { color: var(--bad); }

.link-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--text);
  font-weight: 600;
}

.items-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.item-card { padding: 0; overflow: hidden; }
.item-photo { width: 100%; height: 120px; object-fit: cover; display: block; }
.item-body { padding: 14px; }
.item-body h3 { margin: 0 0 6px; font-size: 15px; }
.item-price { margin: 0; font-weight: 700; color: var(--accent-2); }
.item-work { margin: 4px 0 10px; font-size: 13px; color: var(--text-dim); }
.item-actions form { display: flex; gap: 6px; }
.btn-small {
  padding: 8px 6px;
  font-size: 12px;
  width: auto;
  flex: 1;
  cursor: pointer;
}
.btn-small.good { border-color: var(--good); color: var(--good); background: transparent; }
.btn-small.bad { border-color: var(--bad); color: var(--bad); background: transparent; }

.bottomnav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  display: flex;
  background: var(--card);
  border-top: 1px solid var(--border);
  padding: 8px 0 max(8px, env(safe-area-inset-bottom));
}
.bottomnav a {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  font-size: 11px;
  color: var(--text-dim);
}
.bottomnav a.active { color: var(--accent-2); }
.bottomnav .icon { font-size: 20px; }

@media (max-width: 400px) {
  .items-grid { grid-template-columns: 1fr; }
}

.row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
.row-3 > div { position: relative; }
.row-3 .unit-label {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 11px;
  color: var(--text-dim);
  pointer-events: none;
}
.hint { font-size: 12px; color: var(--text-dim); margin: 8px 0 0; }
.item-reminder { font-size: 12px; color: var(--text-dim); margin: 0 0 10px; }

/* ============ WHEEL TIME PICKER ============ */
.wheel-picker {
  position: relative;
  display: flex;
  flex-direction: row;
  align-items: stretch;
  gap: 4px;
  background: var(--card-2);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 8px 4px;
  margin-top: 6px;
  width: 100%;
  box-sizing: border-box;
}
.wheel-col {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  box-sizing: border-box;
}
.wheel-scroll {
  height: 120px;
  width: 100%;
  overflow-y: scroll;
  scroll-snap-type: y mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
  box-sizing: border-box;
  mask-image: linear-gradient(to bottom, transparent 0%, black 35%, black 65%, transparent 100%);
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, black 35%, black 65%, transparent 100%);
}
.wheel-scroll::-webkit-scrollbar { display: none; width: 0; height: 0; }
.wheel-pad { height: 40px; flex-shrink: 0; }
.wheel-item {
  height: 40px;
  min-height: 40px;
  max-height: 40px;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  font-weight: 600;
  color: var(--text-dim);
  scroll-snap-align: center;
  transition: color .15s, transform .15s;
  user-select: none;
}
.wheel-item.selected {
  color: var(--accent-2);
  transform: scale(1.15);
}
.wheel-label {
  display: block;
  font-size: 11px;
  color: var(--text-dim);
  margin-top: 4px;
  text-align: center;
  width: 100%;
}
.wheel-highlight {
  position: absolute;
  left: 4px; right: 4px;
  top: 48px;
  height: 40px;
  border-top: 1px solid var(--accent);
  border-bottom: 1px solid var(--accent);
  border-radius: 8px;
  background: rgba(108,92,231,0.08);
  pointer-events: none;
}

/* ============ ANIMACE ============ */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}
.fade-in {
  animation: fadeInUp .5s cubic-bezier(.22,1,.36,1) both;
}

@keyframes pulseGlow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(0,206,201,0.35); }
  50% { box-shadow: 0 0 0 6px rgba(0,206,201,0); }
}
.pulse { animation: pulseGlow 2s ease-in-out infinite; border-radius: 8px; }

@keyframes popIn {
  0% { transform: scale(.9); opacity: 0; }
  60% { transform: scale(1.03); opacity: 1; }
  100% { transform: scale(1); }
}
.result-box { animation: popIn .4s cubic-bezier(.22,1,.36,1) both; }

.btn-anim { transition: transform .12s ease, box-shadow .12s ease; }
.btn-anim:active { transform: scale(0.95); }
.btn-primary:active { transform: scale(0.97); }

@keyframes coinSpin {
  from { transform: rotateY(0deg); }
  to { transform: rotateY(360deg); }
}
.logo:hover { animation: coinSpin 0.6s ease; display: inline-block; }

/* stagger pro grid položek */
.items-grid .item-card { animation-fill-mode: both; }

/* ============ IKONOVÁ TLAČÍTKA ============ */
.item-reminder {
  font-size: 12px;
  color: var(--text-dim);
  margin: 0 0 8px;
  padding: 4px 8px;
  display: inline-block;
}
.reminder-actions {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}
.btn-icon {
  width: auto;
  padding: 8px 12px;
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--text-dim);
  border-radius: 10px;
  cursor: pointer;
  transition: all .15s;
}
.btn-icon:hover, .btn-icon:active { color: var(--accent-2); border-color: var(--accent-2); }

.snooze-box {
  max-height: 0;
  overflow: hidden;
  transition: max-height .35s ease;
  margin-bottom: 8px;
}
.snooze-box.open { max-height: 260px; }
.btn-small-full { margin-top: 10px; }

.bottomnav .icon i, .topnav-icon i { font-size: 18px; }

/* ============ IN-APP TOAST NOTIFIKACE ============ */
.inapp-toast {
  position: fixed;
  top: -140px;
  left: 12px;
  right: 12px;
  max-width: 420px;
  margin: 0 auto;
  background: var(--card);
  border: 1px solid var(--accent);
  border-radius: 16px;
  padding: 16px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  z-index: 9999;
  box-shadow: 0 12px 32px rgba(0,0,0,0.45), 0 0 0 1px rgba(108,92,231,0.15);
  transition: top .45s cubic-bezier(.34,1.56,.64,1), opacity .3s, transform .3s;
  opacity: 0;
}
.inapp-toast.show {
  top: 16px;
  opacity: 1;
  animation: toastWiggle .6s ease .45s;
}
.inapp-toast.hide {
  top: -140px;
  opacity: 0;
}
.inapp-toast.resolved {
  border-color: var(--good);
  transform: scale(0.98);
}

@keyframes toastWiggle {
  0%, 100% { transform: rotate(0deg); }
  25% { transform: rotate(-1.5deg); }
  75% { transform: rotate(1.5deg); }
}

.inapp-toast-icon {
  font-size: 24px;
  color: var(--accent-2);
  flex-shrink: 0;
  animation: bounceIcon 1s ease infinite;
}
@keyframes bounceIcon {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

.inapp-toast-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  font-size: 13px;
  color: var(--text-dim);
}
.inapp-toast-body strong { color: var(--text); font-size: 15px; }
.inapp-toast-question { margin: 6px 0 8px; color: var(--text); font-size: 13px; }
.inapp-toast-actions { display: flex; gap: 8px; transition: opacity .2s; }
.inapp-toast-actions .btn-small { flex: 1; }

.inapp-toast-close {
  width: auto;
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  padding: 0 2px;
}

@media (max-width: 420px) {
  .inapp-toast { left: 8px; right: 8px; }
}

.item-head-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}
.item-head-row h3 { flex: 1; }
.item-head-row form { width: auto; }
.btn-icon-danger:hover, .btn-icon-danger:active {
  color: var(--bad);
  border-color: var(--bad);
}

/* ============ OFFLINE BANNER ============ */
.offline-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255,193,7,0.12);
  border: 1px solid #ffc107;
  color: #ffc107;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 13px;
  margin-bottom: 14px;
}
.expense-note { color: var(--text-dim); font-size: 12px; margin: -4px 0 14px; }
.expense-summary {
  background: rgba(108,92,231,0.1);
  border: 1px solid var(--accent);
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 13px;
  margin-bottom: 14px;
}
.expense-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.expense-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--card-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 14px;
}
.expense-row form { width: auto; }
.expense-row .text-dim { display: block; font-size: 12px; color: var(--text-dim); }
.expense-form { border-top: 1px solid var(--border); padding-top: 14px; margin-top: 4px; }

/* ============ LANDING PAGE ============ */
.landing-body { padding-bottom: 0; overflow-x: hidden; }

.landing-hero {
  position: relative;
  overflow: hidden;
  padding-bottom: 60px;
}
.landing-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.35;
  z-index: 0;
  animation: blobFloat 12s ease-in-out infinite;
}
.blob-1 { width: 340px; height: 340px; background: var(--accent); top: -120px; left: -100px; }
.blob-2 { width: 280px; height: 280px; background: var(--accent-2); top: 100px; right: -80px; animation-delay: -4s; }
.blob-3 { width: 220px; height: 220px; background: #ff6b9d; bottom: -80px; left: 40%; animation-delay: -8s; }

@keyframes blobFloat {
  0%, 100% { transform: translate(0,0) scale(1); }
  33% { transform: translate(20px,-30px) scale(1.08); }
  66% { transform: translate(-20px,20px) scale(0.94); }
}

.landing-nav {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  max-width: 900px;
  margin: 0 auto;
}
.landing-logo { font-size: 22px; }
.landing-nav-actions { display: flex; align-items: center; gap: 14px; }
.landing-link { color: var(--text-dim); font-size: 14px; }
.landing-cta-small { width: auto; margin-top: 0; padding: 10px 18px; font-size: 14px; }

.landing-hero-content {
  position: relative;
  z-index: 2;
  max-width: 640px;
  margin: 40px auto 0;
  padding: 0 24px;
  text-align: center;
}
.landing-piggy {
  font-size: 56px;
  color: var(--accent-2);
  margin-bottom: 20px;
  animation: bounceIcon 2.4s ease-in-out infinite, blobFloat 8s ease-in-out infinite;
}
.landing-title {
  font-size: 34px;
  line-height: 1.25;
  margin: 0 0 16px;
  font-weight: 800;
}
.grad-text {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.landing-subtitle {
  color: var(--text-dim);
  font-size: 16px;
  line-height: 1.6;
  margin: 0 0 30px;
}
.landing-cta-row {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}
.landing-cta {
  width: auto;
  padding: 16px 32px;
  font-size: 16px;
  margin-top: 0;
  box-shadow: 0 8px 24px rgba(108,92,231,0.35);
}
.landing-link-alt { color: var(--text-dim); font-size: 14px; }

.landing-features {
  position: relative;
  z-index: 1;
  max-width: 900px;
  margin: 0 auto;
  padding: 20px 20px 40px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}
.feature-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  transition: transform .2s ease;
}
.feature-card:hover { transform: translateY(-4px); }
.feature-icon {
  width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(108,92,231,0.18), rgba(0,206,201,0.18));
  color: var(--accent-2);
  font-size: 18px;
  margin-bottom: 14px;
}
.feature-card h3 { margin: 0 0 8px; font-size: 15px; }
.feature-card p { margin: 0; font-size: 13px; color: var(--text-dim); line-height: 1.5; }

.landing-how {
  max-width: 700px;
  margin: 0 auto;
  padding: 20px 24px 60px;
  text-align: center;
}
.landing-how h2 { font-size: 22px; margin-bottom: 30px; }
.how-steps { display: flex; flex-direction: column; gap: 22px; text-align: left; }
.how-step { display: flex; align-items: flex-start; gap: 16px; }
.how-num {
  flex-shrink: 0;
  width: 32px; height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
  font-size: 14px;
}
.how-step p { margin: 0; color: var(--text-dim); font-size: 14px; line-height: 1.5; padding-top: 5px; }
.how-step strong { color: var(--text); }

.landing-footer {
  text-align: center;
  padding: 24px;
  border-top: 1px solid var(--border);
  color: var(--text-dim);
  font-size: 13px;
}
.landing-footer a { color: var(--text-dim); text-decoration: underline; }

@media (max-width: 560px) {
  .landing-title { font-size: 27px; }
  .landing-features { grid-template-columns: 1fr; }
  .hide-mobile { display: none; }
}
