@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@300;400;500;600;700;800;900&display=swap');

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

:root {
  --black: #000000;
  --white: #ffffff;
  --accent: #00ccff;
  --accent-dark: #00a3cc;
  --grey-50: #f9fafb;
  --grey-100: #f3f4f6;
  --grey-200: #e5e7eb;
  --grey-300: #d1d5db;
  --grey-400: #9ca3af;
  --grey-500: #6b7280;
  --grey-600: #4b5563;
  --grey-700: #374151;
  --grey-800: #1f2937;
  --grey-900: #111827;
  --green: #22c55e;
  --yellow: #eab308;
  --orange: #f97316;
  --red: #ef4444;
  --amber: #f59e0b;
}

body {
  font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--white);
  color: var(--grey-900);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ---- Lock Overlay ---- */
.lock-overlay {
  position: relative;
  z-index: 10;
  background: rgba(255, 255, 255, 0.92);
  margin: 0 auto;
  max-width: 720px;
  padding: 48px 24px;
  text-align: center;
  pointer-events: auto;
}

.lock-overlay ~ .main-content {
  pointer-events: none;
  opacity: 0.4;
  user-select: none;
}

.lock-overlay.unlocked {
  display: none;
}

.lock-overlay.unlocked ~ .main-content {
  pointer-events: auto;
  opacity: 1;
  user-select: auto;
}

.lock-icon {
  font-size: 40px;
  margin-bottom: 12px;
}

.lock-overlay h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--grey-600);
  line-height: 1.5;
}

/* ---- Assessment Tool Container ---- */
.assessment-tool {
  display: none;
  min-height: 100vh;
  background: var(--grey-50);
}

/* ---- Header ---- */
.app-header {
  background: var(--black);
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.app-header .logo {
  height: 36px;
}

.logo-text {
  color: var(--white);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.5px;
}

/* ---- Progress Bar ---- */
.progress-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  padding: 24px 24px 8px;
  max-width: 500px;
  margin: 0 auto;
}

.progress-step {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--grey-400);
  white-space: nowrap;
}

.progress-step.completed {
  color: var(--accent);
}

.progress-step.active {
  color: var(--grey-900);
  font-weight: 600;
}

.progress-step .step-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
  border: 2px solid var(--grey-300);
  background: var(--white);
}

.progress-step.completed .step-num {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--black);
}

.progress-step.active .step-num {
  border-color: var(--grey-900);
  color: var(--grey-900);
}

.progress-line {
  width: 40px;
  height: 2px;
  background: var(--grey-300);
  margin: 0 8px;
  flex-shrink: 0;
}

.progress-line.completed {
  background: var(--accent);
}

/* ---- Main Content ---- */
.main-content {
  max-width: 720px;
  margin: 0 auto;
  padding: 24px;
}

.section-title {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 8px;
  text-align: center;
}

.section-subtitle {
  font-size: 14px;
  color: var(--grey-500);
  text-align: center;
  margin-bottom: 24px;
}

/* ---- Upload Zones ---- */
.upload-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 24px;
}

@media (max-width: 540px) {
  .upload-grid {
    grid-template-columns: 1fr;
  }
}

.upload-zone {
  border: 2px dashed var(--accent);
  border-radius: 12px;
  padding: 16px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  background: var(--white);
  position: relative;
  overflow: hidden;
}

.upload-zone:hover,
.upload-zone.drag-over {
  border-color: var(--accent);
  background: rgba(0, 204, 255, 0.04);
}

.upload-zone.has-file {
  border-style: solid;
  border-color: var(--accent);
  padding: 12px;
}

.upload-zone input[type="file"] {
  display: none;
}

.upload-preview {
  position: relative;
  display: none;
}

.upload-preview img,
.upload-preview video {
  width: 100%;
  height: 100%;
  border-radius: 8px;
  object-fit: cover;
}

.placeholder-zone .upload-preview {
  position: absolute;
  inset: 8px;
}

.placeholder-zone.has-file .upload-preview {
  display: block;
}

.upload-preview .remove-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.7);
  color: var(--white);
  border: none;
  cursor: pointer;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.upload-preview .remove-btn:hover {
  background: var(--red);
}

/* Video upload zone */
.video-upload-zone {
  border: 2px dashed var(--grey-300);
  border-radius: 12px;
  padding: 48px 24px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  background: var(--white);
  margin-bottom: 24px;
}

.video-upload-zone:hover,
.video-upload-zone.drag-over {
  border-color: var(--accent);
  background: rgba(0, 204, 255, 0.04);
}

.video-upload-zone.has-file {
  border-style: solid;
  border-color: var(--accent);
  padding: 12px;
}

.video-upload-zone .icon {
  font-size: 42px;
  margin-bottom: 8px;
}

.video-upload-zone .label {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 4px;
}

.video-upload-zone .hint {
  font-size: 12px;
  color: var(--grey-400);
}

.video-upload-zone input[type="file"] {
  display: none;
}

.video-upload-zone video {
  width: 100%;
  border-radius: 8px;
  max-height: 300px;
}

