/* ==========================================================================
   Invitație Simplă — landing, galerie, editor, descărcare
   Built on the tokens in css/app.css. Mobile-first: the whole product must be
   usable (choose → edit → pay → download → share) on a 390px screen.
   ========================================================================== */

/* ---------------------------------------------------------------- shared */
.sv-card-frame {                       /* the invitation itself, 9:16 */
    aspect-ratio: 9 / 16;
    background: var(--surface);
    border-radius: var(--r-md);
    overflow: hidden;
    box-shadow: 0 1px 2px rgba(31, 29, 26, .06), 0 12px 28px -12px rgba(31, 29, 26, .28);
}
.sv-card-frame svg,
.sv-card-frame img { display: block; width: 100%; height: 100%; object-fit: cover; }
.sv-skeleton { background: linear-gradient(100deg, var(--surface-2) 30%, var(--surface-3) 50%, var(--surface-2) 70%); background-size: 300% 100%; animation: sv-shimmer 1.4s linear infinite; }
@keyframes sv-shimmer { to { background-position: -150% 0; } }
@media (prefers-reduced-motion: reduce) { .sv-skeleton { animation: none; } }

.sv-price-line { display: inline-flex; align-items: baseline; gap: 8px; }
.sv-price { font-size: 1.5rem; font-weight: 600; letter-spacing: -.01em; }
.sv-price-note { font-size: var(--fs-label); color: var(--text-2); }

/* ---------------------------------------------------------------- landing */
.sv-hero { padding-block: clamp(32px, 6vw, 72px) clamp(40px, 7vw, 88px); background: linear-gradient(180deg, var(--surface-2) 0%, var(--bg) 62%); overflow-x: clip; }
.sv-hero .container { display: grid; gap: clamp(28px, 5vw, 56px); align-items: center; }
@media (min-width: 900px) { .sv-hero .container { grid-template-columns: minmax(0, 1fr) minmax(280px, 380px); } }
.sv-hero h1 { font-family: var(--font-serif); font-size: var(--fs-h1); line-height: var(--lh-tight); margin: 12px 0 0; }
.sv-hero .lead { font-size: 1.0625rem; color: var(--text-2); line-height: var(--lh-normal); margin-top: 14px; max-width: 46ch; }
.sv-hero-actions { display: flex; flex-wrap: wrap; gap: var(--sp-3); margin-top: clamp(20px, 3vw, 28px); }
.sv-hero-meta { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-top: 20px; color: var(--text-2); font-size: var(--fs-label); }
.sv-hero-meta span { display: inline-flex; align-items: center; gap: 7px; }
.sv-hero-meta .icon { width: 16px; height: 16px; color: var(--accent); }

.sv-hero-stack { position: relative; display: grid; place-items: center; overflow-x: clip; padding-block: 8px; }
.sv-hero-stack .sv-card-frame { width: min(280px, 62vw); }
.sv-hero-stack .sv-card-frame:nth-child(1) { position: absolute; transform: rotate(-7deg) translateX(-26%) scale(.88); opacity: .85; }
.sv-hero-stack .sv-card-frame:nth-child(3) { position: absolute; transform: rotate(7deg) translateX(26%) scale(.88); opacity: .85; }
.sv-hero-stack .sv-card-frame:nth-child(2) { position: relative; z-index: 2; }

.sv-benefits { display: grid; gap: var(--sp-5); grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.sv-benefit h3 { font-size: var(--fs-title); margin: 12px 0 6px; }
.sv-benefit p { color: var(--text-2); font-size: var(--fs-label); line-height: var(--lh-normal); }
.sv-benefit .sv-step { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); font-weight: 600; font-size: var(--fs-label); }

.sv-compare { width: 100%; border-collapse: collapse; font-size: var(--fs-label); table-layout: fixed; }
.sv-compare th, .sv-compare td { padding: 12px 10px; border-bottom: 1px solid var(--border); text-align: left; }
.sv-compare thead th { font-weight: 600; color: var(--ink); }
/* value columns: same width + centred in BOTH thead (th) and tbody (td after the row header) */
.sv-compare th:first-child { width: 52%; }
.sv-compare th:not(:first-child), .sv-compare td:not(:first-child) { text-align: center; width: 24%; white-space: nowrap; }
.sv-compare th[scope="row"] { font-weight: 500; }
.sv-compare .yes { color: var(--success); font-weight: 600; }
.sv-compare .no { color: var(--text-3); }
.sv-compare-wrap { overflow-x: auto; }

