/* Veřejný instalátor */

.hero { padding: 72px 0 28px; text-align: center; }
.hero .lead { max-width: 640px; margin: 14px auto 0; }

.filters { display: flex; justify-content: center; margin: 8px 0 28px; }

.app-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.app-tile {
  position: relative; display: flex; flex-direction: column; gap: 14px; text-align: left;
  padding: 20px; border: 0; border-radius: var(--r-lg); background: var(--surface); color: var(--text);
  box-shadow: var(--shadow-sm); cursor: pointer;
  transition: transform .35s var(--ease), box-shadow .35s var(--ease);
}
.app-tile:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.app-tile:active { transform: scale(.985); }
.app-tile .app-icon { width: 56px; height: 56px; padding: 9px; }
.app-tile h3 { font-size: 17px; }
.app-tile p { margin: 4px 0 0; font-size: 13.5px; color: var(--text-2); line-height: 1.4; }
.app-tile .meta { margin-top: auto; display: flex; gap: 8px; align-items: center; font-size: 12px; color: var(--text-3); }
.app-tile.disabled { opacity: .5; cursor: not-allowed; }
.app-tile.disabled:hover { transform: none; box-shadow: var(--shadow-sm); }

.recent { margin: 48px auto 0; max-width: 720px; }

/* Konfigurace */
.config { display: grid; grid-template-columns: 300px 1fr; gap: 32px; padding: 36px 0 80px; align-items: start; }
.summary { position: sticky; top: 76px; display: flex; flex-direction: column; gap: 18px; }
.summary .app-head { display: flex; gap: 14px; align-items: center; }
.form-sections { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.fields-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.check-result { border-top: 1px solid var(--separator); padding-top: 14px; display: flex; flex-direction: column; gap: 10px; }

.submit-bar { display: flex; flex-direction: column; gap: 16px; }
.strength { display: flex; gap: 4px; margin-top: 2px; }
.strength i { flex: 1; height: 4px; border-radius: 4px; background: var(--fill); transition: background .3s; }
.strength[data-score="1"] i:nth-child(-n+1) { background: var(--red); }
.strength[data-score="2"] i:nth-child(-n+2) { background: var(--orange); }
.strength[data-score="3"] i:nth-child(-n+3) { background: #b7c400; }
.strength[data-score="4"] i:nth-child(-n+4) { background: var(--green); }

/* Průběh */
.progress-view { max-width: 640px; margin: 0 auto; padding: 56px 0 80px; display: flex; flex-direction: column; gap: 24px; }
.progress-head { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 14px; }
.progress-head .status-badge { width: 72px; height: 72px; border-radius: 50%; display: grid; place-items: center; }
.progress-head .status-badge svg { width: 38px; height: 38px; }
.status-badge.ok { background: var(--green-soft); color: var(--green); animation: pop .5s var(--ease); }
.status-badge.err { background: var(--red-soft); color: var(--red); }
.big-progress { display: flex; flex-direction: column; gap: 8px; }
.big-progress .progress { height: 8px; }
.big-progress .row { font-size: 13px; color: var(--text-2); }
.result-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

@media (max-width: 880px) {
  .config { grid-template-columns: 1fr; gap: 20px; padding-top: 20px; }
  .summary { position: static; }
  .nav-steps { display: none; }
  .fields-2 { grid-template-columns: 1fr; }
  .hero { padding-top: 40px; }
}

/* ---------------------------------------------------- kroky formuláře */
.step-card {
  background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow-sm);
  scroll-margin-top: 76px; transition: box-shadow .4s var(--ease), opacity .4s var(--ease), transform .4s var(--ease);
}
.step-card.is-active { box-shadow: var(--shadow); }
.step-card.is-locked { opacity: .45; box-shadow: none; background: transparent; outline: 1px dashed var(--separator); outline-offset: -1px; }
.step-head { display: flex; align-items: center; gap: 14px; padding: 18px 20px; }
.step-card.is-done .step-head, .step-card.is-todo .step-head { cursor: pointer; }
.step-card.is-done .step-head:hover, .step-card.is-todo .step-head:hover { background: var(--fill); border-radius: var(--r-lg); }
.step-badge {
  width: 30px; height: 30px; border-radius: 50%; flex: none; display: grid; place-items: center;
  font-size: 14px; font-weight: 600; background: var(--fill); color: var(--text-2);
  transition: background .35s var(--ease), color .35s var(--ease), transform .35s var(--ease);
}
.step-badge svg.i { width: 15px; height: 15px; vertical-align: 0; }
.is-active .step-badge { background: var(--accent); color: #fff; }
.is-done .step-badge { background: var(--green); color: #fff; animation: badgePop .5s var(--ease); }
.is-done .step-badge svg path { stroke-dasharray: 24; stroke-dashoffset: 24; animation: draw .45s .1s var(--ease) forwards; }
.step-title { flex: 1; min-width: 0; }
.step-title h2 { font-size: 19px; }
.step-sub { margin: 2px 0 0; font-size: 13.5px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.is-done .step-sub { color: var(--text); }
.step-edit { visibility: hidden; }
.is-done .step-edit, .is-todo .step-edit { visibility: visible; }

/* plynulé rozbalení (grid 0fr → 1fr) */
.step-wrap { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .5s var(--ease); }
.is-active .step-wrap { grid-template-rows: 1fr; }
.step-inner { overflow: hidden; min-height: 0; }
.step-body { display: flex; flex-direction: column; gap: 16px; padding: 0 20px 22px 64px; opacity: 0; transform: translateY(-6px); transition: opacity .35s var(--ease), transform .45s var(--ease); }
.is-active .step-body { opacity: 1; transform: none; transition-delay: .12s; }
.step-actions { display: flex; gap: 10px; padding-top: 4px; }
.step-error:empty { display: none; }
.group.inset { box-shadow: none; background: var(--surface-2); }
.spinner.on-accent { width: 16px; height: 16px; border-color: rgba(255,255,255,.35); border-top-color: #fff; }

/* kroky v souhrnu vlevo */
.nav-steps { list-style: none; margin: 0; padding: 0; position: relative; }
.nav-step a { position: relative; display: flex; align-items: center; gap: 12px; padding: 8px 6px; border-radius: 10px; color: var(--text-2); font-size: 14px; }
.nav-step a:hover { text-decoration: none; background: var(--fill); }
.nav-step .dot { width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--fill-strong); flex: none; transition: all .35s var(--ease); background: var(--bg); position: relative; z-index: 1; }
.nav-step + .nav-step a::before { content: ""; position: absolute; left: 11px; top: -14px; height: 20px; width: 2px; background: var(--fill-strong); transition: background .35s; }
.nav-step.is-done .dot { background: var(--green); border-color: var(--green); }
.nav-step.is-done + .nav-step a::before { background: var(--green); }
.nav-step.is-active a { color: var(--text); font-weight: 600; }
.nav-step.is-active .dot { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.nav-step.is-done a, .nav-step.is-todo a { color: var(--text); }
.nav-step.is-locked a { pointer-events: none; opacity: .55; }

/* ---------------------------------------------------------- animace */
.view { animation: viewIn .55s var(--ease) both; }
@keyframes viewIn { from { opacity: 0; transform: translateY(14px); } }
.app-tile { animation: tileIn .6s var(--ease) both; }
@keyframes tileIn { from { opacity: 0; transform: translateY(18px) scale(.97); } }
.app-tile .app-icon { transition: transform .5s var(--ease); }
.app-tile:hover .app-icon { transform: scale(1.08) rotate(-3deg); }
.hero h1, .hero .lead { animation: viewIn .7s var(--ease) both; }
.hero .lead { animation-delay: .08s; }
.checks li { animation: checkIn .45s var(--ease) both; }
@keyframes checkIn { from { opacity: 0; transform: translateX(-8px); } }
.field.shake { animation: shake .4s var(--ease); }
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
@keyframes badgePop { 0% { transform: scale(.6); } 60% { transform: scale(1.15); } }
@keyframes draw { to { stroke-dashoffset: 0; } }
.status-badge.ok svg.draw path { stroke-dasharray: 24; stroke-dashoffset: 24; animation: draw .6s .25s var(--ease) forwards; }
.status-badge.ok { animation: badgePop .6s var(--ease); box-shadow: 0 0 0 0 var(--green-soft); animation: badgePop .6s var(--ease), ring 1.6s .3s var(--ease); }
@keyframes ring { 0% { box-shadow: 0 0 0 0 rgba(52,199,89,.35); } 100% { box-shadow: 0 0 0 28px rgba(52,199,89,0); } }
.steps li { transition: color .3s; }
.steps li.done .dot { animation: badgePop .45s var(--ease); }
.progress-head .app-icon.lg { animation: float 3s ease-in-out infinite; }
@keyframes float { 50% { transform: translateY(-5px); } }
.progress-view > * { animation: viewIn .55s var(--ease) both; }
.progress-view > :nth-child(2) { animation-delay: .06s; }
.progress-view > :nth-child(3) { animation-delay: .12s; }
.progress-view > :nth-child(4) { animation-delay: .18s; }

@media (max-width: 880px) {
  .step-body { padding-left: 20px; }
}

/* ALTCHA widget v barvách instalátoru */
altcha-widget {
  --altcha-border-radius: 12px; --altcha-border-color: var(--separator); --altcha-border-width: 1px;
  --altcha-color-base: var(--bg-elevated); --altcha-color-base-content: var(--text);
  --altcha-color-primary: var(--accent); --altcha-color-primary-content: #fff;
  --altcha-color-success: var(--green); --altcha-color-error: var(--red);
  --altcha-max-width: 320px; --altcha-shadow: none;
  display: block;
}
