/* The hidden attribute must always win over .form's display:flex. */
[hidden] { display: none !important; }

.account-body {
  overflow: auto;
  min-height: 100dvh;
  display: grid;
  /* minmax(0,1fr): pin the column to the viewport so wide content can't stretch
     the card past the screen (see the same note in admin.css). */
  grid-template-columns: minmax(0, 1fr);
  justify-items: center;
  align-items: start;
  padding: 2.5rem 1rem 4rem;
  background:
    radial-gradient(900px 500px at 50% -10%, rgba(79,140,255,0.14), transparent 70%),
    var(--bg);
}

.card {
  width: 100%;
  min-width: 0;
  max-width: 400px;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 20px;
  padding: 1.6rem 1.8rem 2rem;
  box-shadow: 0 30px 70px -30px rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(6px);
}
/* Logged-in dashboard: a wider card with panels in a responsive masonry grid.
   (The logged-out login view keeps the narrow 400px card.) */
.account-body.dash .card { max-width: 980px; padding: 1.6rem clamp(1.2rem, 3vw, 2.4rem) 2rem; }
.dash-header {
  display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between;
  gap: 1rem; margin-bottom: 1.4rem;
}
.dash-header-main { flex: 1; min-width: 0; }
.dash-header h1 { margin-bottom: 0.2rem; }
.dash-header .sub { margin-bottom: 0.6rem; }
.dash-logout { flex: none; margin-top: 0; }
.btn-upgrade {
  display: inline-flex; align-items: center; gap: 0.3rem; flex: none;
  padding: 0.5rem 1rem; border-radius: 999px; font-weight: 700; font-size: 0.88rem;
  text-decoration: none; color: #1a1a1a; border: none; cursor: pointer; white-space: nowrap;
  background: linear-gradient(135deg, #ffce6b, #ff8a4c);
  box-shadow: 0 6px 18px -6px rgba(255, 138, 76, 0.7);
  transition: filter 0.15s, transform 0.05s;
}
.btn-upgrade:hover { filter: brightness(1.06); }
.btn-upgrade:active { transform: translateY(1px); }
.dash-header .msg { flex-basis: 100%; margin-top: 0.2rem; }
/* Top-right navigation menu: Záznamy / Admin pills + logout, grouped together. */
.dash-nav { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; flex: none; }
.dash-nav .admin-pill { margin: 0; }
.danger-list {
  margin: 0.3rem 0 0.8rem; padding-left: 1.1rem;
  color: var(--muted); font-size: 0.9rem; line-height: 1.5;
}
.danger-list li { margin-bottom: 0.3rem; }
.danger-list b { color: #ff8a8a; }
.dashboard-grid {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.2rem; align-items: start;
}
.dashboard-grid .panel {
  margin: 0;
  background: rgba(255, 255, 255, 0.03); border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px; padding: 0.4rem 1.3rem 1.3rem;
}
.dashboard-grid .panel h2:first-of-type { margin-top: 1.2rem; }
.panel-danger { border-color: rgba(255, 107, 107, 0.28); }
@media (max-width: 720px) { .dashboard-grid { grid-template-columns: 1fr; } }

/* Ticking toggle (free, above the finish-sound section). */
.panel-sub {
  margin: 1.4rem 0 0.2rem; font-size: 0.95rem; font-weight: 600; color: var(--fg);
  padding-top: 1.1rem; border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.tick-setting { margin-top: 0.9rem; }
.tick-sub { margin-top: 0.45rem; }

/* iOS-style toggle switch. */
.switch { display: inline-flex; align-items: center; gap: 0.6rem; cursor: pointer; user-select: none; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch-track {
  flex: none; position: relative; width: 2.6rem; height: 1.5rem; border-radius: 999px;
  background: rgba(255, 255, 255, 0.14); transition: background 0.18s;
}
.switch-thumb {
  position: absolute; top: 0.15rem; left: 0.15rem; width: 1.2rem; height: 1.2rem;
  border-radius: 50%; background: #fff; transition: transform 0.18s;
}
.switch input:checked + .switch-track { background: var(--accent); }
.switch input:checked + .switch-track .switch-thumb { transform: translateX(1.1rem); }
.switch input:focus-visible + .switch-track { outline: 2px solid var(--accent); outline-offset: 2px; }
.switch-label { font-size: 0.92rem; color: var(--fg); }

/* Účet tab: each grid cell is a column that stacks its panels vertically, so the
   left column (2FA) and the right column (Predplatné → Účet a údaje →
   Nebezpečná zóna) fill independently instead of interleaving row by row. */
.acct-col { display: flex; flex-direction: column; gap: 1.2rem; min-width: 0; }

/* Account tabs (Nastavenia / Účet / Záznamy) */
.acct-tabs { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 1.4rem; }
.acct-tab {
  padding: 0.5rem 1rem; border-radius: 999px; border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04); color: var(--muted); font-size: 0.9rem; font-weight: 600;
  cursor: pointer; text-decoration: none; transition: color .15s, background .15s;
}
.acct-tab:hover { color: var(--fg); background: rgba(255, 255, 255, 0.08); }
.acct-tab.active { color: #fff; background: var(--accent); border-color: transparent; }

/* Pro dashboard link, sits in the header nav next to (and mutually exclusive
   with) the upgrade CTA. Accent pill to signal an active Pro subscription. */
.zaznam-link {
  display: inline-flex; align-items: center; gap: 0.4rem; flex: none;
  padding: 0.5rem 1rem; border-radius: 999px;
  background: rgba(79,140,255,0.12); border: 1px solid rgba(79,140,255,0.3);
  color: var(--accent); text-decoration: none; font-size: 0.88rem; font-weight: 600;
  white-space: nowrap; transition: background .15s;
}
.zaznam-link:hover { background: rgba(79,140,255,0.2); }

.back {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.88rem;
}
.back:hover { color: var(--fg); }

/* .card-logo lives in style.css now (shared chrome across all pages). */

.card h1 { font-size: 1.45rem; margin: 0.2rem 0 0.3rem; }
.card h2 {
  font-size: 0.78rem; margin: 1.8rem 0 0.7rem; color: var(--muted);
  font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em;
}
.sub { color: var(--muted); font-size: 0.92rem; margin-bottom: 1.2rem; line-height: 1.45; }
.sub-warn { color: #ffb347; }

/* Subscription (Predplatné) action buttons — row of ghost buttons. */
.sub-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.sub-actions .btn-ghost { margin-top: 0; }

.form { display: flex; flex-direction: column; gap: 0.7rem; margin-top: 0.4rem; }

input[type=email], input[type=password], input[type=text] {
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 11px;
  color: var(--fg);
  padding: 0.8rem 0.95rem;
  font-size: 1rem;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}
input:focus {
  border-color: var(--accent);
  background: rgba(0, 0, 0, 0.4);
  box-shadow: 0 0 0 3px rgba(79, 140, 255, 0.18);
}

/* One-time-code inputs: big, centered, spaced */
#totpCode, #enableCode, #disableCode {
  text-align: center;
  font-size: 1.5rem;
  letter-spacing: 0.5em;
  text-indent: 0.5em;
  font-variant-numeric: tabular-nums;
}

.btn-fill {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 11px;
  padding: 0.82rem;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, transform 0.05s, box-shadow 0.15s;
  box-shadow: 0 8px 20px -8px rgba(79, 140, 255, 0.6);
}
.btn-fill:hover { background: #3f7bf0; }
.btn-fill:active { transform: translateY(1px); }
.btn-fill:disabled { opacity: 0.4; cursor: not-allowed; box-shadow: none; }

.btn-ghost {
  margin-top: 0.4rem;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--muted);
  border-radius: 11px;
  padding: 0.7rem 1rem;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}
.btn-ghost:hover { color: var(--fg); border-color: rgba(255,255,255,0.3); }

.btn-google {
  display: flex; align-items: center; justify-content: center; gap: 0.6rem;
  background: #fff; color: #1f2329;
  border-radius: 11px; padding: 0.82rem;
  text-decoration: none; font-weight: 600;
  transition: background 0.15s, transform 0.05s;
}
.btn-google:hover { background: #f1f3f6; }
.btn-google:active { transform: translateY(1px); }
.btn-google svg { width: 20px; height: 20px; fill: #4285f4; }

.divider { display: flex; align-items: center; gap: 0.8rem; color: var(--muted); margin: 1.2rem 0; font-size: 0.85rem; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: rgba(255,255,255,0.1); }

.reg { margin-top: 1.2rem; }
.reg summary { color: var(--muted); cursor: pointer; font-size: 0.9rem; }
.reg summary:hover { color: var(--fg); }

/* ---- Pexels photo search ---- */
.pexels-search { display: flex; gap: 0.5rem; margin-top: 0.9rem; }
.pexels-search input {
  flex: 1; min-width: 0; background: var(--bg); color: var(--fg);
  border: 1px solid rgba(255, 255, 255, 0.14); border-radius: 10px; padding: 0.6rem 0.8rem;
  font-size: 1rem;   /* ≥16px so iOS Safari doesn't auto-zoom on focus */
}
.pexels-search .btn-fill { flex: none; }
.pexels-results {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.6rem; margin-top: 0.7rem;
}
.pexels-item {
  position: relative; aspect-ratio: 1; border-radius: 10px; cursor: pointer;
  background-size: cover; background-position: center; border: 2px solid transparent;
  transition: border-color 0.15s, transform 0.05s;
}
.pexels-item:hover { border-color: var(--accent); }
.pexels-item:active { transform: scale(0.97); }
.pexels-item.adding { opacity: 0.5; pointer-events: none; }
.pexels-by {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 0.45rem 0.4rem 0.25rem; font-size: 0.68rem; color: #e6e9f0;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.75)); text-decoration: none;
  border-bottom-left-radius: 8px; border-bottom-right-radius: 8px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.pexels-by:hover { text-decoration: underline; }
.pexels-more { margin-top: 0.7rem; text-align: center; }
.pexels-credit { margin-top: 0.6rem; font-size: 0.78rem; color: var(--muted); }
.pexels-credit a { color: var(--muted); }
.pexels-credit a:hover { color: var(--fg); }

/* ---- Finish-sound picker (Pro) ---- */
.sound-list { display: flex; flex-direction: column; gap: 0.5rem; }
.sound-item {
  display: flex; align-items: center; gap: 0.7rem;
  padding: 0.55rem 0.7rem; border-radius: 10px; cursor: pointer;
  background: rgba(255, 255, 255, 0.04); border: 1px solid rgba(255, 255, 255, 0.09);
  transition: background 0.15s, border-color 0.15s;
}
.sound-item:hover { background: rgba(255, 255, 255, 0.08); }
.sound-item.selected { border-color: var(--accent); background: rgba(79, 140, 255, 0.12); }
.sound-preview {
  flex: none; width: 2rem; height: 2rem; border-radius: 50%;
  display: grid; place-items: center; cursor: pointer;
  background: rgba(255, 255, 255, 0.08); color: var(--fg);
  border: 1px solid rgba(255, 255, 255, 0.14); font-size: 0.7rem;
}
.sound-preview:hover { background: var(--accent); color: #fff; border-color: transparent; }
.sound-name { flex: 1; font-size: 0.92rem; }
.sound-check { color: var(--accent); opacity: 0; font-weight: 700; }
.sound-item.selected .sound-check { opacity: 1; }
.sound-del {
  flex: none; background: none; border: none; color: var(--muted); cursor: pointer;
  font-size: 1.15rem; line-height: 1; padding: 0 0.3rem;
}
.sound-del:hover { color: #ff6b6b; }
.sound-upload { margin-top: 0.7rem; display: flex; align-items: center; gap: 0.7rem; flex-wrap: wrap; }
.sound-upload .sound-hint { color: var(--muted); font-size: 0.78rem; }

.admin-pill {
  display: inline-flex; align-items: center; gap: 0.4rem;
  margin: 0.2rem 0 0.4rem;
  padding: 0.5rem 0.9rem; border-radius: 999px;
  background: rgba(79,140,255,0.12);
  border: 1px solid rgba(79,140,255,0.3);
  color: var(--accent); text-decoration: none; font-size: 0.88rem; font-weight: 600;
}
.admin-pill:hover { background: rgba(79,140,255,0.2); }

/* ---- Danger zone (delete account) ---- */
.danger-title { color: #ff6b6b; margin-top: 2.2rem; }
.btn-danger {
  background: rgba(255, 107, 107, 0.14); border: 1px solid rgba(255, 107, 107, 0.5);
  color: #ff8a8a; border-radius: 10px; padding: 0.6rem 1.1rem; font-weight: 600; cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.btn-danger:hover { background: rgba(255, 107, 107, 0.28); color: #fff; }
.btn-danger:disabled { opacity: 0.5; cursor: default; }
.delete-confirm { margin-top: 0.6rem; }
.delete-confirm input {
  width: 100%; background: var(--bg); color: var(--fg);
  border: 1px solid rgba(255, 107, 107, 0.5); border-radius: 8px;
  padding: 0.55rem 0.7rem; margin: 0.5rem 0; letter-spacing: 0.1em;
}

/* .card-footer lives in style.css now (shared chrome across all pages). */

/* ---- Landing / SEO pages (pomodoro, hiit, casovac-do-triedy, vlozit-casovac).
   Reuse the .card chrome; these rules add readable long-form + quick-start pills.
   Loaded via account.css because all four pages already pull it in. ---- */
.landing { max-width: 720px; line-height: 1.6; }
.landing h1 { font-size: 1.7rem; margin: 0.6rem 0 0.4rem; }
.landing .lead { color: #cfd5e3; font-size: 1.02rem; margin-bottom: 1.2rem; }
/* Override the small-caps .card h2 — landing sections read as normal headings. */
.landing h2 {
  font-size: 1.1rem; margin: 1.7rem 0 0.6rem; color: var(--fg);
  font-weight: 700; text-transform: none; letter-spacing: 0;
}
.landing p, .landing li { color: #cfd5e3; font-size: 0.96rem; }
.landing ul { margin: 0.4rem 0 0.8rem 1.2rem; }
.landing li { margin-bottom: 0.35rem; }
.landing a { color: var(--accent); }
.landing code {
  background: rgba(255, 255, 255, 0.07); border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px; padding: 0.05rem 0.4rem; font-size: 0.9em;
  font-family: ui-monospace, Menlo, Consolas, monospace;
}
.landing .hint { color: var(--muted); font-size: 0.9rem; margin-top: 0.6rem; }

/* Quick-start buttons: filled accent pills linking to the timer pages. */
.qstart { display: flex; flex-wrap: wrap; gap: 0.6rem; margin: 0.9rem 0 0.3rem; }
.qbtn {
  display: inline-flex; flex-direction: column; align-items: flex-start;
  padding: 0.55rem 1.05rem; border-radius: 14px; font-weight: 700;
  font-size: 0.98rem; text-decoration: none; line-height: 1.25;
  color: #fff; background: var(--accent); border: 1px solid transparent;
  box-shadow: 0 8px 20px -10px rgba(79, 140, 255, 0.7);
  transition: background 0.15s, transform 0.05s;
}
.qbtn:hover { background: #3f7bf0; }
.qbtn:active { transform: translateY(1px); }
.qbtn small { font-weight: 500; font-size: 0.76rem; color: rgba(255, 255, 255, 0.82); }
.qbtn.ghost {
  color: var(--fg); background: transparent;
  border-color: rgba(255, 255, 255, 0.18); box-shadow: none;
}
.qbtn.ghost:hover { background: rgba(255, 255, 255, 0.07); }
.qbtn.ghost small { color: var(--muted); }
/* `.landing a{color:accent}` (specificity 0,1,1) otherwise repaints the qbtn's
   main text line blue-on-blue; re-assert the button text colors more specifically. */
.landing a.qbtn { color: #fff; }
.landing a.qbtn.ghost { color: var(--fg); }

/* Live iframe demo + copy-paste snippet on /vlozit-casovac. */
.embed-demo {
  display: block; width: 100%; max-width: 340px; height: 340px;
  border: 1px solid rgba(255, 255, 255, 0.12); border-radius: 12px;
  margin: 0.9rem 0; background: var(--bg);
}
.code-block {
  display: block; width: 100%; background: var(--bg); color: var(--fg);
  border: 1px solid rgba(255, 255, 255, 0.14); border-radius: 10px;
  padding: 0.8rem; margin: 0.4rem 0;
  font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 0.8rem;
  line-height: 1.5; white-space: pre-wrap; word-break: break-word;
}

/* Cross-links to the other landing pages, near the footer. */
.landing-nav { margin-top: 1.8rem; display: flex; flex-wrap: wrap; gap: 0.4rem 1.1rem; }
.landing-nav a { color: var(--muted); font-size: 0.86rem; text-decoration: none; }
.landing-nav a:hover { color: var(--fg); text-decoration: underline; }

.msg { margin-top: 1rem; font-size: 0.9rem; min-height: 1.2em; }
.msg.error { color: #ff6b6b; }
.msg.ok { color: #5fd38a; }

.upload { display: flex; gap: 0.6rem; align-items: center; }
.file-label {
  flex: 1;
  border: 1px dashed rgba(255,255,255,0.2);
  border-radius: 10px; padding: 0.75rem; text-align: center;
  color: var(--muted); cursor: pointer; font-size: 0.9rem;
}
.file-label:hover { border-color: var(--accent); color: var(--fg); }

.gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.6rem; margin-top: 1rem; }
.gallery .thumb {
  aspect-ratio: 1; border-radius: 10px; background-size: cover; background-position: center;
  cursor: pointer; border: 2px solid transparent; position: relative;
}
.gallery .thumb.selected { border-color: var(--accent); }
/* Project (SVG) backgrounds: fit the whole 16:9 watermark instead of cropping. */
.gallery .thumb.contain {
  background-size: contain; background-repeat: no-repeat; background-color: #0b0d12;
}
.gallery .thumb.none {
  background: rgba(0,0,0,0.3); display: grid; place-items: center;
  color: var(--muted); font-size: 0.8rem;
}
.thumb-del {
  position: absolute; top: 4px; right: 4px;
  width: 1.4rem; height: 1.4rem; border-radius: 50%; border: none; cursor: pointer;
  background: rgba(0,0,0,0.55); color: #fff; font-size: 1rem; line-height: 1;
  display: grid; place-items: center; opacity: 0; transition: opacity .15s;
}
.gallery .thumb:hover .thumb-del { opacity: 1; }
.thumb-del:hover { background: #ff6b6b; }
@media (hover: none) { .thumb-del { opacity: 1; } }  /* always visible on touch */

.consent {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.4;
  cursor: pointer;
  margin: 0.2rem 0 0.3rem;
}
.consent input[type=checkbox] {
  width: 1.1rem; height: 1.1rem; margin-top: 0.1rem;
  accent-color: var(--accent); flex: 0 0 auto; cursor: pointer;
}
.consent a { color: var(--accent); }

.links {
  margin-top: 1.1rem;
  display: flex; gap: 0.6rem; justify-content: center;
  font-size: 0.9rem; color: var(--muted);
}
.links a { color: var(--accent); text-decoration: none; }
.links a:hover { text-decoration: underline; }

.notice {
  margin-top: 1rem; padding: 0.9rem;
  background: rgba(79,140,255,0.1);
  border: 1px solid rgba(79,140,255,0.25);
  border-radius: 10px; font-size: 0.9rem;
}
.notice p { margin-bottom: 0.6rem; }

.qr {
  width: 200px; height: 200px; margin: 0.6rem auto;
  background: #fff; padding: 8px; border-radius: 8px;
}
.qr svg { width: 100%; height: 100%; }

.secret { font-size: 0.85rem; color: var(--muted); margin: 0.4rem 0 0.8rem; }
.secret code {
  background: rgba(0,0,0,0.3); padding: 0.15rem 0.4rem; border-radius: 5px;
  color: var(--fg); user-select: all;
}

/* ---- Responsive ---- */

/* Small tablet / large phone: the card hugs the viewport. */
@media (max-width: 720px) {
  .account-body { padding: 1.2rem 0.7rem 3rem; }
  .card { padding: 1.3rem 1.15rem 1.6rem; }
  .account-body.dash .card { padding: 1.3rem 1rem 1.6rem; }
  .dashboard-grid { gap: 0.9rem; }
  .dashboard-grid .panel { padding: 0.3rem 1rem 1.1rem; }
  .acct-col { gap: 0.9rem; }
}

/* Phone: header nav pills go full-width under the title (they otherwise wrap
   into a ragged column pinned right), tighter card chrome. */
@media (max-width: 560px) {
  .account-body { padding: 0.8rem 0.5rem 2.5rem; }
  .card { border-radius: 16px; }
  .dash-header { margin-bottom: 1rem; }
  .dash-nav { width: 100%; }
  .dash-nav > a, .dash-nav > button { flex: 1 1 auto; justify-content: center; text-align: center; }
  .card h1 { font-size: 1.3rem; }
  .gallery, .pexels-results { gap: 0.45rem; }
}

/* Touch devices: keep tap targets comfortable. */
@media (pointer: coarse) {
  .acct-tab { padding: 0.6rem 1.1rem; }
}