/* Upload zone with placeholder images */
.upload-zone-wrap {
  text-align: center;
}

.upload-label {
  font-size: 15px;
  font-weight: 600;
  margin-top: 10px;
  color: var(--grey-900);
}

.upload-hint {
  font-size: 12px;
  color: var(--grey-400);
  margin-top: 4px;
  line-height: 1.4;
}

.placeholder-zone {
  aspect-ratio: 4 / 3;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.upload-placeholder-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* Gait tips row */
.gait-tips-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  align-items: center;
  margin-bottom: 20px;
}

@media (max-width: 600px) {
  .gait-tips-row {
    grid-template-columns: 1fr;
  }
  .gait-tips-row .gait-example {
    order: -1;
  }
}

.gait-tips-row .instructions-card {
  margin-bottom: 0;
}

.gait-example {
  text-align: center;
}

.gait-example img {
  width: 100%;
  border-radius: 12px;
}

/* Instructions card */
.instructions-card {
  background: var(--white);
  border-left: 4px solid var(--accent);
  border-radius: 8px;
  padding: 20px 24px;
  margin-bottom: 24px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.instructions-card h3 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 12px;
}

.instructions-card ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.instructions-card li {
  font-size: 14px;
  color: var(--grey-700);
  padding-left: 4px;
}

/* ---- Buttons ---- */
.btn-primary {
  display: block;
  width: 100%;
  padding: 16px 24px;
  background: var(--accent);
  color: var(--black);
  border: none;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 700;
  font-family: 'Montserrat', sans-serif;
  cursor: pointer;
  transition: background 0.2s, opacity 0.2s;
}

.btn-primary:hover {
  background: var(--accent-dark);
}

.btn-primary:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.btn-secondary {
  display: inline-block;
  padding: 12px 24px;
  background: var(--grey-100);
  color: var(--grey-900);
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  font-family: 'Montserrat', sans-serif;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-secondary:hover {
  background: var(--grey-200);
}

/* ---- Loading Overlay ---- */
.loading-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.92);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 24px;
}

.loading-overlay.active {
  display: flex;
}

.loading-overlay .logo {
  max-width: 160px;
}

.loading-bar-track {
  width: 240px;
  height: 4px;
  background: var(--grey-800);
  border-radius: 2px;
  overflow: hidden;
}

.loading-bar {
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
  animation: loadingProgress 12s ease-in-out forwards;
}

@keyframes loadingProgress {
  0% { width: 0%; }
  20% { width: 25%; }
  50% { width: 55%; }
  80% { width: 80%; }
  100% { width: 95%; }
}

.loading-message {
  color: var(--grey-400);
  font-size: 14px;
  min-height: 20px;
  transition: opacity 0.3s;
}

/* ---- Error State ---- */
.error-state {
  display: none;
  text-align: center;
  padding: 48px 24px;
}

.error-state .error-icon {
  font-size: 48px;
  margin-bottom: 16px;
}

.error-state h2 {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 8px;
}

.error-state p {
  color: var(--grey-500);
  font-size: 14px;
  margin-bottom: 24px;
  max-width: 400px;
  margin-left: auto;
  margin-right: auto;
}

/* ---- Results ---- */
.results-section {
  display: none;
}

.arch-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 50px;
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 24px;
}

.arch-badge.flat {
  background: #fef3c7;
  color: #92400e;
}

.arch-badge.normal {
  background: #d1fae5;
  color: #065f46;
}

.arch-badge.high {
  background: #dbeafe;
  color: #1e40af;
}

.confidence-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 50px;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 24px;
  cursor: help;
}

.confidence-badge.high {
  background: #d1fae5;
  color: #065f46;
}

.confidence-badge.medium {
  background: #fef3c7;
  color: #92400e;
}

.confidence-badge.low {
  background: #fee2e2;
  color: #991b1b;
}

/* Finding / Assessment Cards */
.card {
  background: var(--white);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  border: 1px solid var(--grey-200);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.card-header h3 {
  font-size: 16px;
  font-weight: 600;
}

.severity-badge,
.rating-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 50px;
  font-size: 12px;
  font-weight: 600;
  text-transform: capitalize;
}

.severity-normal,
.rating-normal {
  background: #d1fae5;
  color: #065f46;
}

.severity-mild,
.rating-mild {
  background: #fef3c7;
  color: #92400e;
}

.severity-moderate,
.rating-moderate {
  background: #ffedd5;
  color: #9a3412;
}

.severity-significant,
.rating-significant {
  background: #fee2e2;
  color: #991b1b;
}

.card p {
  font-size: 14px;
  color: var(--grey-600);
  line-height: 1.6;
}

.orthotic-benefit {
  font-size: 13px;
  color: var(--accent-dark);
  font-style: italic;
  margin-top: 8px;
}

/* Assessment Grid */
.assessment-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 24px;
}

@media (max-width: 540px) {
  .assessment-grid {
    grid-template-columns: 1fr;
  }
}

