/* ==========================================================================
 *  assets/pwa-weigh.css
 *  Maat OS · Input Peso (P1/P2)
 * ========================================================================== */

.maat-weigh-overlay {
  position: fixed;
  inset: 0;
  background: rgba(6, 10, 13, 0.96);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 92;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: maatWeighFadeIn 0.2s ease-out;
}
.maat-weigh-overlay[hidden] { display: none !important; }

@keyframes maatWeighFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.maat-weigh-card {
  width: 100%;
  max-width: 400px;
  background: #0A0D10;
  border: 1px solid rgba(0, 255, 163, 0.4);
  border-radius: 18px;
  padding: 22px 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-shadow: 0 25px 70px rgba(0, 0, 0, 0.85);
}

.maat-weigh-card.is-p2 {
  border-color: rgba(232, 200, 106, 0.5);
}

.maat-weigh-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.maat-weigh-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 6px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  background: rgba(0, 255, 163, 0.12);
  color: #00FFA3;
  border: 1px solid rgba(0, 255, 163, 0.4);
}
.maat-weigh-card.is-p2 .maat-weigh-badge {
  background: rgba(232, 200, 106, 0.12);
  color: #E8C86A;
  border-color: rgba(232, 200, 106, 0.4);
}

.maat-weigh-close {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #94A3B8;
  font-size: 1.3rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}
.maat-weigh-close:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
}

.maat-weigh-title {
  font-family: 'Cinzel', serif;
  font-size: 1.15rem;
  font-weight: 800;
  color: #fff;
  margin: 0;
  text-align: center;
}

.maat-weigh-context {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  color: #94A3B8;
  text-align: center;
  padding: 10px 12px;
  background: rgba(0, 0, 0, 0.5);
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  line-height: 1.5;
}
.maat-weigh-context strong {
  color: #00FFA3;
  font-weight: 700;
}
.maat-weigh-card.is-p2 .maat-weigh-context strong { color: #E8C86A; }

.maat-weigh-field {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 8px;
  background: rgba(0, 0, 0, 0.7);
  border: 2px solid rgba(0, 255, 163, 0.35);
  border-radius: 12px;
  transition: border-color 0.2s;
}
.maat-weigh-field:focus-within {
  border-color: #00FFA3;
  box-shadow: 0 0 0 4px rgba(0, 255, 163, 0.12);
}
.maat-weigh-card.is-p2 .maat-weigh-field {
  border-color: rgba(232, 200, 106, 0.4);
}
.maat-weigh-card.is-p2 .maat-weigh-field:focus-within {
  border-color: #E8C86A;
  box-shadow: 0 0 0 4px rgba(232, 200, 106, 0.12);
}

.maat-weigh-input {
  flex: 1;
  border: none;
  background: transparent;
  outline: none;
  color: #00FFA3;
  font-family: 'JetBrains Mono', monospace;
  font-size: 2rem;
  font-weight: 800;
  text-align: right;
  padding: 8px 4px;
  letter-spacing: 0.02em;
  min-width: 0;
}
.maat-weigh-card.is-p2 .maat-weigh-input { color: #E8C86A; }
.maat-weigh-input::placeholder {
  color: rgba(0, 255, 163, 0.25);
}

.maat-weigh-unit {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.9rem;
  font-weight: 700;
  color: #64748B;
  padding-right: 8px;
}

.maat-weigh-quickadd {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}
.maat-weigh-quick {
  padding: 10px 6px;
  border-radius: 10px;
  background: rgba(0, 255, 163, 0.06);
  border: 1px solid rgba(0, 255, 163, 0.3);
  color: #00FFA3;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
  text-align: center;
  min-height: 44px;
}
.maat-weigh-quick:hover {
  background: rgba(0, 255, 163, 0.18);
}
.maat-weigh-quick:active { transform: scale(0.96); }
.maat-weigh-card.is-p2 .maat-weigh-quick {
  background: rgba(232, 200, 106, 0.06);
  border-color: rgba(232, 200, 106, 0.3);
  color: #E8C86A;
}
.maat-weigh-card.is-p2 .maat-weigh-quick:hover {
  background: rgba(232, 200, 106, 0.18);
}

.maat-weigh-error {
  padding: 10px 12px;
  border-radius: 8px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  text-align: center;
  color: #F87171;
  background: rgba(248, 113, 113, 0.1);
  border: 1px solid rgba(248, 113, 113, 0.3);
}

.maat-weigh-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.maat-weigh-btn {
  padding: 14px 16px;
  border-radius: 10px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.15s ease;
  border: 1px solid transparent;
  min-height: 48px;
}
.maat-weigh-btn:disabled {
  opacity: 0.45;
  cursor: wait;
}
.maat-weigh-btn--primary {
  background: linear-gradient(135deg, #00B871, #00FFA3);
  color: #001a10;
  border: none;
}
.maat-weigh-btn--primary:hover:not(:disabled) {
  filter: brightness(1.1);
  box-shadow: 0 0 20px rgba(0, 255, 163, 0.4);
}
.maat-weigh-card.is-p2 .maat-weigh-btn--primary {
  background: linear-gradient(135deg, #C5A059, #E8C86A);
  color: #1a1405;
}
.maat-weigh-card.is-p2 .maat-weigh-btn--primary:hover:not(:disabled) {
  box-shadow: 0 0 20px rgba(232, 200, 106, 0.4);
}
.maat-weigh-btn--ghost {
  background: transparent;
  border-color: rgba(255, 255, 255, 0.15);
  color: #94A3B8;
}
.maat-weigh-btn--ghost:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
}

@media (max-width: 480px) {
  .maat-weigh-card { padding: 18px 14px; }
  .maat-weigh-input { font-size: 1.8rem; }
  .maat-weigh-quickadd { gap: 6px; }
  .maat-weigh-quick { font-size: 0.68rem; padding: 8px 4px; }
}
