/* Vzhlad podla docs/mockups/mobile-home.html. Ziadne inline styly vo views (prisna CSP). */
:root {
  --app-bg: #f5f6f8;
  --app-border: #e3e5e8;
  --app-muted: #6b7280;
  --app-primary: #0d6efd;
  --app-tabbar-h: 64px;
}

body {
  background: var(--app-bg);
  font-family: -apple-system, system-ui, sans-serif;
  color: #1f2328;
  min-height: 100dvh;
}

.app-header {
  background: #fff;
  border-bottom: 1px solid var(--app-border);
  position: sticky;
  top: 0;
  z-index: 10;
  padding: calc(env(safe-area-inset-top) + 12px) 14px 10px;
}

.app-header .app-sub { color: var(--app-muted); font-size: 12px; }

.app-main {
  padding: 10px 10px calc(var(--app-tabbar-h) + env(safe-area-inset-bottom) + 16px);
}

.app-tabbar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #fff;
  border-top: 1px solid var(--app-border);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  padding-bottom: env(safe-area-inset-bottom);
  font-size: 11px;
}

.app-tabbar a,
.app-tabbar span {
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: var(--app-muted);
}

.app-tabbar [aria-current="page"] { color: var(--app-primary); font-weight: 600; }

.app-topnav { display: none; gap: 8px; align-items: center; }
.app-topnav a,
.app-topnav span {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
  text-decoration: none;
  color: var(--app-muted);
}
.app-topnav [aria-current="page"] { color: var(--app-primary); font-weight: 600; }

.app-card {
  background: #fff;
  border-radius: 10px;
  padding: 12px;
  margin-bottom: 8px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .06);
}

.btn, .form-control, .form-select, .nav-link { min-height: 44px; }

input, select, textarea { font-size: 16px; }

img, table { max-width: 100%; }

.htmx-indicator { opacity: 0; }
.htmx-request .htmx-indicator,
.htmx-request.htmx-indicator { opacity: 1; transition: opacity 200ms ease-in; }

@media (min-width: 992px) {
  .app-tabbar { display: none; }
  .app-topnav { display: flex; }
  .app-header { display: flex; align-items: center; justify-content: space-between; padding-top: 12px; }
  .app-main { max-width: 960px; margin: 0 auto; padding-bottom: 24px; }
}

/* Prihlasovanie a 2FA (layouts/auth) */
.auth-wrap {
  min-height: 100dvh;
  padding: calc(env(safe-area-inset-top) + 48px) 16px calc(env(safe-area-inset-bottom) + 24px);
  background: var(--app-bg);
}
.auth-card {
  max-width: 400px;
  margin: 0 auto;
  background: #fff;
  border: 1px solid var(--app-border);
  border-radius: 8px;
  padding: 16px;
}
@media (min-width: 576px) {
  .auth-card { padding: 24px; }
}
.auth-logo {
  text-align: center;
  margin-bottom: 24px;
  font-size: 20px;
  font-weight: 600;
}
.auth-wrap #app-alert { max-width: 400px; margin: 0 auto 16px; }
.btn { font-weight: 600; }
.form-label { font-weight: 600; }
.install-hint { padding: 16px; margin-bottom: 16px; }
.install-hint[hidden] { display: none !important; }
.install-hint-close { min-width: 44px; min-height: 44px; }
.auth-logo img { vertical-align: middle; margin-right: 8px; }
.auth-wrap .install-hint { max-width: 400px; margin: 0 auto 16px; }

/* 2FA nastavenie */
.qr-box {
  background: #fff;
  padding: 16px;
  max-width: 200px;
  margin: 0 auto 32px;
}
.qr-box svg { width: 100%; height: auto; }
.totp-secret {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 16px;
  user-select: all;
  overflow-wrap: anywhere;
}
.auth-code-input {
  font-size: 28px;
  font-weight: 600;
  letter-spacing: .25em;
  font-variant-numeric: tabular-nums;
  text-align: center;
}

.code-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  list-style: none;
  padding: 0;
  margin: 0 0 24px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 20px;
  font-weight: 600;
}

/* Zapamätať zariadenie: dotykový cieľ aspoň 44 px (UX) */
.auth-card .form-check {
  min-height: 44px;
  padding-left: 2rem;
}
.auth-card .form-check-input {
  width: 1.5rem;
  height: 1.5rem;
  margin-left: -2rem;
  margin-top: 0.1rem;
}

/* Viac a Zabezpecenie */
.security-card + .security-card { margin-top: 16px; }
.device-row,
.event-row { padding: 8px 0; border-bottom: 1px solid var(--app-border); }
.device-row:last-child,
.event-row:last-child { border-bottom: 0; }
.btn-touch { min-width: 44px; min-height: 44px; }
.event-ip { font-family: ui-monospace, monospace; font-size: 12px; }
.more-item { min-height: 48px; display: flex; align-items: center; width: 100%; }
