:root {
  --dr-primary: #d97706;
  --dr-primary-dark: #b45309;
  --dr-ink: #1c1917;
  --dr-bg: #f5f5f4;
}

body {
  background-color: var(--dr-bg);
  color: var(--dr-ink);
}

.navbar-brand { font-weight: 700; letter-spacing: -0.02em; }

.btn-primary { background-color: var(--dr-primary); border-color: var(--dr-primary); }
.btn-primary:hover, .btn-primary:focus { background-color: var(--dr-primary-dark); border-color: var(--dr-primary-dark); }
.btn-outline-primary { color: var(--dr-primary); border-color: var(--dr-primary); }
.btn-outline-primary:hover { background-color: var(--dr-primary); border-color: var(--dr-primary); }
.text-primary { color: var(--dr-primary) !important; }
.link-primary { color: var(--dr-primary) !important; }

.card {
  border: 1px solid rgba(28, 25, 23, 0.06);
  border-radius: 1rem;
  box-shadow: 0 1px 2px rgba(28, 25, 23, 0.04);
}

.auth-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(160deg, #1c1917 0%, #44403c 55%, #b45309 100%);
}

.auth-card { border: 0; box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25); }

.photo-thumb {
  aspect-ratio: 3 / 2;
  object-fit: cover;
  background: #e7e5e4;
  border-radius: 1rem 1rem 0 0;
}