.sv-choose { display: grid; gap: var(--sp-5); grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.sv-choose .card-pad ul { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 10px; }
.sv-choose li { display: flex; gap: 10px; align-items: flex-start; font-size: var(--fs-label); color: var(--text-2); }
.sv-choose li .icon { width: 17px; height: 17px; flex: none; margin-top: 2px; color: var(--accent); }

/* ---------------------------------------------------------------- gallery */
.sv-toolbar { position: sticky; top: var(--header-h, 64px); z-index: 20; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--border); padding-block: 12px; }
.sv-toolbar .container { display: grid; gap: 10px; }
.sv-toolbar-row { display: flex; align-items: center; gap: var(--sp-3); min-width: 0; }
.sv-count { margin-left: auto; font-size: var(--fs-small); color: var(--text-3); white-space: nowrap; }

.sv-grid { display: grid; gap: clamp(14px, 2.4vw, 26px); grid-template-columns: repeat(auto-fill, minmax(158px, 1fr)); }
@media (min-width: 700px) { .sv-grid { grid-template-columns: repeat(auto-fill, minmax(212px, 1fr)); } }

.sv-tpl { display: flex; flex-direction: column; gap: 10px; text-align: left; background: none; border: 0; padding: 0; cursor: pointer; font: inherit; color: inherit; }
.sv-tpl .sv-card-frame { transition: transform var(--dur-2) var(--ease), box-shadow var(--dur-2) var(--ease); position: relative; }
.sv-tpl:hover .sv-card-frame, .sv-tpl:focus-visible .sv-card-frame { transform: translateY(-3px); box-shadow: 0 2px 4px rgba(31, 29, 26, .07), 0 20px 36px -16px rgba(31, 29, 26, .34); }
.sv-tpl:focus-visible { outline: none; }
.sv-tpl:focus-visible .sv-card-frame { outline: 2px solid var(--accent); outline-offset: 3px; }
.sv-tpl-name { font-weight: 600; font-size: var(--fs-label); }
.sv-tpl-meta { font-size: var(--fs-small); color: var(--text-3); }
.sv-tpl-badge { position: absolute; top: 10px; left: 10px; z-index: 2; background: var(--ink); color: #fff; font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; padding: 4px 9px; border-radius: var(--r-pill); }
.sv-tpl-dots { display: flex; gap: 5px; margin-top: 2px; }
.sv-tpl-dot { width: 11px; height: 11px; border-radius: 50%; border: 1px solid rgba(31, 29, 26, .16); }

/* fullscreen preview */
.sv-viewer { position: fixed; inset: 0; z-index: 90; background: rgba(24, 22, 20, .93); display: none; flex-direction: column; }
.sv-viewer.is-open { display: flex; }
.sv-viewer-head, .sv-viewer-foot { display: flex; align-items: center; gap: var(--sp-3); padding: 12px 16px; color: #fff; }
.sv-viewer-head { justify-content: space-between; padding-top: max(12px, env(safe-area-inset-top)); }
.sv-viewer-title { font-weight: 600; }
.sv-viewer-sub { font-size: var(--fs-small); opacity: .7; }
.sv-viewer-body { flex: 1; display: grid; place-items: center; padding: 4px 16px; min-height: 0; }
.sv-viewer-body .sv-card-frame { height: 100%; width: auto; max-width: 100%; aspect-ratio: 9 / 16; }
.sv-viewer-foot { justify-content: center; gap: var(--sp-3); padding-bottom: max(16px, env(safe-area-inset-bottom)); flex-wrap: wrap; }
/* phones: Anterior | Următorul on one row, „Alege acest model” full-width underneath (same width as the pair) */
@media (max-width: 699px) {
    .sv-viewer-foot { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; max-width: 440px; width: 100%; margin-inline: auto; }
    .sv-viewer-foot [data-prev] { grid-column: 1; grid-row: 1; }
    .sv-viewer-foot [data-next] { grid-column: 2; grid-row: 1; }
    .sv-viewer-foot #viewerChoose { grid-column: 1 / -1; grid-row: 2; }
    .sv-viewer-foot .btn { width: 100%; min-width: 0; }
}
.sv-viewer .btn-ghost { color: #fff; }
.sv-viewer-variants { display: flex; gap: 8px; justify-content: center; padding: 4px 0 8px; flex-wrap: wrap; }
.sv-swatch { width: 30px; height: 30px; border-radius: 50%; border: 2px solid transparent; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .35); cursor: pointer; padding: 0; }
.sv-swatch.is-active { border-color: #fff; }

/* ---------------------------------------------------------------- editor */
.sv-editor { display: grid; gap: 0; align-items: start; }
@media (min-width: 1000px) {
    .sv-editor { grid-template-columns: minmax(0, 45fr) minmax(0, 55fr); gap: clamp(24px, 3vw, 48px); }
    .sv-editor-preview { position: sticky; top: calc(var(--header-h, 64px) + 20px); }
}
.sv-editor-form { padding-bottom: 120px; }
@media (min-width: 1000px) { .sv-editor-form { padding-bottom: 40px; } }

.sv-group { border-top: 1px solid var(--border); padding-top: var(--sp-5); margin-top: var(--sp-5); }
.sv-group:first-of-type { border-top: 0; margin-top: 0; padding-top: 0; }
.sv-group h2 { font-size: var(--fs-title); margin: 0 0 4px; }
.sv-group-hint { font-size: var(--fs-small); color: var(--text-3); margin-bottom: var(--sp-4); }
.sv-fields { display: grid; gap: var(--sp-4); }
@media (min-width: 560px) { .sv-fields.two { grid-template-columns: 1fr 1fr; } }

.sv-editor-preview .sv-card-frame { width: min(100%, 480px); margin-inline: auto; }
.sv-preview-note { margin-top: 12px; text-align: center; font-size: var(--fs-small); color: var(--text-3); }

.sv-variants { display: flex; flex-wrap: wrap; gap: 10px; }
.sv-variant { width: 38px; height: 38px; border-radius: 50%; border: 2px solid transparent; box-shadow: inset 0 0 0 1px var(--border-strong); cursor: pointer; padding: 0; position: relative; }
.sv-variant.is-active { border-color: var(--ink); }
.sv-variant span { position: absolute; inset: 0; border-radius: 50%; }

.sv-typo { display: flex; flex-wrap: wrap; gap: 8px; }
.sv-typo button { border: 1px solid var(--border-strong); background: var(--surface); border-radius: var(--r-md); padding: 8px 14px; cursor: pointer; font-size: var(--fs-label); }
.sv-typo button.is-active { border-color: var(--ink); background: var(--ink); color: #fff; }

.sv-photo { display: grid; gap: 12px; }
.sv-photo-drop { border: 1px dashed var(--border-strong); border-radius: var(--r-md); padding: 22px 16px; text-align: center; background: var(--surface-2); cursor: pointer; }
.sv-photo-drop:hover { border-color: var(--accent); }
.sv-photo-preview { display: flex; gap: 12px; align-items: center; }
.sv-photo-preview img { width: 76px; height: 76px; object-fit: cover; border-radius: var(--r-sm); }
.sv-range { display: grid; gap: 4px; }
.sv-range label { font-size: var(--fs-small); color: var(--text-2); }
.sv-range input[type="range"] { width: 100%; accent-color: var(--accent); }

/* One card per photo slot the active composition asked for. */
.sv-slot { display: grid; gap: 10px; padding: 12px; border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface-1); }
.sv-slot + .sv-slot { margin-top: 10px; }
.sv-slot .sv-photo-drop { border: 1px dashed var(--border-strong); }

/* The photo looks the TEMPLATE offers. Deliberately a short row of names, not a
   filter carousel: these are art directions, and there are never many. */
.sv-looks { display: grid; gap: 6px; }
.sv-looks-label { font-size: var(--fs-small); color: var(--text-2); }
.sv-looks-row { display: flex; flex-wrap: wrap; gap: 6px; }
.sv-look {
    border: 1px solid var(--border); background: var(--surface-2); color: var(--text-2);
    border-radius: 999px; padding: 6px 12px; font-size: var(--fs-small); cursor: pointer;
    transition: border-color .15s ease, color .15s ease, background .15s ease;
}
.sv-look:hover { border-color: var(--accent); color: var(--text-1); }
.sv-look.is-on { border-color: var(--accent); background: var(--accent); color: #fff; }

/* Photographs are placed by dragging them on the preview, so the preview has to
   say so with the cursor — there is no other control for position. */
#preview.can-drag, #sheetPreview.can-drag { cursor: grab; }
#preview.is-dragging, #sheetPreview.is-dragging { cursor: grabbing; }
#preview.is-dragging svg, #sheetPreview.is-dragging svg { user-select: none; }
#preview, #sheetPreview { touch-action: pan-y; }

.sv-warn { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--r-md); background: var(--warning-soft); color: #6C4508; font-size: var(--fs-label); margin-top: var(--sp-4); }
.sv-warn .icon { width: 18px; height: 18px; flex: none; margin-top: 1px; }
.sv-saved { font-size: var(--fs-small); color: var(--text-3); display: inline-flex; align-items: center; gap: 6px; min-height: 20px; }
.sv-saved .icon { width: 14px; height: 14px; }

/* mobile sticky bar — never covered by the keyboard, respects the safe area */
.sv-sticky { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; background: color-mix(in srgb, var(--surface) 94%, transparent); backdrop-filter: blur(10px); border-top: 1px solid var(--border); padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); display: flex; gap: 10px; }
.sv-sticky .btn { flex: 1; }
@media (min-width: 1000px) { .sv-sticky { display: none; } }
body.sv-keyboard .sv-sticky { position: static; padding-bottom: 10px; }

/* mobile fullscreen preview sheet */
.sv-sheet { position: fixed; inset: 0; z-index: 80; background: var(--bg); display: none; flex-direction: column; }
.sv-sheet.is-open { display: flex; }
.sv-sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: max(10px, env(safe-area-inset-top)) 14px 10px; border-bottom: 1px solid var(--border); }
.sv-sheet-body { flex: 1; display: grid; place-items: center; padding: 14px; min-height: 0; }
.sv-sheet-body .sv-card-frame { height: 100%; width: auto; max-width: 100%; }
.sv-sheet-foot { padding: 12px 14px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid var(--border); }

/* ---------------------------------------------------------------- checkout & download */
.sv-summary { display: grid; gap: 10px; }
.sv-summary-row { display: flex; justify-content: space-between; gap: 16px; font-size: var(--fs-label); }
.sv-summary-row.total { border-top: 1px solid var(--border); padding-top: 10px; font-size: var(--fs-title); font-weight: 600; }

.sv-done { display: grid; gap: clamp(20px, 4vw, 40px); align-items: start; }
@media (min-width: 860px) { .sv-done { grid-template-columns: minmax(0, 320px) minmax(0, 1fr); } }
.sv-done .sv-card-frame { width: min(100%, 320px); }
.sv-actions { display: grid; gap: 10px; }
.sv-actions .btn { justify-content: center; }
@media (min-width: 560px) { .sv-actions.two { grid-template-columns: 1fr 1fr; } }

.sv-msg-presets { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.sv-upsell { border: 1px solid var(--border); border-radius: var(--r-lg); padding: clamp(18px, 3vw, 26px); background: linear-gradient(135deg, var(--surface-2), var(--surface)); }
.sv-upsell h3 { font-family: var(--font-serif); font-size: var(--fs-h3); margin: 0 0 6px; }
.sv-upsell p { color: var(--text-2); font-size: var(--fs-label); margin: 0 0 14px; max-width: 52ch; }

.sv-status { display: inline-flex; align-items: center; gap: 7px; font-size: var(--fs-small); padding: 4px 10px; border-radius: var(--r-pill); }
.sv-status.draft { background: var(--surface-3); color: var(--text-2); }
.sv-status.pending { background: var(--warning-soft); color: #6C4508; }
.sv-status.paid { background: var(--success-soft); color: var(--success); }

/* account list */
.sv-mine { display: grid; gap: var(--sp-4); grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.sv-mine-card { display: grid; grid-template-columns: 74px minmax(0, 1fr); gap: 14px; padding: 14px; }
.sv-mine-card .sv-card-frame { width: 74px; }
.sv-mine-card h3 { font-size: var(--fs-label); margin: 0 0 4px; }
.sv-mine-card .meta { font-size: var(--fs-small); color: var(--text-3); }
.sv-mine-actions { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }

/* A photo that would print badly is a blocker, not advice — it reads warmer and
   heavier than the ordinary layout hints beside it. */
.sv-warn-strong { border-color: var(--warning, #b8860b); color: var(--text-1); font-weight: 500; }
