/* Kako deluje: pinned tour and the product scenes (scene-only styles).
   App styles for each scene live in scene*-app.css, extracted from app/shared/app.css. */

/* ── Tour: text steps left, one pinned stage right ───────────────────── */
.tour { margin-top: 48px; display: grid; grid-template-columns: minmax(0, 400px) minmax(0, 1fr); gap: 64px; }
.tour-steps { list-style: none; }
.tour-step { padding: 26vh 0; transition: opacity 0.35s ease; }
.tour-step:first-child { padding-top: 8vh; }
.tour-step:last-child { padding-bottom: 30vh; }
.tour-step:not(.is-active) { opacity: 0.38; }
.tour-step h3 { font-size: 22px; font-weight: 700; color: var(--navy); line-height: 1.25; letter-spacing: -0.3px; }
.tour-step p { margin-top: 10px; font-size: 15.5px; line-height: 1.65; color: var(--muted); }
.tour-stage { position: sticky; top: calc(50vh - 276px); height: 552px; }
.tour-stage .scene-box { position: absolute; top: 0; left: 0; right: 0; opacity: 0; transform: translateY(12px); transition: opacity 0.45s ease, transform 0.45s ease; pointer-events: none; }
.tour-stage .scene-box.is-active { opacity: 1; transform: none; pointer-events: auto; }
/* CTA under the screen, inside the stage's own height so the next section never covers it. */
.tour-stage-cta { position: absolute; bottom: 0; left: 50%; transform: translateX(-50%); white-space: nowrap; z-index: 2; }
.tour-stage-cta:hover { transform: translateX(-50%) translateY(-2px); }
/* ── Scene box: app window crop at real 100 % scale ──────────────────── */
.scene-box {
  position: relative; height: 480px; display: flex; flex-direction: column;
  background: #ffffff; border: 1px solid #E0D9CE; border-radius: 14px;
  box-shadow: 0 18px 50px rgba(28,43,58,0.08); overflow: hidden;
}
.scene-bar {
  flex-shrink: 0; height: 40px; display: flex; align-items: center; gap: 10px; padding: 0 14px;
  background: var(--navy); color: rgba(249,247,244,0.62); font-size: 12.5px; white-space: nowrap; overflow: hidden;
}
.scene-bar svg { width: 20px; height: 20px; flex-shrink: 0; }
.scene-bar b { color: var(--white); font-weight: 600; }
.scene-bar .sep { opacity: 0.45; }
.scene-body { position: relative; flex: 1; min-height: 0; display: flex; flex-direction: column; padding: 16px 18px 0; }
.scene-body > .dgd-root { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.scene-window { position: relative; flex: 1; min-height: 0; overflow: hidden; margin-top: 4px; }
.scene-window::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 56px; pointer-events: none;
  background: linear-gradient(180deg, rgba(255,255,255,0) 0%, #ffffff 90%);
}
.scene-list { transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1); }
.scene-list.is-following { transition: transform 0.3s ease-out; }
/* The box is short: while writing, the article text gets the room, not the card's footer note. */
.scene-box .arh-app .dgd-root .opis-status.is-running .opis-status-foot { display: none; }
/* Narrower article column than the app's 72 px: the widest label (»123. čl.«) is 40 px. */
.scene-box .arh-app .dgd-root .opis-row { grid-template-columns: 44px minmax(0, 1fr); gap: 8px; }
.scene-box .opis-block { animation: scene-in 0.45s ease both; }
.scene-box .opis-block[hidden] { display: none; }
.scene-replay {
  position: absolute; right: 14px; bottom: 12px; z-index: 2; display: inline-flex; align-items: center; gap: 6px;
  font: 600 12.5px 'Outfit', sans-serif; color: var(--navy); background: #ffffff; cursor: pointer;
  border: 1px solid #E0D9CE; border-radius: 100px; padding: 6px 12px;
  box-shadow: 0 4px 14px rgba(28,43,58,0.08); opacity: 0; transition: opacity 0.3s ease;
}
.scene-box.is-done .scene-replay { opacity: 1; }
/* ── Scene 1: upload → extraction wait ───────────────────────────────── */
.scene-body--flush { padding: 0; }
.scene-views { position: relative; flex: 1; min-height: 0; }
.scene-view { position: absolute; inset: 0; opacity: 0; visibility: hidden; transition: opacity 0.5s ease, visibility 0s linear 0.5s; }
.scene-view.is-shown { opacity: 1; visibility: visible; transition: opacity 0.5s ease; }
/* App spacing, tightened so the panel with two files fits the 440 px body. */
.scene-box .arh-app .app-main .panel.active { padding: 16px 20px; border-radius: 0; }
.scene-box .arh-app .panel-desc { margin-bottom: 10px; }
.scene-box .arh-app .dgd-root .drawing-upload-section { margin-top: 10px; }
.scene-box .arh-app .dgd-root .ds-drop-zone { padding: 22px 24px; }
.scene-box .arh-app .du-list { margin-top: 10px; }
.scene-box .arh-app .panel-foot { margin-top: 14px; }
.scene-box .arh-app .du-item { animation: scene-in 0.35s ease both; }
.scene-box .arh-app .btn.is-pressed { transform: scale(0.96); }
/* The wait screen fills the scene box, with the same layout and copy as the app. */
.scene-box .arh-app .dw-screen { min-height: 100%; padding: 12px 8px; }
/* Podatki o objektih: shorter 3D hero, the card scrolls in the room below it. */
.scene-box .arh-app .dgd-root .objekt-preview.building-model { height: 170px; margin-bottom: 12px; }
.scene-box .arh-app .panel-title-row { margin-bottom: 12px; }
.scene-hero { flex-shrink: 0; }
.scene-box [data-view="data"], .scene-box [data-view="gradnja"] { display: flex; flex-direction: column; }
.scene-box [data-reveal][hidden] { display: none; }
.scene-box [data-reveal] { animation: scene-in 0.35s ease both; }
.scene-box .arh-app .objekt-card + .objekt-card { margin-top: 14px; }
.scene-window--card { flex: 1; min-height: 0; margin-top: 0; }
.scene-window--card .scene-list { transition-duration: 0.25s; }
.scene-box .arh-app .objekt-card { margin: 0; }
/* The dimensions string is long: give it two columns. */
.scene-box .arh-app .objekt-grid > .form-field.scene-wide, .scene-box .arh-app .objekt-grid-4 > .form-field.scene-wide { grid-column: span 2; }
/* Autofill: the value is revealed left to right by a colour wash (cover with a tinted
   leading edge), then a light tint fades. Same for every filled value in the tour. */
