@import url('tokens.css');

/* === Intake-only overrides === */
:root {
  --error: #ff4444;
}

/* === Base === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background: var(--color-base);
  color: var(--color-warm-white);
  font-family: var(--font-body);
  min-height: 100vh;
  padding-bottom: 120px;
}

/* === Progress bar (fixed top) === */
.progress-bar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: var(--color-surface);
  z-index: 100;
}
.progress-fill {
  height: 100%;
  background: var(--color-volt);
  transition: width 0.3s ease;
}
.progress-label {
  position: fixed;
  top: 12px;
  right: 16px;
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 600;
  color: var(--color-mid-gray);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  z-index: 101;
}

/* === Step panels === */
.step-panel {
  padding: 72px 24px 24px;
  max-width: 560px;
  margin: 0 auto;
  min-height: 100vh;
  will-change: opacity, transform;
  animation: step-enter 0.4s ease both;
}

@keyframes step-enter {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.step-title {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  margin-bottom: 8px;
}

.step-subtitle {
  color: var(--color-mid-gray);
  font-size: 15px;
  margin-bottom: 32px;
  line-height: 1.5;
}

/* === Form fields === */
.field {
  margin-bottom: 24px;
}

.field label {
  display: block;
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-mid-gray);
  margin-bottom: 8px;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 44px;
  background: var(--color-surface);
  border: 1px solid rgba(255,255,255,0.08);
  color: var(--color-warm-white);
  font-family: var(--font-body);
  font-size: 16px;
  padding: 10px 14px;
  appearance: none;
  transition: border-color 0.15s;
}

.field select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none'%3E%3Cpath d='M1 1.5l5 5 5-5' stroke='%238A8A90' stroke-width='1.5' stroke-linecap='square'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}

.field input:focus-visible,
.field select:focus-visible,
.field textarea:focus-visible {
  outline: 2px solid var(--color-volt);
  outline-offset: 2px;
  border-color: var(--color-volt);
}

.field input.error,
.field select.error,
.field textarea.error {
  border-color: var(--error);
}

.field input.valid,
.field select.valid,
.field textarea.valid {
  border-color: rgba(200, 255, 0, 0.3);
}

.field .error-text {
  color: var(--error);
  font-size: 13px;
  margin-top: 4px;
}

.field .help-text {
  color: var(--color-mid-gray);
  font-size: 13px;
  margin-top: 4px;
  line-height: 1.4;
}

/* === File drop zone === */
.drop-zone {
  border: 1px solid var(--color-surface);
  background: var(--color-surface);
  padding: 32px 16px;
  text-align: center;
  cursor: pointer;
  transition: border-color var(--transition-fast), background var(--transition-fast);
}
.drop-zone::before {
  content: '↑';
  display: block;
  font-size: 24px;
  color: var(--color-mid-gray);
  margin-bottom: 8px;
  transition: color var(--transition-fast);
}
.drop-zone:hover,
.drop-zone.dragover {
  border-color: var(--color-volt);
}
.drop-zone:hover::before,
.drop-zone.dragover::before {
  color: var(--color-volt);
}
.drop-zone .drop-label { color: var(--color-mid-gray); font-size: 14px; }
.drop-zone .drop-label strong { color: var(--color-volt); }
.drop-zone .help-text {
  margin-top: 8px;
}

.file-list { margin-top: 12px; }
.file-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid var(--color-surface);
  font-size: 14px;
}
.file-item .remove-btn {
  margin-left: auto;
  color: var(--color-mid-gray);
  background: none;
  border: none;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  padding: 0 4px;
}

.upload-label {
  font-family: var(--font-display);
  font-size: 15px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-mid-gray);
  margin-bottom: 12px;
}
.upload-label .required-star {
  color: var(--color-volt);
}
.upload-label .optional-label {
  color: var(--color-mid-gray);
  font-weight: 400;
}
.file-list + .upload-label {
  margin-top: 24px;
}

.upload-progress {
  height: 3px;
  background: var(--color-surface);
  border-radius: 0;
  margin-top: 4px;
  overflow: hidden;
}
.upload-progress-fill {
  height: 100%;
  background: var(--color-volt);
  transition: width 0.2s;
}
.upload-progress-text {
  color: var(--color-mid-gray);
  font-size: 12px;
}

/* === Consent buttons === */
.consent-options {
  display: flex;
  gap: 12px;
  margin-top: 16px;
}
.consent-btn {
  flex: 1;
  min-height: 56px;
  border: 2px solid var(--color-surface);
  background: var(--color-surface);
  color: var(--color-warm-white);
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.consent-btn.selected {
  border-color: var(--color-volt);
  background: rgba(200, 255, 0, 0.08);
  color: var(--color-volt);
}

.consent-note {
  color: var(--color-mid-gray);
  font-size: 14px;
  margin-bottom: 24px;
  line-height: 1.6;
}

/* === Navigation (fixed bottom) === */
.step-nav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: var(--color-base);
  border-top: 1px solid var(--color-surface);
  padding: 16px 24px;
  display: flex;
  gap: 12px;
  max-width: 560px;
  margin: 0 auto;
}

