/* ISYM Media — Media Request App
   Design tokens preserved from brand reference. */

:root {
  --black: #0C0A08;
  --nearblack: #141210;
  --white: #F5F0E8;
  --parchment: #EDE5D4;
  --gold: #C4A44A;
  --gold-dim: #A88B38;
  --gold-light: #D4B86A;
  --midgray: #7A7570;
  --darkgray: #2A2620;
  --focus-ring: 0 0 0 3px rgba(196, 164, 74, 0.45);
}

* { box-sizing: border-box; }

html { background: #1b1a18; }

body {
  margin: 0;
  color: var(--black);
  font-family: "Inter", sans-serif;
  background:
    radial-gradient(circle at 20% 10%, rgba(196,164,74,.08), transparent 25%),
    #1b1a18;
}

a { color: inherit; }

/* ---------- App shell ---------- */
.app {
  width: min(100%, 430px);
  min-height: 100vh;
  margin: 0 auto;
  background: var(--parchment);
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.7' numOctaves='3' stitchTiles='stitchTiles'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.035'/%3E%3C/svg%3E"),
    linear-gradient(145deg, #f2eadb 0%, #ede5d4 55%, #e5dbca 100%);
}

.hero {
  background: var(--black);
  color: var(--white);
  padding: 28px 22px 24px;
  border-bottom: 1px solid rgba(196,164,74,.35);
}

.brandline {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 34px;
  font-family: "Space Grotesk", sans-serif;
  font-size: 10px; font-weight: 700; letter-spacing: .24em; text-transform: uppercase;
  color: var(--gold);
}
.brandline span:last-child { color: rgba(196,164,74,.45); letter-spacing: .15em; }

.eyebrow {
  display: flex; align-items: center; gap: 9px;
  font-family: "Space Grotesk", sans-serif;
  font-size: 10px; font-weight: 600; letter-spacing: .25em; text-transform: uppercase;
  color: var(--gold);
}
.eyebrow::before { content: ""; width: 22px; height: 1px; background: var(--gold); }

h1 {
  margin: 12px 0 8px;
  font-family: "DM Serif Display", serif;
  font-size: 42px; line-height: .94; font-weight: 400; letter-spacing: -.025em;
}
h1 em { color: var(--gold); font-style: italic; }

.hero p {
  max-width: 320px; margin: 0;
  color: rgba(245,240,232,.58);
  font-size: 12px; line-height: 1.65;
}

.form-wrap { padding: 20px 18px 130px; }

.section {
  margin-bottom: 18px;
  padding-bottom: 18px;
  border-bottom: 1px solid rgba(168,139,56,.22);
}
.section:last-of-type { border-bottom: 0; }

.section-kicker {
  font-family: "Space Grotesk", sans-serif;
  color: var(--gold-dim);
  font-size: 9px; font-weight: 700; letter-spacing: .23em; text-transform: uppercase;
  margin-bottom: 8px;
}
.section-title {
  font-family: "DM Serif Display", serif;
  font-size: 23px; line-height: 1.05; margin: 0 0 12px;
}
.section-title em { color: var(--gold-dim); font-style: italic; }

.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.full { grid-column: 1 / -1; }

label {
  display: block;
  font-family: "Space Grotesk", sans-serif;
  font-size: 9px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
  color: #5f584f; margin: 0 0 5px;
}

input, select, textarea {
  width: 100%;
  border: 1px solid rgba(42,38,32,.22);
  border-radius: 0;
  background: rgba(245,240,232,.72);
  color: var(--black);
  padding: 11px 10px;
  font: 400 16px/1.3 "Inter", sans-serif;
  outline: none;
  box-shadow: none;
  min-height: 44px;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--gold-dim);
  background: #f8f3ea;
  box-shadow: var(--focus-ring);
}
textarea { min-height: 82px; resize: vertical; }
textarea.compact { min-height: 62px; }

.field-error {
  display: none;
  margin-top: 5px;
  font: 600 10px/1.4 "Space Grotesk", sans-serif;
  letter-spacing: .04em;
  color: #9c3b2e;
}
.field-error.active { display: block; }
.has-error input, .has-error select, .has-error textarea {
  border-color: #9c3b2e;
}

.chips { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 8px; }
.chip { position: relative; }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip label {
  margin: 0;
  min-height: 44px;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid rgba(42,38,32,.22);
  background: rgba(245,240,232,.65);
  color: #4f4942;
  font-size: 10px;
  letter-spacing: .08em;
  text-align: center;
  padding: 8px;
  cursor: pointer;
}
.chip input:checked + label {
  color: var(--black);
  border-color: var(--gold-dim);
  background: rgba(196,164,74,.18);
  box-shadow: inset 0 0 0 1px rgba(196,164,74,.25);
}
.chip input:focus-visible + label { box-shadow: var(--focus-ring); }

/* ---------- Reference uploader ---------- */
.reference-uploader { margin-top: 12px; }
.reference-drop-list { display: flex; flex-direction: column; gap: 10px; }
.reference-drop {
  position: relative; min-height: 122px;
  border: 1px dashed rgba(168,139,56,.65);
  background: linear-gradient(135deg, rgba(196,164,74,.06), rgba(245,240,232,.55));
  display: flex; align-items: center; justify-content: center;
  overflow: hidden; cursor: pointer;
}
.reference-drop.dragover { border-color: var(--gold); background: rgba(196,164,74,.14); }
.reference-drop.has-image {
  min-height: 180px; border-style: solid; background: var(--nearblack); touch-action: none;
}
.reference-drop input[type=file] {
  position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; z-index: 3;
}
.reference-placeholder { text-align: center; padding: 18px; pointer-events: none; }
.reference-plus {
  display: block; width: 34px; height: 34px; margin: 0 auto 10px;
  border: 1px solid rgba(168,139,56,.6); border-radius: 50%;
  font: 400 25px/30px "DM Serif Display", serif; color: var(--gold-dim);
}
.reference-primary {
  display: block; font: 600 10px/1.35 "Space Grotesk", sans-serif;
  letter-spacing: .14em; text-transform: uppercase; color: #4f4942;
}
.reference-secondary { display: block; margin-top: 5px; font: 400 11px/1.45 "Inter", sans-serif; color: #7a7168; }
.reference-preview {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: contain; transform-origin: center center; will-change: transform;
  user-select: none; -webkit-user-drag: none;
}
.reference-uploading { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(12,10,8,.55); color: var(--gold); font: 600 10px "Space Grotesk", sans-serif; letter-spacing: .12em; text-transform: uppercase; z-index: 4; }
.reference-overlay {
  position: absolute; inset: auto 0 0; z-index: 4;
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
  padding: 9px 10px; color: var(--white);
  background: linear-gradient(to top, rgba(12,10,8,.94), rgba(12,10,8,.2));
}
.reference-name {
  min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font: 600 9px/1.2 "Space Grotesk", sans-serif; letter-spacing: .08em; text-transform: uppercase;
}
.reference-actions { display: flex; gap: 6px; flex-shrink: 0; }
.reference-adjust, .reference-remove {
  position: relative; z-index: 5; min-height: 32px; min-width: 44px; padding: 0 9px;
  border: 1px solid rgba(196,164,74,.5); background: rgba(12,10,8,.72);
  color: var(--gold); font-size: 8px; cursor: pointer;
  font-family: "Space Grotesk", sans-serif; letter-spacing: .1em; text-transform: uppercase;
}
.reference-help { margin-top: 7px; font: 400 10px/1.5 "Inter", sans-serif; color: #746c64; }

/* ---------- Full-screen image editor ---------- */
.image-editor {
  display: none;
  position: fixed; inset: 0; z-index: 100;
  background: rgba(12,10,8,.98);
  color: var(--white);
  padding: calc(16px + env(safe-area-inset-top)) 14px calc(16px + env(safe-area-inset-bottom));
}
.image-editor.active { display: flex; flex-direction: column; }
.image-editor-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.image-editor-title { font: 600 10px "Space Grotesk", sans-serif; letter-spacing: .18em; text-transform: uppercase; color: var(--gold); }
.image-editor-close { background: transparent; color: var(--gold); border: 1px solid rgba(196,164,74,.45); min-height: 44px; min-width: 44px; }

.image-editor-instructions {
  margin: 0 0 12px;
  padding: 16px 15px;
  border: 1px solid rgba(196,164,74,.35);
  background: rgba(196,164,74,.08);
  text-align: center;
}
.image-editor-instructions .icon-row {
  display: flex; justify-content: center; gap: 22px; margin-bottom: 6px;
}
.image-editor-instructions .icon-row span { font-size: 26px; line-height: 1; }
.image-editor-instructions strong {
  display: block; font: 400 26px/1.05 "DM Serif Display", serif; color: var(--white);
}
.image-editor-instructions strong em { color: var(--gold); font-style: italic; }
.image-editor-instructions .desktop-hint,
.image-editor-instructions .touch-hint {
  display: block; margin-top: 7px;
  font: 600 11px/1.5 "Space Grotesk", sans-serif;
  letter-spacing: .1em; text-transform: uppercase;
  color: rgba(245,240,232,.65);
}
body.is-touch .image-editor-instructions .desktop-hint { display: none; }
body:not(.is-touch) .image-editor-instructions .touch-hint { display: none; }

.image-editor-stage {
  position: relative; flex: 1; min-height: 260px; overflow: hidden;
  background: #050403; border: 1px solid rgba(196,164,74,.3);
  touch-action: none; cursor: grab;
}
.image-editor-stage.is-dragging { cursor: grabbing; }
.image-editor-stage img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: contain; transform-origin: center center;
  user-select: none; -webkit-user-drag: none; will-change: transform;
}

.image-editor-controls { padding-top: 14px; }
.image-editor-zoom-label { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.image-editor-zoom-label span:first-child {
  font: 700 12px "Space Grotesk", sans-serif; letter-spacing: .15em; text-transform: uppercase; color: var(--gold);
}
.image-editor-zoom-label span:last-child { font: 600 12px "Space Grotesk", sans-serif; color: rgba(245,240,232,.65); }

.image-editor-range { width: 100%; height: 44px; padding: 0; background: transparent; accent-color: var(--gold); }
.image-editor-range::-webkit-slider-runnable-track {
  height: 12px; border-radius: 999px;
  background: linear-gradient(to right, var(--gold), rgba(196,164,74,.25));
}
.image-editor-range::-webkit-slider-thumb {
  -webkit-appearance: none; width: 34px; height: 34px; margin-top: -11px;
  border-radius: 50%; border: 3px solid var(--black); background: var(--gold);
  box-shadow: 0 0 0 2px rgba(196,164,74,.4);
}
.image-editor-range::-moz-range-track {
  height: 12px; border-radius: 999px;
  background: linear-gradient(to right, var(--gold), rgba(196,164,74,.25));
}
.image-editor-range::-moz-range-thumb {
  width: 34px; height: 34px; border-radius: 50%;
  border: 3px solid var(--black); background: var(--gold);
  box-shadow: 0 0 0 2px rgba(196,164,74,.4);
}

.image-editor-buttons { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; margin-top: 12px; }
.image-editor-hint { margin-top: 8px; font: 400 11px/1.5 "Inter", sans-serif; color: rgba(245,240,232,.45); text-align: center; }

/* ---------- Notes / actions ---------- */
.note {
  margin-top: 10px; padding: 10px 11px;
  border-left: 2px solid var(--gold-dim);
  background: rgba(168,139,56,.07);
  font: italic 12px/1.55 "DM Serif Display", serif;
  color: #4c463f;
}

.actions {
  position: fixed; left: 50%; bottom: 0; transform: translateX(-50%);
  width: min(100%, 430px);
  padding: 12px 14px calc(12px + env(safe-area-inset-bottom));
  background: linear-gradient(to top, var(--black) 75%, rgba(12,10,8,.96));
  border-top: 1px solid rgba(196,164,74,.24);
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
  z-index: 20;
}
button {
  border: 0;
  font-family: "Space Grotesk", sans-serif;
  text-transform: uppercase; letter-spacing: .15em;
  font-size: 10px; font-weight: 700;
  min-height: 44px; padding: 0 14px;
  cursor: pointer;
}
button:disabled { opacity: .55; cursor: not-allowed; }
button:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.primary { background: var(--gold); color: var(--black); }
.secondary { background: transparent; color: var(--gold); border: 1px solid rgba(196,164,74,.45); }

.micro {
  margin-top: 12px;
  font-family: "Space Grotesk", sans-serif;
  font-size: 8px; line-height: 1.5; letter-spacing: .12em; text-transform: uppercase;
  color: rgba(42,38,32,.48);
}

.send-status {
  grid-column: 1 / -1;
  margin-top: 10px; min-height: 18px;
  font: 500 10px/1.5 "Space Grotesk", sans-serif;
  letter-spacing: .08em; text-transform: uppercase;
  color: var(--gold-dim);
}
.send-status[data-state="error"] { color: #c15c4a; }
.send-status[data-state="success"] { color: var(--gold); }

/* ---------- Confirmation ---------- */
.confirmation-page {
  display: none;
  width: min(100%, 430px); min-height: 100vh; margin: 0 auto;
  padding: 28px 22px calc(28px + env(safe-area-inset-bottom));
  background: var(--black); color: var(--white); text-align: left;
}
.confirmation-page.active { display: flex; flex-direction: column; justify-content: space-between; }
.confirmation-mark { color: var(--gold); font: 400 64px/1 "DM Serif Display", serif; }
.confirmation-page h2 { margin: 18px 0 10px; font: 400 42px/.95 "DM Serif Display", serif; }
.confirmation-page h2 em { color: var(--gold); font-style: italic; }
.confirmation-page p { color: rgba(245,240,232,.62); font: 400 14px/1.7 "Inter", sans-serif; }
.confirmation-summary {
  margin-top: 24px; padding: 16px 0;
  border-top: 1px solid rgba(196,164,74,.25); border-bottom: 1px solid rgba(196,164,74,.25);
  font: 600 10px/1.8 "Space Grotesk", sans-serif; letter-spacing: .12em; text-transform: uppercase;
  color: rgba(196,164,74,.7);
}
.confirmation-back { width: 100%; margin-top: 28px; min-height: 48px; background: var(--gold); color: var(--black); }

/* ---------- Accessibility helpers ---------- */
.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

@media (min-width: 720px) {
  body { padding: 24px 0; }
  .app { min-height: auto; box-shadow: 0 30px 80px rgba(0,0,0,.5); }
}
