/* Ungray app prototype (app.html). Builds on styles.css. */

.app-body { min-height: 100vh; display: flex; flex-direction: column; background: linear-gradient(180deg, #eaf1fd 0, #fff 460px); }
.credit-pill { font-size: 12.5px; font-weight: 500; color: var(--ink-2); padding: 6px 11px; border-radius: 999px; background: #fff; box-shadow: inset 0 0 0 1px var(--line); white-space: nowrap; }
.app-main { flex: 1; padding: 44px 0 64px; }
.app-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 26px; }
.app-title { font-size: clamp(40px, 5.4vw, 60px); }
.app-title em { font-style: italic; background: linear-gradient(90deg, #ff6a3d, #f59e0b 30%, #22a35a 60%, #2a8af0 85%); -webkit-background-clip: text; background-clip: text; color: transparent; padding-right: .08em; }
.seg-lg { font-size: 14px; padding: 4px; border-radius: 12px; background: #fff; box-shadow: inset 0 0 0 1px var(--line); }
.seg-lg button { padding: 8px 20px; border-radius: 9px; }
.seg-lg button.on { background: var(--ink); color: #fff; box-shadow: none; }

/* Drop zones */
.drop { position: relative; border-radius: var(--radius-xl); padding: 3px; cursor: pointer; background: linear-gradient(135deg, rgba(42, 138, 240, .55), rgba(139, 92, 246, .35) 50%, rgba(255, 106, 61, .4)); box-shadow: 0 30px 60px -36px rgba(40, 70, 160, .5); }
.drop[hidden] { display: none; }
.drop:focus-visible { outline: 2px solid var(--blue-a); outline-offset: 4px; }
.drop-inner { min-height: 360px; display: grid; place-content: center; text-align: center; padding: 40px 20px; border-radius: 29px; background: #fff; transition: background .2s ease; }
.drop:hover .drop-inner, .drop.over .drop-inner { background: #f6f9ff; }
.drop-badge {
  width: 58px; height: 58px; margin: 0 auto 18px; border-radius: 16px; display: grid; place-items: center; color: #fff;
  background-image: radial-gradient(100% 100% at 65% 80%, rgba(255, 255, 255, .55) 0, rgba(255, 255, 255, 0) 100%), radial-gradient(115% 115% at 10% 17%, var(--blue-a) 0, var(--blue-b) 100%);
  box-shadow: 12px 12px 22px rgba(148, 172, 243, .45), inset -3px -3px 4px rgba(191, 229, 251, .4);
}
.drop-badge svg { width: 24px; height: 24px; }
.drop h2 { font-size: 23px; font-weight: 500; letter-spacing: -.025em; }
.drop p { margin-top: 6px; color: var(--muted); font-size: 14.5px; }
.link { color: var(--blue-ink); font-weight: 500; text-decoration: underline; text-underline-offset: 3px; }
.samples { margin-top: 22px; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; font-size: 14px; color: var(--muted); }
.samples[hidden] { display: none; }
.sample-row { display: flex; gap: 8px; flex-wrap: wrap; }
.sample-row button { width: 64px; height: 64px; padding: 0; border: 0; border-radius: 12px; overflow: hidden; cursor: pointer; box-shadow: 0 0 0 1px var(--line), 0 8px 16px -10px rgba(20, 30, 60, .45); transition: transform .15s ease; }
.sample-row button:hover { transform: translateY(-2px); }
.sample-row img { width: 100%; height: 100%; object-fit: cover; }

/* Result */
.result, .quote { display: grid; grid-template-columns: minmax(0, 1fr) 310px; gap: 20px; align-items: start; }
.result[hidden], .quote[hidden] { display: none; }
.result-stage { position: relative; border-radius: 20px; overflow: hidden; background: #e7e9ef; box-shadow: 0 30px 60px -30px rgba(20, 40, 100, .45); }
.result-stage .ba { border-radius: 0; width: 100%; aspect-ratio: var(--ar, 4 / 3); max-height: 74vh; background: #14161c; }
.result-stage .ba img { object-fit: contain; }
#beforeImg.gray { filter: grayscale(1); }
.working { position: absolute; inset: 0; display: grid; place-items: center; transition: opacity .45s ease; }
.working.off { opacity: 0; pointer-events: none; }
.shimmer { position: absolute; inset: 0; background: linear-gradient(100deg, rgba(255, 255, 255, 0) 30%, rgba(255, 255, 255, .35) 50%, rgba(255, 255, 255, 0) 70%); background-size: 250% 100%; animation: shimmer 1.3s linear infinite; }
@keyframes shimmer { from { background-position: 150% 0; } to { background-position: -100% 0; } }
.working-pill { position: relative; display: inline-flex; align-items: center; gap: 10px; padding: 10px 16px; border-radius: 999px; background: rgba(15, 17, 24, .74); color: #fff; font-size: 14px; font-weight: 500; -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.spinner { width: 16px; height: 16px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .3); border-top-color: #fff; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.result-side { display: grid; gap: 12px; position: sticky; top: 92px; }
.side-card { background: #fff; border-radius: 20px; padding: 18px; box-shadow: 0 0 0 1px var(--line), 0 20px 40px -26px rgba(20, 30, 60, .35); }
.side-meta { font-size: 13.5px; color: var(--muted); overflow-wrap: anywhere; }
.side-meta b { color: var(--ink); font-weight: 600; }
.side-label { margin: 18px 0 8px; font-size: 11.5px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--muted-2); }
.side-card > .seg { display: flex; width: 100%; }
.side-card > .seg button { flex: 1; }
.dl-ui.flat { padding: 0; box-shadow: none; }
.dl-ui .dl-row { cursor: pointer; }
.btn:disabled { opacity: .5; cursor: not-allowed; filter: grayscale(.4); }
.side-fine { margin-top: 10px; font-size: 12.5px; color: var(--muted); }
.app-note { margin-top: 16px; padding: 12px 14px; border-radius: 12px; background: #fff7e6; color: #7a5200; font-size: 13.5px; }
.app-note code { font-size: 12.5px; background: rgba(0, 0, 0, .06); padding: 1px 5px; border-radius: 5px; }

/* Video quote */
.quote video { width: 100%; max-height: 72vh; border-radius: 20px; background: #000; box-shadow: 0 30px 60px -30px rgba(20, 40, 100, .45); }
.quote-list { margin: 14px 0 0; display: grid; gap: 8px; font-size: 14px; }
.quote-list div { display: flex; justify-content: space-between; gap: 12px; }
.quote-list dt { color: var(--muted); }
.quote-list dd { margin: 0; font-weight: 500; font-variant-numeric: tabular-nums; text-align: right; }
.quote-total { display: flex; justify-content: space-between; align-items: baseline; margin: 14px 0; padding-top: 14px; border-top: 1px solid var(--line); }
.quote-total b { font-size: 30px; font-weight: 500; letter-spacing: -.03em; }

.app-foot { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 20px 0 28px; font-size: 12.5px; color: var(--muted); border-top: 1px solid var(--line); }
.link-btn { border: 0; background: none; padding: 0; color: var(--blue-ink); cursor: pointer; text-decoration: underline; font-size: inherit; }

/* Modal */
.modal { width: min(440px, calc(100% - 32px)); border: 0; border-radius: 24px; padding: 30px 28px 26px; color: var(--ink); box-shadow: 0 40px 100px -30px rgba(10, 20, 60, .55); }
.modal::backdrop { background: rgba(14, 18, 30, .45); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.modal-x { position: absolute; top: 14px; right: 14px; width: 32px; height: 32px; border: 0; border-radius: 50%; background: var(--bg-soft); color: var(--muted); font-size: 20px; line-height: 1; cursor: pointer; }
.modal-title { font-size: 36px; line-height: 1.02; padding-right: 30px; }
.modal-sub { margin: 10px 0 20px; color: var(--muted); font-size: 15px; }
.modal-fine { margin-top: 12px; font-size: 12.5px; color: var(--muted-2); text-align: center; }
.oauth svg { width: 18px; height: 18px; }
.or { display: flex; align-items: center; gap: 10px; margin: 14px 0; color: var(--muted-2); font-size: 12.5px; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.email-form { display: grid; gap: 8px; }
.email-form input { height: 44px; padding: 0 14px; border: 1px solid var(--line); border-radius: 12px; font: inherit; font-size: 15px; }
.email-form input:focus { outline: 2px solid var(--blue-a); outline-offset: -1px; }
.plan-pick { display: grid; gap: 8px; margin-bottom: 16px; }
.pick { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 14px; box-shadow: inset 0 0 0 1px var(--line); cursor: pointer; }
.pick:has(input:checked) { background: #f6f9ff; box-shadow: inset 0 0 0 2px var(--blue-a); }
.pick input { margin: 0; accent-color: var(--blue-a); }
.pick .grow { flex: 1; }
.pick b { font-weight: 500; }
.pick small { display: block; color: var(--muted); font-size: 12.5px; }
.pick .amt { font-weight: 600; font-size: 17px; white-space: nowrap; }
.pick .amt small { display: inline; font-weight: 400; }
.pick.pro { background: linear-gradient(90deg, rgba(42, 138, 240, .06), rgba(139, 92, 246, .07)); }
.mock-checkout { margin: 16px 0; padding: 14px; border-radius: 14px; box-shadow: inset 0 0 0 1px var(--line); font-size: 14px; }
.mc-row { display: flex; justify-content: space-between; gap: 12px; padding: 4px 0; }
.mc-row.muted { color: var(--muted); font-size: 13px; }
.mc-frame { margin-top: 10px; padding: 14px; border-radius: 10px; background: var(--bg-soft); color: var(--muted); font-size: 13px; }
.done-tick { width: 52px; height: 52px; margin-bottom: 16px; border-radius: 50%; display: grid; place-items: center; background: var(--ok); }
.done-tick svg { width: 26px; height: 26px; }
.snack { position: fixed; left: 50%; bottom: 24px; z-index: 100; max-width: calc(100% - 32px); padding: 10px 16px; border-radius: 12px; background: #15171d; color: #fff; font-size: 14px; box-shadow: 0 20px 40px -16px rgba(0, 0, 0, .5); opacity: 0; transform: translate(-50%, 16px); transition: opacity .25s ease, transform .25s ease; pointer-events: none; }
.snack.show { opacity: 1; transform: translate(-50%, 0); }

/* Tools: upscale picker, color options, recolor editor, sharing */
.scale-pick { margin-top: 22px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; font-size: 14px; color: var(--muted); }
.scale-pick[hidden] { display: none; }
.scale-pick .seg { background: #fff; box-shadow: inset 0 0 0 1px var(--line); }
.fine-inline { font-size: 12.5px; color: var(--muted-2); }
.seg-4 button { padding-inline: 4px; font-size: 13px; }
#styleSeg, #toolSeg { display: flex; width: 100%; }
#styleSeg button, #toolSeg button { flex: 1; }
.btn-icon { display: inline-flex; align-items: center; justify-content: center; gap: 8px; margin-top: 10px; }
.btn-icon svg { width: 16px; height: 16px; }
.enlarge-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 10px; font-size: 13.5px; color: var(--muted); }
.enlarge-row .seg button { padding: 5px 10px; }
.edit-canvas { display: block; width: 100%; max-height: 74vh; object-fit: contain; background: #14161c; cursor: crosshair; touch-action: none; }
.edit-canvas[hidden] { display: none; }
.swatches { display: grid; grid-template-columns: repeat(6, 1fr); gap: 7px; }
.swatch { aspect-ratio: 1; border: 0; border-radius: 9px; cursor: pointer; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .12); }
.swatch.on { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--blue-a); }
.custom-color { display: flex; align-items: center; justify-content: space-between; margin-top: 9px; font-size: 13px; color: var(--muted); }
.custom-color input { width: 44px; height: 28px; padding: 0; border: 0; background: none; cursor: pointer; }
.slider-row { display: grid; gap: 4px; margin-top: 12px; font-size: 13px; color: var(--muted); }
.slider-row[hidden] { display: none; }
.slider-row input { width: 100%; accent-color: var(--blue-a); }
.edit-actions { display: flex; gap: 8px; margin-top: 16px; }
.edit-actions .btn { flex: 1; }
.share-btns { display: grid; gap: 8px; }
.credit-back { display: block; margin-top: 8px; font-size: 12.5px; }
.credit-back[hidden] { display: none; }
.video-stage { position: relative; }
.video-tag { position: absolute; left: 14px; top: 14px; padding: 5px 10px; border-radius: 999px; background: rgba(15, 17, 24, .74); color: #fff; font-size: 12.5px; font-weight: 500; }
.video-tag[hidden] { display: none; }
.progress { margin-top: 12px; }
.progress[hidden] { display: none; }
.progress .bar { height: 6px; border-radius: 999px; background: var(--bg-soft); overflow: hidden; }
.progress .bar span { display: block; height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, var(--blue-a), #8b5cf6); transition: width .4s ease; }
.progress small { display: block; margin-top: 6px; font-size: 12.5px; color: var(--muted); }
.invite-box { display: flex; gap: 8px; }
.invite-box input { flex: 1; min-width: 0; height: 40px; padding: 0 12px; border: 1px solid var(--line); border-radius: 10px; font: inherit; font-size: 13.5px; }

/* Share page */
.share-main { flex: 1; padding: 40px 0 64px; display: grid; gap: 18px; justify-items: center; text-align: center; }
.share-ba { width: min(100%, 980px); aspect-ratio: var(--ar, 4 / 3); max-height: 76vh; border-radius: 20px; overflow: hidden; background: #14161c; box-shadow: 0 30px 60px -30px rgba(20, 40, 100, .45); }
.share-ba img { object-fit: contain; }
.share-ba #before { filter: grayscale(1); }
.share-note { font-size: 13.5px; color: var(--muted); }
.share-cta p { margin-top: 10px; font-size: 13px; color: var(--muted); }

@media (max-width: 860px) {
  .result, .quote { grid-template-columns: 1fr; }
  .result-side { position: static; }
}
@media (max-width: 760px) {
  .credit-pill { display: none; }
  .drop-inner { min-height: 280px; }
}
.note-form { display: flex; gap: 8px; margin-top: 10px; max-width: 420px; }
.note-form input { flex: 1; min-width: 0; height: 38px; padding: 0 12px; border: 1px solid rgba(0, 0, 0, .15); border-radius: 10px; font: inherit; font-size: 14px; }