.btn-back {
  flex: 0 0 80px;
  min-height: 52px;
  background: transparent;
  border: 1px solid var(--color-surface);
  color: var(--color-mid-gray);
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  cursor: pointer;
}

.btn-continue,
.btn-submit {
  flex: 1;
  min-height: 52px;
  background: var(--color-volt);
  border: none;
  color: var(--color-base);
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: opacity 0.15s;
}

.btn-continue:disabled,
.btn-submit:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  pointer-events: none;
}

.btn-submit:not(:disabled) {
  /* No box-shadow per design system — depth via color only */
}

/* === Strike ripple on primary buttons === */
.btn-continue,
.btn-submit {
  position: relative;
  overflow: hidden;
}
.btn-continue:active:not(:disabled),
.btn-submit:active:not(:disabled) {
  animation: btn-compress var(--btn-tap-duration) ease;
}
.btn-continue:active:not(:disabled)::after,
.btn-submit:active:not(:disabled)::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 40px;
  height: 40px;
  margin: -20px 0 0 -20px;
  border-radius: 50%;
  background: var(--btn-ripple-color);
  animation: strike-ripple var(--btn-tap-duration) ease forwards;
  pointer-events: none;
}

/* === Review step === */
.review-section {
  margin-bottom: 32px;
  background: var(--color-surface);
  padding: 20px;
}
.review-section h3 {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--color-volt);
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--color-volt);
}
.review-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  font-size: 15px;
}
.review-row:last-child {
  border-bottom: none;
}
.review-row .label {
  color: var(--color-mid-gray);
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.confirm-check {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-top: 24px;
  padding: 16px;
  border: 1px solid var(--color-surface);
}
.confirm-check input[type="checkbox"] {
  width: 20px;
  height: 20px;
  min-height: 20px;
  flex-shrink: 0;
  margin-top: 2px;
  accent-color: var(--color-volt);
}
.confirm-check label {
  font-size: 14px;
  color: var(--color-mid-gray);
  line-height: 1.5;
}

.btn-apply-code {
  min-width: 80px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 6px;
  color: var(--color-warm-white);
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.btn-apply-code:hover:not(:disabled) {
  border-color: var(--color-volt);
}
.btn-apply-code:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}
.code-success {
  color: var(--color-volt) !important;
  font-size: 13px;
  margin-top: 6px;
}
.code-error {
  color: var(--color-error) !important;
  font-size: 13px;
  margin-top: 6px;
}

/* === Status page === */
.status-page { padding: 32px 24px; max-width: 560px; margin: 0 auto; }
.status-state {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  margin-bottom: 8px;
}
.status-description { color: var(--color-mid-gray); font-size: 16px; margin-bottom: 32px; }

.state-pipeline {
  display: flex;
  gap: 0;
  margin-bottom: 32px;
  overflow-x: auto;
}
.pipeline-step {
  flex: 1;
  text-align: center;
  font-family: var(--font-display);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-mid-gray);
  padding: 8px 4px;
  border-bottom: 3px solid var(--color-surface);
  white-space: nowrap;
}
.pipeline-step.active { color: var(--color-volt); border-bottom-color: var(--color-volt); }
.pipeline-step.done { color: var(--color-warm-white); border-bottom-color: var(--color-warm-white); }

.flag-banner {
  background: rgba(255, 68, 68, 0.1);
  border: 1px solid var(--error);
  padding: 16px;
  margin-bottom: 24px;
}
.flag-banner h3 { color: var(--error); font-family: var(--font-display); text-transform: uppercase; margin-bottom: 8px; }

.history-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.history-table th {
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 11px;
  color: var(--color-mid-gray);
  text-align: left;
  padding: 6px 0;
  border-bottom: 1px solid var(--color-surface);
}
.history-table td { padding: 8px 0; border-bottom: 1px solid var(--color-surface); color: var(--color-mid-gray); }
.history-table td:first-child { color: var(--color-warm-white); }

/* === Brand mark === */
.intake-mark {
  position: fixed;
  bottom: 80px;
  left: 0;
  right: 0;
  text-align: center;
  padding: 8px 0;
  pointer-events: none;
  opacity: 0.3;
}
.intake-mark img {
  display: block;
  height: 14px;
  width: auto;
  margin: 0 auto;
  max-width: 80px;
}

/* === Submit error === */
.submit-error {
  position: fixed;
  bottom: 90px;
  left: 0;
  right: 0;
  text-align: center;
  color: var(--error);
  font-size: 14px;
  padding: 8px 24px;
}

/* === Review page === */
.review-eyebrow {
  font-family: var(--font-display);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-mid-gray);
  margin-bottom: 4px;
}

.review-actions {
  margin-top: 32px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.review-hold-btn {
  flex: none;
  width: 100%;
  min-height: 56px;
  text-align: center;
}

/* === Status page extras === */
.flag-link {
  color: var(--color-volt);
  font-size: 14px;
  margin-top: 12px;
  display: inline-block;
}

.history-heading {
  font-family: var(--font-display);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-mid-gray);
  margin-bottom: 12px;
}

