/* Field Ready Hub — Case IH Dark Theme */
:root {
  --case-ih-red: #c8102e;
  --case-ih-red-dark: #a60d25;
  --case-ih-red-light: #d83050;
  --bg-dark: #0a0a0a;
  --bg-card: #1a1a1a;
  --bg-input: #252525;
  --bg-surface: #111111;
  --text-primary: #ffffff;
  --text-secondary: #cccccc;
  --text-muted: #999999;
  --border-color: #333333;
  --success: #22c55e;
  --warning: #f59e0b;
  --danger: #ef4444;
  --accent-gold: #c6a24c;
  --touch-min: 48px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

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

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg-dark);
  color: var(--text-primary);
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ===== SCREENS ===== */
.screen { display: none; flex-direction: column; min-height: 100vh; min-height: 100dvh; }
.screen.active { display: flex; }

/* ===== HEADER ===== */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg-surface);
  padding: 10px 16px;
  padding-top: calc(10px + var(--safe-top));
  display: flex;
  align-items: center;
  justify-content: center;
  border-bottom: 3px solid var(--case-ih-red);
}

.header-badge {
  height: 56px;
  width: auto;
}

/* ===== HERO SECTION (matches Baker main site) ===== */
.hero-section {
  position: relative;
  min-height: 70vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, #111111 0%, #1b1b1b 50%, #0a0a0a 100%);
  z-index: 0;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(17,17,17,0.6) 0%, rgba(17,17,17,0.4) 50%, rgba(17,17,17,0.9) 100%);
  z-index: 1;
}

.hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 48px 24px;
  max-width: 600px;
}

.hero-badge {
  width: 300px;
  max-width: 80%;
  height: auto;
  margin-bottom: 24px;
}

.hero-subtitle {
  font-size: clamp(1rem, 2.5vw, 1.25rem);
  color: #c0c0c0;
  font-weight: 500;
  margin-bottom: 16px;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.hero-desc {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 32px;
}

.hero-ctas {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
}

.baker-btn {
  display: inline-block;
  background: var(--case-ih-red);
  color: #ffffff;
  padding: 14px 28px;
  border: none;
  border-radius: 6px;
  font-family: 'Inter', sans-serif;
  font-weight: 700;
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  cursor: pointer;
  transition: all 0.2s ease;
  min-height: var(--touch-min);
  text-decoration: none;
  text-align: center;
}

.baker-btn:hover {
  background: var(--case-ih-red-dark);
  box-shadow: 0 4px 16px rgba(200, 16, 46, 0.4);
  transform: translateY(-1px);
}

.landing-hero p {
  color: var(--text-secondary);
  font-size: 15px;
  line-height: 1.6;
  max-width: 500px;
  margin: 0 auto 32px;
}

.landing-features {
  padding: 0 16px 32px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 500px;
  margin: 0 auto;
}

.feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 20px;
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.feature-icon {
  font-size: 28px;
  flex-shrink: 0;
  width: 48px;
  text-align: center;
}

.feature-card h3 {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 4px;
}

.feature-card p {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.4;
}

.cta-section {
  padding: 24px 16px 48px;
  text-align: center;
}

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: var(--touch-min);
  padding: 12px 24px;
  border: none;
  border-radius: 8px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  text-decoration: none;
}

.btn:active { transform: scale(0.98); }

.btn-primary {
  background: var(--case-ih-red);
  color: white;
  width: 100%;
  max-width: 400px;
}
.btn-primary:hover { background: var(--case-ih-red-light); }

.btn-secondary {
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  width: 100%;
  max-width: 400px;
}

.btn-call {
  background: var(--success);
  color: white;
  width: 100%;
}

.btn-service {
  background: var(--warning);
  color: #111;
  width: 100%;
}

/* ===== EQUIPMENT SCREEN ===== */
.equip-header {
  background: var(--bg-surface);
  padding: 24px 16px;
  border-bottom: 1px solid var(--border-color);
}