/* Before/after: the edited image sits on top, clipped by the slider value. */
.compare { position: relative; overflow: hidden; border-radius: 1rem; background: #0c0a09; user-select: none; }
.compare img { display: block; width: 100%; height: auto; }
.compare .compare-after { position: absolute; inset: 0; clip-path: inset(0 0 0 var(--split, 50%)); }
.compare .compare-line { position: absolute; top: 0; bottom: 0; left: var(--split, 50%); width: 2px; background: #fff; pointer-events: none; }
.compare input[type=range] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: ew-resize; margin: 0; }
.compare-label { position: absolute; top: .75rem; padding: .15rem .5rem; border-radius: .5rem; background: rgba(0,0,0,.55); color: #fff; font-size: .75rem; pointer-events: none; }

/* Shoot cards: a pile of up to three photos, top photo straight, the ones beneath fanned out. */
.shoot-card { transition: transform .15s ease, box-shadow .15s ease; overflow: hidden; }
.shoot-card:hover { transform: translateY(-2px); box-shadow: 0 10px 28px rgba(28, 25, 23, 0.12); }
.shoot-pile { position: relative; aspect-ratio: 4 / 3; background: #ece9e6; }
.shoot-pile img {
  position: absolute; top: 50%; left: 50%;
  width: 62%; height: 70%; object-fit: cover;
  border: 4px solid #fff; border-radius: .4rem;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .22);
  transform: translate(-50%, -50%);
  transition: transform .2s ease;
}
.shoot-pile .pile-1 { transform: translate(-62%, -52%) rotate(-7deg); }
.shoot-pile .pile-2 { transform: translate(-38%, -49%) rotate(6deg); }
.shoot-card:hover .pile-1 { transform: translate(-68%, -52%) rotate(-10deg); }
.shoot-card:hover .pile-2 { transform: translate(-32%, -49%) rotate(9deg); }
.shoot-pile-empty { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }

/* Photo editor: fills the window; photo fits the stage; toolbar on the right with collapsible panels. */
.min-w-0 { min-width: 0; }
.editor { display: flex; gap: 1rem; min-height: 360px; }
.editor-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.editor-stage {
  position: relative; flex: 1 1 auto; min-height: 0;
  display: flex; align-items: center; justify-content: center;
  background: #0c0a09; border-radius: 1rem; overflow: hidden;
}
.editor-stage .compare { border-radius: 0; flex: 0 0 auto; }
.editor-stage .compare img { height: 100%; }
.editor-stage.is-full { display: block; overflow: auto; }
.editor-stage .full-size img { display: block; max-width: none; }
.stage-note { position: sticky; left: .75rem; bottom: .75rem; display: inline-block; margin: .75rem; padding: .15rem .5rem; border-radius: .5rem; background: rgba(0,0,0,.6); color: #fff; font-size: .75rem; }
.stage-fab { position: absolute; bottom: .75rem; z-index: 5; box-shadow: 0 4px 14px rgba(0,0,0,.3); }
.stage-fab-left { left: .75rem; }
.stage-fab-right { right: .75rem; }
.editor-panel .accordion-button:not(.collapsed) { color: var(--dr-ink); background-color: rgba(217, 119, 6, .08); box-shadow: none; }
.editor-panel .accordion-button:focus { box-shadow: none; }

@media (min-width: 992px) {
  .editor-panel { flex: 0 0 340px; width: 340px; height: 100%; }
  .editor-panel .offcanvas-body { display: block; height: 100%; overflow-y: auto; padding-right: .25rem; }
}

/* Phones and tablets: the toolbar flies in over the photo with a see-through background, so edits show live. */
@media (max-width: 991.98px) {
  .editor { gap: 0; }
  .editor-panel.offcanvas-lg { --bs-offcanvas-width: min(340px, 88vw); background: transparent; border-left: 0 !important; }
  .editor-panel .offcanvas-header { background: rgba(255, 255, 255, .94); }
  .editor-panel .card { background-color: rgba(255, 255, 255, .9); }
  .editor-panel .accordion,
  .editor-panel .accordion-item,
  .editor-panel .accordion-button { background-color: rgba(255, 255, 255, .55); }
  .editor-panel .form-text, .editor-panel #save-status { color: var(--dr-ink) !important; text-shadow: 0 0 4px #fff; }
  /* After only, with a Before/After toggle instead of the split slider. */
  .compare .compare-line, .compare input[type=range], .compare .compare-label { display: none; }
  .compare .compare-after { clip-path: none; }
  .compare.show-before .compare-after { visibility: hidden; }
}
.slider-row { display: grid; grid-template-columns: 6.5rem 1fr 2.6rem; align-items: center; gap: .5rem; min-height: 1.9rem; }
.slider-row .form-range { height: 1.2rem; }

/* Detected faces overlay in the editor ("Show" in the Face panel). */
.face-overlay { position: absolute; inset: 0; pointer-events: none; z-index: 3; }
.face-box { position: absolute; border: 2px solid #22c55e; border-radius: .35rem; box-shadow: 0 0 0 1px rgba(0,0,0,.35); }
.face-eye { position: absolute; width: 10px; height: 10px; margin: -5px 0 0 -5px; border-radius: 50%; background: #22c55e; box-shadow: 0 0 0 1px rgba(0,0,0,.45); }

/* Spinner on a photo while it is queued, edited, rendered or put in a download. */
.photo-frame { position: relative; }
.photo-frame .photo-thumb { display: block; background: #e7e5e4; }
.photo-busy {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .5rem;
  background: rgba(12, 10, 9, .5); color: #fff; font-size: .8rem; font-weight: 500;
  border-radius: 1rem 1rem 0 0; backdrop-filter: blur(1.5px); z-index: 1;
}
.photo-busy .spinner-border { width: 2rem; height: 2rem; border-width: .22rem; }

/* Editor top bar: shown while saving, the AI is editing the photo, or a render is running. */
.bg-activity { display: inline-flex; align-items: center; gap: .4rem; font-size: .8rem; font-weight: 500; color: var(--dr-primary-dark); white-space: nowrap; }

/* Edit history in the editor: tick or untick an edit to switch it on or off. */
.history-list { list-style: none; margin: 0; padding: 0; max-height: 14rem; overflow-y: auto; }
.history-item label { display: flex; align-items: center; gap: .5rem; padding: .3rem .25rem; font-size: .85rem; cursor: pointer; border-radius: .4rem; }
.history-item label:hover { background: rgba(0, 0, 0, .05); }
.history-item.is-off .history-label { text-decoration: line-through; opacity: .5; }

/* Sliders: a dot beside the name when it differs from the AI's suggestion; names and values reset on double-click. */
.slider-row label, .slider-row output { user-select: none; cursor: default; }
.slider-row.is-edited label::after { content: ''; display: inline-block; width: .4rem; height: .4rem; margin-left: .35rem; border-radius: 50%; background: var(--dr-primary); vertical-align: middle; }

/* User manual. */
.manual-section { scroll-margin-top: 5rem; margin-bottom: 3.25rem; }
.manual-section h3 { font-weight: 800; letter-spacing: -.02em; margin-bottom: .75rem; }
.manual-section h4 { font-size: 1.05rem; font-weight: 700; margin: 1.4rem 0 .5rem; }
.manual-toc { top: 5rem; }
.manual-toc .list-group-item { font-size: .9rem; border: 0; border-left: 3px solid transparent; border-radius: 0; background: transparent; }
.manual-toc .list-group-item.active { color: var(--dr-primary-dark); background: rgba(217, 119, 6, .08); border-left-color: var(--dr-primary); font-weight: 600; }
.manual-journey { padding-left: 1.2rem; }
.manual-journey li { padding: .15rem 0; }
.manual-callout { margin: 1.1rem 0; padding: .8rem 1rem; border-left: 4px solid var(--dr-primary); background: #fff7ed; border-radius: .5rem; font-size: .95rem; }
.manual-table th { font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: #78716c; }
.manual-figure { margin: 1.25rem 0; }
.manual-figure figcaption { margin-top: .5rem; font-size: .85rem; color: #78716c; }
.manual-figure img.screen { width: 100%; height: auto; border: 1px solid rgba(28, 25, 23, .12); border-radius: .75rem; box-shadow: 0 6px 22px rgba(28, 25, 23, .1); }
.manual-phones { display: flex; flex-wrap: wrap; gap: 1.25rem; align-items: flex-start; }
.manual-phones .manual-figure { flex: 0 1 220px; margin: 0; }
.manual-compare { position: relative; overflow: hidden; border-radius: .75rem; aspect-ratio: 3 / 2; background: #0c0a09; user-select: none; box-shadow: 0 6px 22px rgba(28, 25, 23, .12); }
.manual-compare img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.manual-compare img.after { clip-path: inset(0 0 0 var(--split, 50%)); }
.manual-compare .line { position: absolute; top: 0; bottom: 0; left: var(--split, 50%); width: 2px; background: #fff; pointer-events: none; }
.manual-compare .tag { position: absolute; top: .6rem; padding: .1rem .5rem; border-radius: .5rem; background: rgba(0, 0, 0, .55); color: #fff; font-size: .75rem; pointer-events: none; }
.manual-compare input[type=range] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: ew-resize; margin: 0; }
.manual-changelog li { margin-bottom: .4rem; }