.scene-fill-host { position: relative; }
.scene-fill { position: absolute; z-index: 2; pointer-events: none; overflow: hidden; }
.scene-fill-cover {
  position: absolute; top: 0; bottom: 0; left: -72px; right: 0;
  animation: fill-flow 0.48s cubic-bezier(0.45, 0, 0.25, 1) both;
}
.scene-box .arh-app .form-field.is-filled input,
.scene-box .arh-app .form-field.is-filled textarea,
.scene-box .arh-app .form-field.is-filled .ui-select-trigger,
.scene-box .arh-app .form-field.is-filled .idz-zazidana,
.scene-box .arh-app [data-count].is-filled,
.scene-box .arh-app .dist-cell.is-filled,
.scene-box .arh-app textarea.is-filled,
.scene-box .arh-app .opis-block-utemeljitev.is-filled { animation: fill-tint 0.45s ease-out; }
/* Opis draft: room between the colour wash and the text. */
.scene-box .arh-app .dgd-root .opis-block-utemeljitev { padding: 8px 12px; border-radius: 8px; }
/* More air between input rows than the app's 12 px. */
.scene-box .arh-app .dgd-root .objekt-grid, .scene-box .arh-app .dgd-root .objekt-grid-4 { row-gap: 20px; }
.scene-box .arh-app .form-field label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* Pregled odmikov: narrower cells than the app's 96 px so six parcels fit the box. */
.scene-box .arh-app .dist-matrix td.dist-cell { min-width: 0; }
.scene-box .arh-app .dist-matrix th, .scene-box .arh-app .dist-matrix td { padding: 9px 8px; }
.scene-box .arh-app .dist-matrix-wrap { overflow: hidden; }
.scene-drag {
  position: absolute; left: 0; top: 0; z-index: 3; pointer-events: none; opacity: 0;
  transition: transform 1s cubic-bezier(0.45, 0, 0.2, 1), opacity 0.3s ease;
}
.scene-drag { width: 200px; }
.scene-drag.is-dropping { transition: transform 0.3s ease, opacity 0.3s ease; }
/* The dropped PDF: a sheet showing the actual floor plan (img/, cropped from the drawings). */
.scene-sheet {
  background: #ffffff; border: 1px solid #E0D9CE; border-radius: 6px; padding: 6px 6px 8px;
  box-shadow: 0 14px 34px rgba(28,43,58,0.18); transform: rotate(-4deg); transition: transform 0.3s ease;
}
.scene-sheet img { display: block; width: 100%; height: auto; border-radius: 3px; }
.scene-sheet-name { display: flex; align-items: center; gap: 8px; margin-top: 7px; font-size: 12px; color: var(--text); white-space: nowrap; overflow: hidden; }
.scene-drag.is-dropping .scene-sheet { transform: rotate(0deg) scale(0.6); }
.scene-placeholder .scene-body { align-items: center; justify-content: center; text-align: center; color: var(--muted); font-size: 14px; padding-bottom: 16px; }
.scene-placeholder .scene-body b { display: block; color: var(--navy); font-size: 16px; margin-bottom: 6px; }
@keyframes scene-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes fill-flow { from { transform: translateX(0); } to { transform: translateX(calc(100% + 72px)); } }
@keyframes fill-tint { from { background-color: rgba(111,128,88,0.14); } }