.equip-model {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.equip-details {
  font-size: 13px;
  color: var(--text-muted);
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.equip-details span::after {
  content: '\00b7';
  margin-left: 8px;
  color: var(--border-color);
}
.equip-details span:last-child::after { content: ''; }

.equip-store {
  font-size: 13px;
  color: var(--case-ih-red);
  margin-top: 8px;
  font-weight: 500;
}

/* ===== VIDEO SECTIONS ===== */
.video-sections {
  padding: 16px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.video-section {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  overflow: hidden;
}

.section-header {
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.section-header h3 {
  font-size: 14px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-badge {
  background: var(--case-ih-red);
  color: white;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 10px;
}

.section-chevron {
  font-size: 12px;
  color: var(--text-muted);
  transition: transform 0.2s;
}

.video-section.open .section-chevron { transform: rotate(180deg); }

.section-videos {
  display: none;
  border-top: 1px solid var(--border-color);
}

.video-section.open .section-videos { display: block; }

.video-item {
  display: flex;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color);
  cursor: pointer;
  transition: background 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.video-item:last-child { border-bottom: none; }
.video-item:active { background: var(--bg-input); }

.video-thumb {
  width: 120px;
  height: 68px;
  border-radius: 6px;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--bg-input);
}

.video-info {
  flex: 1;
  min-width: 0;
}

.video-title {
  font-size: 13px;
  font-weight: 500;
  line-height: 1.3;
  margin-bottom: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.video-meta {
  font-size: 11px;
  color: var(--text-muted);
}

/* ===== VIDEO PLAYER OVERLAY ===== */
.video-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.95);
  z-index: 200;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.video-overlay.active { display: flex; }

.video-overlay-close {
  position: absolute;
  top: 16px;
  right: 16px;
  top: calc(16px + var(--safe-top));
  width: 44px;
  height: 44px;
  background: var(--bg-card);
  border: none;
  border-radius: 50%;
  color: white;
  font-size: 20px;
  cursor: pointer;
  z-index: 201;
}

.video-player-wrap {
  width: 100%;
  max-width: 800px;
  aspect-ratio: 16/9;
  background: black;
  border-radius: 8px;
  overflow: hidden;
}

.video-player-wrap iframe {
  width: 100%;
  height: 100%;
  border: none;
}

.video-player-title {
  color: var(--text-primary);
  font-size: 15px;
  font-weight: 500;
  margin-top: 16px;
  text-align: center;
  max-width: 800px;
}

/* ===== CATEGORY FALLBACK BANNER ===== */
.category-fallback-banner {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-left: 3px solid var(--accent-gold);
  border-radius: 8px;
  padding: 14px 16px;
  margin-bottom: 4px;
}

.category-fallback-banner p {
  font-size: 14px;
  font-weight: 600;
  color: var(--accent-gold);
}

.category-fallback-banner span {
  font-size: 12px;
  color: var(--text-muted);
}

/* ===== REQUEST VIDEO SECTION ===== */
.request-video-section,
.no-content-section {
  padding: 0;
}

.request-video-card,
.no-content-section {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 24px 20px;
  text-align: center;
}

.request-video-card h3,
.no-content-title {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 10px;
}

.no-content-title {
  color: var(--text-primary);
}

.request-video-card p,
.no-content-text {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 16px;
}

.request-disclaimer {
  font-size: 11px !important;
  color: var(--text-muted) !important;
  margin-top: 12px !important;
  margin-bottom: 0 !important;
  line-height: 1.4 !important;
  font-style: italic;
}

/* ===== CONTACT SECTION ===== */
.contact-section {
  padding: 16px;
  padding-bottom: calc(32px + var(--safe-bottom));
}

.contact-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 20px;
}

.contact-card h3 {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 16px;
  text-align: center;
}

.contact-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* ===== REGISTRATION SCREEN ===== */
.register-content {
  padding: 24px 16px;
  padding-bottom: calc(32px + var(--safe-bottom));
  flex: 1;
}

.register-content h2 {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 4px;
}

.register-content .subtitle {
  color: var(--text-muted);
  font-size: 14px;
  margin-bottom: 24px;
}

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-group input,
.form-group select {
  width: 100%;
  min-height: var(--touch-min);
  padding: 12px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 15px;
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--case-ih-red);
}

.form-group select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23999' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.equipment-entry {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 12px;
}

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

.equipment-entry-header h4 {
  font-size: 14px;
  font-weight: 600;
  color: var(--case-ih-red);
}

.remove-equipment {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 20px;
  cursor: pointer;
  padding: 4px 8px;
}

.btn-add-equipment {
  background: var(--bg-card);
  border: 1px dashed var(--border-color);
  border-radius: 12px;
  padding: 16px;
  width: 100%;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 14px;
  cursor: pointer;
  margin-bottom: 24px;
  min-height: var(--touch-min);
}
.btn-add-equipment:active { background: var(--bg-input); }

/* Honeypot */
.form-hp { position: absolute; left: -9999px; top: -9999px; opacity: 0; height: 0; width: 0; z-index: -1; }

/* ===== SUCCESS SCREEN ===== */
.success-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  text-align: center;
}

.success-icon {
  font-size: 64px;
  margin-bottom: 24px;
}

.success-content h2 {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 8px;
}

.success-content p {
  color: var(--text-secondary);
  font-size: 15px;
  line-height: 1.6;
  max-width: 400px;
  margin-bottom: 32px;
}

/* ===== LOADING / ERROR STATES ===== */
.loading-state {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  text-align: center;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border-color);
  border-top-color: var(--case-ih-red);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-bottom: 16px;
}

@keyframes spin { to { transform: rotate(360deg); } }