.assessment-card {
  background: var(--white);
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  border: 1px solid var(--grey-200);
}

.assessment-card .card-icon {
  font-size: 24px;
  margin-bottom: 6px;
}

.assessment-card h4 {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 6px;
}

.assessment-card p {
  font-size: 13px;
  color: var(--grey-600);
  line-height: 1.5;
}

/* Key Findings */
.key-findings {
  margin-bottom: 24px;
}

.key-findings h3 {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 12px;
}

.finding-item {
  border-left: 3px solid var(--accent);
  padding: 12px 16px;
  margin-bottom: 8px;
  background: var(--white);
  border-radius: 0 8px 8px 0;
  font-size: 14px;
  color: var(--grey-700);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

/* Orthotics Help Section */
.orthotics-help {
  background: var(--white);
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 24px;
  border: 1px solid var(--grey-200);
}

.orthotics-help h3 {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 12px;
}

.orthotics-help p {
  font-size: 14px;
  color: var(--grey-600);
  margin-bottom: 12px;
}

.feature-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.feature-pill {
  display: inline-block;
  padding: 6px 14px;
  border: 1.5px solid var(--accent);
  color: var(--accent-dark);
  border-radius: 50px;
  font-size: 13px;
  font-weight: 500;
}

/* Urgency Badge */
.urgency-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 50px;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 12px;
}

.urgency-preventive {
  background: #d1fae5;
  color: #065f46;
}

.urgency-beneficial {
  background: #fef3c7;
  color: #92400e;
}

.urgency-strongly-recommended {
  background: #fee2e2;
  color: #991b1b;
}

/* Summary */
.summary-box {
  background: var(--white);
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 24px;
  border: 1px solid var(--grey-200);
}

.summary-box h3 {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 8px;
}

.summary-box p {
  font-size: 14px;
  color: var(--grey-600);
  line-height: 1.7;
}

/* Red Flags */
.red-flags {
  background: #fffbeb;
  border: 1px solid #fcd34d;
  border-radius: 12px;
  padding: 20px 24px;
  margin-bottom: 24px;
}

.red-flags h3 {
  font-size: 16px;
  font-weight: 700;
  color: #92400e;
  margin-bottom: 12px;
}

.red-flags ul {
  list-style: none;
}

.red-flags li {
  font-size: 14px;
  color: #78350f;
  padding: 4px 0;
  padding-left: 4px;
}

/* ---- Next Steps ---- */
.next-steps {
  margin-top: 32px;
  margin-bottom: 24px;
}

.next-steps h3 {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 16px;
  text-align: center;
}

.next-steps-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

@media (max-width: 540px) {
  .next-steps-grid {
    grid-template-columns: 1fr;
  }
}

.next-step-card {
  border-radius: 12px;
  padding: 24px;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: transform 0.2s, box-shadow 0.2s;
}

.next-step-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.next-step-card h4 {
  font-size: 16px;
  font-weight: 700;
}

.next-step-card p {
  font-size: 14px;
  line-height: 1.5;
}

.next-step-card.shop {
  background: var(--accent);
  color: var(--black);
}

.next-step-card.shop .btn-card {
  display: inline-block;
  background: var(--black);
  color: var(--white);
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 700;
  text-align: center;
}

.next-step-card.app {
  background: var(--black);
  color: var(--white);
}

.next-step-img {
  width: 100%;
  height: auto;
  border-radius: 8px;
  object-fit: contain;
}

.app-store-btn {
  height: 40px;
  width: auto;
  object-fit: contain;
  align-self: flex-start;
}

/* Uploaded media in results */
.results-uploaded-media {
  margin-bottom: 24px;
}

.results-uploaded-media .uploaded-images {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.results-uploaded-media img {
  width: 100%;
  border-radius: 10px;
  object-fit: cover;
  max-height: 220px;
}

.results-uploaded-media video {
  width: 100%;
  border-radius: 10px;
  max-height: 300px;
}

/* ---- Disclaimer ---- */
.disclaimer {
  font-size: 12px;
  color: var(--grey-400);
  text-align: center;
  padding: 16px 24px 16px;
  line-height: 1.6;
}

.footer-logo {
  text-align: center;
  padding: 8px 24px 32px;
}

.footer-logo img {
  max-width: 320px;
  width: 100%;
  height: auto;
}

.upload-footer-logo {
  text-align: center;
  padding: 32px 24px 8px;
}

.upload-footer-logo img {
  max-width: 320px;
  width: 100%;
  height: auto;
}

.next-step-img-flip {
  transform: scaleX(-1);
}

/* ---- Footer ---- */
.app-footer {
  text-align: center;
  padding: 20px;
  border-top: 1px solid var(--grey-200);
  background: var(--white);
}

.ai-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 600;
  color: var(--grey-600);
  padding: 8px 18px;
  border: 1.5px solid var(--grey-300);
  border-radius: 50px;
}

.ai-badge .dot {
  width: 8px;
  height: 8px;
  background: var(--accent);
  border-radius: 50%;
}
