/**
 * MIGESTI OS -- field_sync_mobile.css
 * Mobile-optimized styles for Field Sync interface.
 *
 * Dark theme, 48px+ touch targets, 320px+ screens,
 * high contrast, no horizontal scroll.
 *
 * Architect: Matthew F. Inglima
 * CONFIDENTIAL -- All Rights Reserved
 */

/* ---- CSS Custom Properties ---- */
:root {
  --fsm-bg: #0a0e1a;
  --fsm-surface: #111827;
  --fsm-surface-alt: #1a2235;
  --fsm-border: #2a3550;
  --fsm-text: #e8eaf0;
  --fsm-text-muted: #8892a8;
  --fsm-cyan: #00e5ff;
  --fsm-gold: #ffc107;
  --fsm-green: #00e676;
  --fsm-red: #ff5252;
  --fsm-blue: #448aff;
  --fsm-radius: 12px;
  --fsm-radius-sm: 8px;
  --fsm-touch-min: 48px;
  --fsm-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* ---- Base Reset ---- */
.fsm-page {
  margin: 0;
  padding: 0;
  font-family: var(--fsm-font);
  background: var(--fsm-bg);
  color: var(--fsm-text);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  font-size: 16px;
  line-height: 1.5;
}

.fsm-page * { box-sizing: border-box; }

/* ---- Header ---- */
.fsm-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--fsm-surface);
  border-bottom: 1px solid var(--fsm-border);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.fsm-header__logo {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--fsm-cyan);
  letter-spacing: 1px;
}

.fsm-header__status {
  font-size: 0.75rem;
  color: var(--fsm-text-muted);
  padding: 4px 10px;
  border-radius: 20px;
  background: var(--fsm-surface-alt);
}

.fsm-header__status--active {
  color: var(--fsm-green);
  background: rgba(0, 230, 118, 0.1);
}

/* ---- State Sections ---- */
.fsm-section {
  display: none;
  padding: 16px;
  animation: fsm-fade 0.3s ease;
}

.fsm-section--active {
  display: block;
}

@keyframes fsm-fade {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---- Card ---- */
.fsm-card {
  background: var(--fsm-surface);
  border: 1px solid var(--fsm-border);
  border-radius: var(--fsm-radius);
  padding: 16px;
  margin-bottom: 12px;
}

.fsm-card__title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--fsm-cyan);
  margin-bottom: 8px;
}

/* ---- Buttons ---- */
.fsm-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--fsm-touch-min);
  padding: 12px 24px;
  border: none;
  border-radius: var(--fsm-radius-sm);
  font-family: var(--fsm-font);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
  width: 100%;
  text-align: center;
}

.fsm-btn:active { transform: scale(0.97); }

.fsm-btn--primary {
  background: var(--fsm-cyan);
  color: var(--fsm-bg);
}

.fsm-btn--gold {
  background: var(--fsm-gold);
  color: var(--fsm-bg);
}

.fsm-btn--green {
  background: var(--fsm-green);
  color: var(--fsm-bg);
}

.fsm-btn--danger {
  background: var(--fsm-red);
  color: #fff;
}

.fsm-btn--outline {
  background: transparent;
  border: 2px solid var(--fsm-cyan);
  color: var(--fsm-cyan);
}

.fsm-btn--disabled {
  opacity: 0.4;
  pointer-events: none;
}

/* ---- Scan Zone ---- */
.fsm-scan-zone {
  border: 2px dashed var(--fsm-cyan);
  border-radius: var(--fsm-radius);
  padding: 40px 20px;
  text-align: center;
  background: rgba(0, 229, 255, 0.03);
  margin-bottom: 16px;
}

.fsm-scan-zone__icon {
  font-size: 3rem;
  margin-bottom: 12px;
  display: block;
}

.fsm-scan-zone__text {
  font-size: 1rem;
  color: var(--fsm-text-muted);
}

/* ---- Task Card ---- */
.fsm-task {
  background: var(--fsm-surface);
  border: 1px solid var(--fsm-border);
  border-left: 4px solid var(--fsm-cyan);
  border-radius: var(--fsm-radius-sm);
  padding: 14px;
  margin-bottom: 10px;
}

.fsm-task__title {
  font-weight: 600;
  font-size: 1rem;
  margin-bottom: 4px;
}