.error-state {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  text-align: center;
}

.error-state h2 { color: var(--danger); margin-bottom: 8px; }
.error-state p { color: var(--text-muted); margin-bottom: 24px; }

/* ===== FOOTER ===== */
.footer {
  padding: 24px 16px;
  text-align: center;
  border-top: 1px solid var(--border-color);
  padding-bottom: calc(24px + var(--safe-bottom));
}

.footer p {
  font-size: 12px;
  color: var(--text-muted);
}

.footer .brand {
  color: var(--accent-gold);
  font-weight: 600;
  letter-spacing: 1px;
}

/* ===== FORM HELPER TEXT ===== */
.form-helper {
  display: block;
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
  line-height: 1.4;
}

/* ===== FORM TEXTAREA ===== */
.form-group textarea {
  width: 100%;
  min-height: 100px;
  padding: 12px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 15px;
  resize: vertical;
}
.form-group textarea:focus {
  outline: none;
  border-color: var(--case-ih-red);
}

/* ===== CLAIM BANNER (on equipment page) ===== */
.claim-banner {
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-color);
  border-left: 3px solid var(--accent-gold);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.claim-banner span {
  font-size: 13px;
  color: var(--text-secondary);
}

.claim-banner a {
  font-size: 13px;
  font-weight: 600;
  color: var(--accent-gold);
  text-decoration: none;
  white-space: nowrap;
}

/* ===== REPORT ISSUE SECTION (on equipment page) ===== */
.report-issue-section {
  padding: 0 16px;
}

.report-issue-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-left: 3px solid var(--case-ih-red);
  border-radius: 12px;
  padding: 24px 20px;
  text-align: center;
}

.report-issue-card h3 {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 8px;
}

.report-issue-card p {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 16px;
}

/* ===== REPORT SCREEN ===== */
.report-content {
  padding: 24px 16px;
  padding-bottom: calc(32px + var(--safe-bottom));
  flex: 1;
}

.report-content h2 {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 4px;
}

.report-back {
  margin-bottom: 16px;
}

.report-back a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
}

.report-equip-info {
  margin-bottom: 20px;
}

.report-equip-model {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
}

.report-equip-serial {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ===== MEDIA CAPTURE AREA ===== */
.media-capture-area {
  background: var(--bg-card);
  border: 1px dashed var(--border-color);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 20px;
  text-align: center;
}

.media-buttons {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-bottom: 12px;
}

.media-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--touch-min);
  padding: 12px 20px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}
.media-btn:active { background: var(--border-color); }

.media-drop-label {
  display: block;
  cursor: pointer;
  margin-bottom: 12px;
}

.media-drop-label span {
  font-size: 13px;
  color: var(--text-muted);
  text-decoration: underline;
}

.media-hint {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 8px;
}

/* ===== MEDIA PREVIEW ===== */
.media-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-top: 12px;
}

.media-thumb {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  position: relative;
}

.media-thumb-icon {
  font-size: 16px;
}

.media-thumb-name {
  color: var(--text-secondary);
  max-width: 80px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.media-thumb-size {
  color: var(--text-muted);
  font-size: 10px;
}

.media-thumb-remove {
  background: none;
  border: none;
  color: var(--danger);
  font-size: 16px;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
}

/* ===== EQUIPMENT DOWN TOGGLE ===== */
.equipment-down-toggle {
  background: var(--bg-card);
  border: 2px solid var(--warning);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.edt-info {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  flex: 1;
}

.edt-icon {
  font-size: 24px;
  flex-shrink: 0;
}

.edt-info strong {
  display: block;
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 2px;
}

.edt-info p {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.4;
}

/* Toggle switch */
.toggle-switch {
  position: relative;
  width: 52px;
  height: 28px;
  flex-shrink: 0;
}

.toggle-switch input { display: none; }

.toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: 28px;
  cursor: pointer;
  transition: all 0.2s;
}

.toggle-slider::before {
  content: '';
  position: absolute;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--text-muted);
  top: 2px;
  left: 2px;
  transition: all 0.2s;
}

.toggle-switch input:checked + .toggle-slider {
  background: var(--danger);
  border-color: var(--danger);
}

.toggle-switch input:checked + .toggle-slider::before {
  background: white;
  transform: translateX(24px);
}

/* ===== SUBMIT ISSUE BUTTON ===== */
.btn-submit-issue {
  font-size: 16px;
  font-weight: 700;
}

/* ===== RESPONSIVE ===== */
@media (min-width: 640px) {
  .landing-hero h2 { font-size: 36px; }
  .landing-features { flex-direction: row; flex-wrap: wrap; max-width: 700px; }
  .feature-card { flex: 1 1 45%; }
  .video-item { padding: 16px; }
  .video-thumb { width: 160px; height: 90px; }
}