/* ── Mobile: no pinning, each step carries its own box ───────────────── */
/* ── Shared by the later scenes ───────────────────────────────────────── */
/* App rules set display on cards and rows; inside a scene »hidden« must win. */
.scene-box [hidden] { display: none !important; }
.scene-box [data-view="mnenja"], .scene-box [data-view="zahteva"],
.scene-box [data-view="home"], .scene-box [data-view="podpis"] { display: flex; flex-direction: column; overflow: hidden; }
.scene-box .arh-app .badge { transition: background 0.3s ease, color 0.3s ease; }

/* ── Scene 4: obrazci — rail of forms, the official sheet on scaled paper ── */
.scene-obr { position: absolute; inset: 0; display: flex; flex-direction: column; }
.scene-obr-layout { flex: 1; min-height: 0; display: grid; grid-template-columns: 196px minmax(0, 1fr); gap: 14px; }
.scene-box .arh-app .scene-obr-rail { position: relative; top: auto; display: block; max-height: none; overflow: hidden; }
.scene-obr-rail .scene-list { transition: transform 0.35s ease; }
.scene-box .arh-app .obr-rail-folder { display: flex; flex-direction: column; gap: 4px; margin-bottom: 6px; }
.scene-box .arh-app .obr-rail-item { position: relative; padding-right: 30px; }
.scene-check {
  position: absolute; right: 9px; top: 50%; width: 16px; height: 16px; margin-top: -8px; border-radius: 50%;
  border: 1.5px solid var(--line); transition: background 0.25s ease, border-color 0.25s ease;
}
.obr-rail-item.is-ready .scene-check {
  border-color: var(--vivid);
  background: var(--vivid) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 8.4l2.5 2.5L12 5.3' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/12px no-repeat;
}
.scene-obr-pane { position: relative; min-height: 0; }
.scene-paper {
  position: absolute; inset: 0; overflow: hidden; background: #ffffff;
  border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 6px 18px rgba(28,43,58,0.08);
}
.scene-paper-inner { position: absolute; left: 0; top: 0; padding: 18px; transform-origin: 0 0; }
.scene-obr-export { display: flex; align-items: center; justify-content: flex-end; gap: 10px; margin-top: 10px; flex-shrink: 0; }
.scene-box .arh-app .scene-obr-export .du-list { flex: 1; flex-direction: row; flex-wrap: wrap; margin: 0; }
.scene-box .arh-app .scene-obr-export .du-item { padding: 6px 10px; }