/* === Focus states (design system) === */
button:focus-visible,
a:focus-visible,
input[type="checkbox"]:focus-visible {
  outline: 2px solid var(--color-volt);
  outline-offset: 2px;
}

/* --- Video Source Cards --- */
.video-source-buttons {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.btn-add-source {
  flex: 1;
  padding: 10px 16px;
  background: var(--color-surface, #1A1A1E);
  color: var(--color-warm-white, #F5F0E8);
  border: 1px dashed var(--color-mid-gray, #8A8A90);
  border-radius: 6px;
  font-family: var(--font-body, 'Barlow', sans-serif);
  font-size: 0.875rem;
  cursor: pointer;
}
.btn-add-source:hover {
  border-color: var(--color-volt, #C8FF00);
  color: var(--color-volt, #C8FF00);
}

.video-source-card {
  background: var(--color-surface, #1A1A1E);
  border: 1px solid rgba(138,138,144,0.2);
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 12px;
}

.video-source-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.video-source-type {
  font-family: var(--font-display, 'Barlow Condensed', sans-serif);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  color: var(--color-volt, #C8FF00);
}

/* --- Clip Ranges --- */
.clip-ranges {
  margin-top: 12px;
}

.clip-label {
  font-size: 0.8125rem;
  font-weight: 500;
  margin-bottom: 8px;
  color: var(--color-warm-white, #F5F0E8);
}

.clip-range-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
}

.clip-field {
  flex: 0 0 80px;
  margin-bottom: 0;
}

.clip-desc-field {
  flex: 1;
  margin-bottom: 0;
}

.clip-input {
  padding: 6px 8px;
  font-size: 0.875rem;
  width: 100%;
}

.clip-arrow {
  color: var(--color-mid-gray, #8A8A90);
  font-size: 0.875rem;
  flex-shrink: 0;
}

.btn-add-clip {
  background: none;
  border: none;
  color: var(--color-volt, #C8FF00);
  font-family: var(--font-body, 'Barlow', sans-serif);
  font-size: 0.8125rem;
  cursor: pointer;
  padding: 4px 0;
}
.btn-add-clip:hover {
  text-decoration: underline;
}

/* === Invite Code Gate === */
.code-gate {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.gate-inner {
  width: 100%;
}

.gate-inner .btn-continue {
  width: 100%;
  margin-top: 8px;
}

/* === Success Page Animation === */
.success-page {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  text-align: center;
}

.success-icon {
  width: 80px;
  height: 80px;
  margin-bottom: 32px;
}

.success-title {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  margin-bottom: 8px;
}

.success-subtitle {
  color: var(--color-mid-gray);
  font-size: 16px;
  margin-bottom: 32px;
  max-width: 400px;
}

/* Profile assembly animation */
.assembly-container {
  width: 100%;
  max-width: 320px;
  margin: 0 auto 32px;
}

.assembly-stage {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 0;
  opacity: 0.3;
  transition: opacity 0.5s ease;
}

.assembly-stage.active {
  opacity: 1;
}

.assembly-stage.done {
  opacity: 0.6;
}

.stage-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--color-surface);
  border: 2px solid var(--color-volt);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.stage-text {
  text-align: left;
}

.stage-label {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-volt);
}

.stage-desc {
  font-size: 13px;
  color: var(--color-mid-gray);
  margin-top: 2px;
}

.success-timeline {
  background: var(--color-surface);
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 24px;
  text-align: left;
}

.success-timeline h3 {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-volt);
  margin-bottom: 12px;
}

.success-timeline ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.success-timeline li {
  font-size: 14px;
  color: var(--color-mid-gray);
  padding: 6px 0;
  padding-left: 20px;
  position: relative;
}

.success-timeline li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--color-volt);
}

.success-cta {
  margin-top: 16px;
}

@media (prefers-reduced-motion: reduce) {
  .assembly-stage {
    transition: none;
  }
  .assembly-stage.active {
    opacity: 1;
  }
}

/* === Disabled Button Tooltips === */

.btn-tooltip-wrap {
  position: relative;
  display: inline-block;
}

.btn-tooltip-wrap--inline {
  display: inline-flex;
}

.btn-tooltip {
  position: absolute;
  bottom: calc(100% + var(--tooltip-arrow-size));
  left: 50%;
  transform: translateX(-50%);
  background: var(--tooltip-bg);
  color: var(--tooltip-color);
  font-size: var(--tooltip-font-size);
  padding: var(--tooltip-padding);
  border-radius: var(--tooltip-radius);
  max-width: var(--tooltip-max-width);
  width: max-content;
  text-align: center;
  z-index: var(--tooltip-z);
  pointer-events: none;
  line-height: 1.4;
  white-space: normal;
}

.btn-tooltip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: var(--tooltip-arrow-size) solid transparent;
  border-top-color: var(--tooltip-bg);
}

.tooltip-enter {
  opacity: 0;
  transform: translateX(-50%) translateY(4px);
}
.tooltip-enter-to {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.tooltip-leave {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.tooltip-leave-to {
  opacity: 0;
  transform: translateX(-50%) translateY(4px);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