.fsm-task__meta {
  font-size: 0.8rem;
  color: var(--fsm-text-muted);
  display: flex;
  justify-content: space-between;
}

.fsm-task--done { border-left-color: var(--fsm-green); }
.fsm-task--priority { border-left-color: var(--fsm-gold); }

/* ---- Steps Checklist ---- */
.fsm-steps { list-style: none; padding: 0; margin: 0; }

.fsm-step {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: var(--fsm-touch-min);
  padding: 10px 14px;
  border-bottom: 1px solid var(--fsm-border);
}

.fsm-step__check {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid var(--fsm-border);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 0.9rem;
}

.fsm-step--done .fsm-step__check {
  background: var(--fsm-green);
  border-color: var(--fsm-green);
  color: var(--fsm-bg);
}

.fsm-step__label {
  font-size: 0.9rem;
  flex: 1;
}

/* ---- Verification Grid ---- */
.fsm-verify-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 12px;
}

.fsm-verify-item {
  background: var(--fsm-surface-alt);
  border-radius: var(--fsm-radius-sm);
  padding: 14px;
  text-align: center;
  min-height: var(--fsm-touch-min);
}

.fsm-verify-item__icon { font-size: 1.5rem; margin-bottom: 6px; display: block; }
.fsm-verify-item__label { font-size: 0.75rem; color: var(--fsm-text-muted); }
.fsm-verify-item--pass { border: 1px solid var(--fsm-green); }
.fsm-verify-item--fail { border: 1px solid var(--fsm-red); }

/* ---- Signature Canvas ---- */
.fsm-signature {
  border: 2px solid var(--fsm-border);
  border-radius: var(--fsm-radius-sm);
  background: var(--fsm-surface-alt);
  touch-action: none;
  width: 100%;
  height: 150px;
  display: block;
}

/* ---- Payment Receipt ---- */
.fsm-receipt {
  background: var(--fsm-surface);
  border: 2px solid var(--fsm-green);
  border-radius: var(--fsm-radius);
  padding: 20px;
  text-align: center;
  margin-bottom: 16px;
}

.fsm-receipt__amount {
  font-size: 2rem;
  font-weight: 700;
  color: var(--fsm-green);
  margin: 12px 0;
}

.fsm-receipt__label {
  font-size: 0.8rem;
  color: var(--fsm-text-muted);
}

.fsm-receipt__tx {
  font-family: monospace;
  font-size: 0.7rem;
  color: var(--fsm-text-muted);
  word-break: break-all;
  margin-top: 8px;
}

/* ---- EOMI Mini Chat ---- */
.fsm-eomi-chat {
  background: var(--fsm-surface-alt);
  border-radius: var(--fsm-radius-sm);
  padding: 12px;
  margin-bottom: 12px;
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.fsm-eomi-chat__orb {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--fsm-cyan), var(--fsm-blue));
  flex-shrink: 0;
}

.fsm-eomi-chat__msg {
  font-size: 0.85rem;
  color: var(--fsm-text);
  flex: 1;
}

/* ---- Badge ---- */
.fsm-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
}

.fsm-badge--green { background: rgba(0, 230, 118, 0.15); color: var(--fsm-green); }
.fsm-badge--gold { background: rgba(255, 193, 7, 0.15); color: var(--fsm-gold); }
.fsm-badge--cyan { background: rgba(0, 229, 255, 0.15); color: var(--fsm-cyan); }
.fsm-badge--red { background: rgba(255, 82, 82, 0.15); color: var(--fsm-red); }

/* ---- Progress Bar ---- */
.fsm-progress {
  height: 6px;
  background: var(--fsm-surface-alt);
  border-radius: 3px;
  overflow: hidden;
  margin: 8px 0;
}

.fsm-progress__fill {
  height: 100%;
  background: var(--fsm-cyan);
  border-radius: 3px;
  transition: width 0.4s ease;
}

/* ---- Responsive ---- */
@media (max-width: 380px) {
  .fsm-verify-grid { grid-template-columns: 1fr; }
  .fsm-header__logo { font-size: 0.95rem; }
}

@media (min-width: 600px) {
  .fsm-section { max-width: 480px; margin: 0 auto; }
}