/* ── Scene 5: the e-mail dialog lives inside the box, not over the page ── */
.scene-box .arh-app [data-view="mnenja"] .scene-window { flex: none; overflow: visible; }
.scene-box .arh-app [data-view="mnenja"] .scene-window::after { display: none; }
.scene-box .arh-app [data-view="mnenja"] .auth-list { gap: 8px; }
.scene-box .arh-app .scene-recipient { padding: 10px; gap: 0; }
.scene-box .arh-app .scene-recipient .auth-head { align-items: center; flex-wrap: nowrap; gap: 8px; }
.scene-box .arh-app .scene-recipient .auth-inst { font-size: 13px; }
.scene-box .arh-app .scene-recipient .auth-cat { font-size: 10px; letter-spacing: 0; text-transform: none; }
.scene-box .arh-app .scene-recipient .badge { flex-shrink: 0; font-size: 9px; padding: 4px 6px; text-transform: none; letter-spacing: 0; }
.scene-box .arh-app .scene-recipient-content { margin-top: 7px; font-size: 11px; }
.scene-recipient-foot { margin-top: 8px; padding-bottom: 36px; flex-shrink: 0; }
.scene-box .arh-app [data-view="mnenja"] .panel-title-row,
.scene-box .arh-app [data-view="zahteva"] .panel-title-row { margin-bottom: 8px; }
.scene-package-list { display: flex; flex-direction: column; gap: 0; min-height: 0; }
.scene-box .arh-app .scene-package-list .auth-doc-row { flex-wrap: nowrap; padding: 10px 0; gap: 10px; border-bottom: 1px solid var(--line-soft); }
.scene-box .arh-app .scene-package-list .auth-inst { font-size: 13px; }
.scene-box .arh-app .scene-package-list .auth-doc-meta { margin-top: 3px; font-size: 11px; }
.scene-ready-icon { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; width: 24px; height: 24px; border-radius: 50%; background: rgba(111,128,88,0.12); color: var(--vivid); font-size: 13px; font-weight: 700; }
.scene-package-foot { display: flex; align-items: flex-start; flex-direction: column; gap: 10px; margin-top: 16px; padding-bottom: 42px; flex-shrink: 0; }
.scene-box .arh-app .scene-package-foot .btn { white-space: normal; text-align: center; }
.scene-box .arh-app .scene-modal {
  position: absolute; inset: 0; z-index: 2; opacity: 0; visibility: hidden;
  transition: opacity 0.3s ease, visibility 0s linear 0.3s;
}
.scene-box .arh-app .scene-modal.is-open { opacity: 1; visibility: visible; transition: opacity 0.3s ease; }
.scene-box .arh-app .scene-modal .modal { width: calc(100% - 36px); max-width: 560px; padding: 18px 20px; max-height: calc(100% - 24px); overflow: hidden; }
.scene-box .arh-app .scene-modal h3 { margin: 0 0 4px; font-size: 16px; color: var(--navy); }
.scene-box .arh-app .scene-modal .auth-form-row { margin-top: 8px; }
.scene-box .arh-app .scene-modal .modal-foot { margin-top: 10px; display: flex; justify-content: flex-end; }
.scene-box .arh-app .auth-list { display: flex; flex-direction: column; gap: 12px; }
.scene-box [data-pkg] { animation: scene-in 0.3s ease both; }

