/* ========================================================
   Mobile App Components (Standalone Prototype)
   ======================================================== */

/* Mobile Touch Buttons */
.m-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  height: 48px;
  padding: 0 var(--space-4);
  border-radius: 12px;
  font-size: 14px;
  font-weight: var(--weight-semibold);
  border: none;
  cursor: pointer;
  transition: all var(--duration-fast);
  white-space: nowrap;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}
.m-btn:active { transform: scale(0.97); }

.m-btn-primary { background-color: var(--military-green); color: white; }
.m-btn-secondary { background-color: var(--primary-50); color: var(--primary-700); }
.m-btn-outline { background-color: #FFFFFF; border: 1.5px solid #CBD5E1; color: var(--text-primary); }
.m-btn-ghost { background-color: transparent; color: var(--text-primary); }
.m-btn-danger { background-color: var(--danger-50); color: var(--danger-600); }

.m-btn-icon {
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 50%;
}

.m-btn-block { width: 100% !important; box-sizing: border-box !important; }

/* Mobile Floating Action Button (FAB) */
.m-fab {
  position: absolute;
  bottom: 80px;
  right: var(--space-4);
  width: 52px;
  height: 52px;
  border-radius: 16px;
  background-color: var(--military-green);
  color: white;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  box-shadow: 0 4px 12px rgba(14, 110, 78, 0.3);
  cursor: pointer;
  transition: transform var(--duration-fast), box-shadow var(--duration-fast);
  z-index: 80;
}
.m-fab:active { transform: scale(0.92); }

/* Mobile Cards */
.m-card {
  background-color: #FFFFFF;
  border-radius: 14px;
  padding: 12px;
  margin-bottom: 12px;
  border: 1px solid #E2E8F0;
  box-shadow: 0 2px 6px rgba(0,0,0,0.02);
  position: relative;
  overflow: hidden;
  box-sizing: border-box;
}

.m-card-interactive {
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.m-card-interactive:active {
  background-color: #F8FAFC;
  transform: scale(0.98);
}

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

/* ========================================================
   Form Inputs (Crisp Full-width Styling for Mobile Login & Forms)
   ======================================================== */

.m-input-group {
  margin-bottom: 14px;
  width: 100%;
  box-sizing: border-box;
}

.m-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 6px;
  color: #475569;
}

.m-input {
  width: 100% !important;
  box-sizing: border-box !important;
  height: 50px;
  background-color: #F8FAFC;
  border: 1.5px solid #CBD5E1;
  border-radius: 12px;
  padding: 0 16px;
  font-size: 14px;
  color: #0F172A;
  font-family: inherit;
  transition: all 0.2s ease;
  display: block;
  -webkit-appearance: none;
}

.m-input:focus {
  border-color: #0E6E4E;
  background-color: #FFFFFF;
  box-shadow: 0 0 0 3px rgba(14, 110, 78, 0.12);
  outline: none;
}

.m-textarea {
  height: auto;
  min-height: 90px;
  padding: 12px 16px;
  resize: none;
}

/* Floating Labels */
.m-input-floating {
  position: relative;
  margin-bottom: 12px;
  width: 100%;
  box-sizing: border-box;
}

.m-input-floating input,
.m-input-floating textarea,
.m-input-floating select {
  height: 50px;
  padding: 20px 12px 6px;
  font-size: 14px;
  background: #F8FAFC;
  border: 1.5px solid #CBD5E1;
  border-radius: 12px;
  width: 100% !important;
  color: #0F172A;
  font-family: inherit;
  box-sizing: border-box !important;
  transition: all 0.2s ease;
  -webkit-appearance: none;
  display: block;
}

.m-input-floating input[type="date"] {
  padding: 20px 12px 4px;
  font-family: inherit;
  color: #0F172A;
  font-weight: 500;
}

.m-input-floating textarea {
  height: 90px;
  padding: 22px 12px 6px;
  resize: none;
}

.m-input-floating label {
  position: absolute;
  top: 14px;
  right: 12px;
  color: #64748B;
  font-size: 13px;
  pointer-events: none;
  transition: all 0.2s ease;
}

.m-input-floating input:focus,
.m-input-floating textarea:focus,
.m-input-floating select:focus {
  border-color: #0E6E4E;
  background: #FFFFFF;
  box-shadow: 0 0 0 3px rgba(14, 110, 78, 0.12);
  outline: none;
}

.m-input-floating input:focus ~ label,
.m-input-floating textarea:focus ~ label,
.m-input-floating select:focus ~ label,
.m-input-floating input:not(:placeholder-shown) ~ label,
.m-input-floating textarea:not(:placeholder-shown) ~ label,
.m-input-floating select:valid ~ label,
.m-input-floating input[type="date"] ~ label {
  top: 6px;
  font-size: 10px;
  color: #0E6E4E;
  font-weight: bold;
}

/* Bottom Sheet Picker (Contained Strictly Inside Smartphone Simulator) */
.m-bottom-sheet-overlay {
  display: none !important;
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  z-index: 1500;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.m-bottom-sheet-overlay.open {
  display: block !important;
  opacity: 1;
  pointer-events: auto;
}

.m-bottom-sheet {
  display: none !important;
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: #FFFFFF;
  border-top-left-radius: 24px;
  border-top-right-radius: 24px;
  padding: 16px 14px 28px;
  z-index: 1501;
  box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.2);
  box-sizing: border-box;
}

.m-bottom-sheet.open {
  display: flex !important;
  flex-direction: column;
  animation: m-sheet-slide-up 0.25s cubic-bezier(0.25, 0.8, 0.25, 1) forwards;
}

@keyframes m-sheet-slide-up {
  from { transform: translateY(100%); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.m-sheet-handle {
  width: 36px;
  height: 4px;
  background: #CBD5E1;
  border-radius: 2px;
  margin: 0 auto 12px;
}

/* File Upload Area */
.m-upload-area {
  border: 1.5px dashed #0E6E4E;
  border-radius: 12px;
  padding: 14px;
  text-align: center;
  background: #ECFDF5;
  transition: all 0.2s ease;
  cursor: pointer;
  box-sizing: border-box;
}
.m-upload-area:active { background: #D1FAE5; }
.m-upload-icon { font-size: 32px; color: #0E6E4E; margin-bottom: 4px; }

/* Tabs Component */
.m-tabs {
  display: flex;
  background: #F1F5F9;
  padding: 3px;
  border-radius: 10px;
  margin-bottom: 12px;
}
.m-tab {
  flex: 1;
  text-align: center;
  padding: 6px;
  font-size: 12px;
  font-weight: bold;
  color: #64748B;
  border-radius: 8px;
  transition: all 0.2s ease;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.m-tab.active {
  background: #FFFFFF;
  color: #0E6E4E;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
.m-tab-content { display: none; }
.m-tab-content.active { display: block; }

/* Horizontal Scroll Chips */
.m-h-scroll {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 4px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.m-h-scroll::-webkit-scrollbar { display: none; }

.m-chip {
  padding: 0 12px;
  height: 32px;
  border-radius: 16px;
  background: #F1F5F9;
  border: 1px solid transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  transition: all 0.2s ease;
}
.m-chip.active {
  background: #0E6E4E;
  color: white;
  font-weight: bold;
}