/* ── Scene 6: projektna mapa — rows arrive one by one ────────────────── */
.scene-box .arh-app .drive-table th:last-child:empty, .scene-box .arh-app .drive-table td.drive-actions { display: none; }
.scene-box .arh-app .drive-table { min-width: 0; table-layout: fixed; }
.scene-box .arh-app .scene-mapa .scene-window { margin-bottom: 36px; }
.scene-box .arh-app .scene-mapa .scene-window::after { display: none; }
.scene-box .arh-app .drive-table th { padding: 7px 8px; font-size: 9px; letter-spacing: 0.5px; }
.scene-box .arh-app .drive-table td { padding: 4px 8px; }
.scene-box .arh-app .drive-table th:nth-child(1) { width: auto; }
.scene-box .arh-app .drive-table th:nth-child(2) { width: 22%; }
.scene-box .arh-app .drive-table th:nth-child(3) { width: 44px; }
.scene-box .arh-app .drive-table th:nth-child(4) { width: 86px; }
.scene-box .arh-app .drive-table th:nth-child(5) { width: 60px; }
.scene-box .arh-app .drive-table th:nth-child(3), .scene-box .arh-app .drive-table td:nth-child(3) { padding-left: 4px; padding-right: 4px; }
.scene-box .arh-app .drive-table .proj-name { font-size: 12px; line-height: 1.35; }
.scene-box .arh-app .drive-table .proj-date { font-size: 10.5px; line-height: 1.4; }
.scene-box .arh-app .drive-table td:first-child > div { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.scene-box .arh-app .drive-table td:nth-child(n+3) { white-space: nowrap; }
.scene-box .arh-app .drive-table .badge {
  max-width: 100%; min-height: 20px; padding: 3px 6px; font-size: 9.5px;
  font-weight: 700; letter-spacing: 0; text-transform: none; white-space: nowrap;
}
.scene-box .arh-app .drive-table .btn-sm { min-height: 24px; padding: 0 7px; font-size: 10px; }
.scene-box tr[data-file] td { transition: background 0.8s ease; }
.scene-box tr[data-file].is-new td { background: rgba(111,128,88,0.12); }
.scene-box tr[data-file]:not([hidden]) { animation: scene-in 0.35s ease both; }

/* ── Scene 7: portal ─────────────────────────────────────────────────── */
.scene-box .portal-app.arh-app .app-main .panel.active { padding: 10px 20px 12px; }
.scene-box .portal-app.arh-app .panel-title-row { margin-bottom: 6px; }
.scene-box .portal-app.arh-app .auth-list { gap: 8px; }
.scene-box .portal-app .portal-alert, .scene-box .portal-app .auth-card { animation: scene-in 0.35s ease both; }

@media (min-width: 901px) and (max-width: 1100px) {
  .scene-box .arh-app .drive-table th:nth-child(n+4), .scene-box .arh-app .drive-table td:nth-child(n+4) { display: none; }
  .scene-box .arh-app .drive-table th:nth-child(1) { width: auto; }
  .scene-box .arh-app .drive-table th:nth-child(2) { width: 30%; }
  .scene-box .arh-app .drive-table th:nth-child(3) { width: 44px; }
}
@media (max-width: 900px) {
  .scene-obr-layout { grid-template-columns: minmax(0, 1fr); grid-template-rows: 118px minmax(0, 1fr); gap: 10px; }
  /* Portal on a phone: the stepper already says which phase it is; two documents are enough. */
  .scene-box .portal-app [data-view="home"] .portal-progress ~ .auth-card { display: none !important; }
  .scene-box .portal-app.arh-app .sec-label { margin: 12px 0 8px; }
  .scene-box .portal-app [data-view="home"] .panel-desc { display: none; }
  .scene-box .portal-app [data-view="podpis"] .auth-card:nth-child(n+3) { display: none !important; }
  .scene-box .arh-app .drive-table th:nth-child(n+3), .scene-box .arh-app .drive-table td:nth-child(n+3) { display: none; }
  .scene-box .arh-app .drive-table th:nth-child(1) { width: 62%; }
  .scene-box .arh-app .drive-table th:nth-child(2) { width: 38%; }
  .tour { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .tour-stage { display: none; }
  .tour-step, .tour-step:first-child, .tour-step:last-child { padding: 0 0 56px; opacity: 1; }
  .tour-step:not(.is-active) { opacity: 1; }
  .tour-step .scene-box { margin-top: 20px; height: 500px; }
  .scene-bar .crumb-mid { display: none; }
  /* The app's .dgd-root rule keeps 4 columns even on phones; the narrow box needs 2. */
  .scene-box .arh-app .dgd-root .objekt-grid,
  .scene-box .arh-app .dgd-root .objekt-grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  /* Phone: the first three parcels only, objects by letter. */
  .scene-box .arh-app .dist-obj-name { display: none; }
  .scene-box .arh-app .dist-matrix th:nth-child(n+5), .scene-box .arh-app .dist-matrix td:nth-child(n+5) { display: none; }
}
@media (max-width: 720px) {
  .band { padding: 72px 16px; }
  .proto-note { padding: 10px 16px; }
  .scene-body { padding: 14px 12px 0; }
}
