/* ============================================================
   1RM Strength Calculator — Nahnu Media v1.0.0
   Brand: #111 bg · #FF6A00 accent · white text · dark cards
   ============================================================ */

/* ---------- Reset & box model ---------- */
.orm-wrap,
.orm-wrap *,
.orm-wrap *::before,
.orm-wrap *::after {
  box-sizing: border-box;
}

/* ---------- CSS custom properties ---------- */
.orm-wrap {
  --primary:        #FF6A00;
  --primary-dark:   #e05800;
  --surface:        #1a1a1a;
  --surface-2:      #222222;
  --surface-3:      #2a2a2a;
  --border:         #2e2e2e;
  --text:           #ffffff;
  --text-muted:     #8a8a8a;
  --text-secondary: #b0b0b0;
  --error:          #ff4d4d;
  --radius-card:    18px;
  --radius-input:   12px;
  --radius-pill:    999px;

  width: 100%;
  max-width: 1200px;
  margin: 24px auto;
  padding: 0 12px;
  background: transparent;
  color: var(--text);
  min-width: 0;
  overflow: hidden;
}

/* ---------- Two-column layout ---------- */
.orm-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  min-width: 0;
  align-items: start;
}

@media (min-width: 900px) {
  .orm-grid {
    grid-template-columns: 380px 1fr;
    gap: 20px;
  }
}

.orm-grid > * {
  min-width: 0;
  width: 100%;
}

/* ---------- Cards ---------- */
.orm-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  overflow: hidden;
  min-width: 0;
}

.orm-form {
  padding: 18px;
}

/* ---------- Results panel ---------- */
.orm-results {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  overflow: hidden;
  min-width: 0;
  height: auto;
}

/* Header */
.orm-head {
  background: #000;
  border-bottom: 2px solid var(--primary);
  padding: 16px 20px;
}
.orm-h-title {
  font-size: 15px;
  font-weight: 900;
  color: #fff;
  margin: 0 0 2px;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}
.orm-h-sub {
  font-size: 12px;
  color: var(--text-muted);
  margin: 0;
}

.orm-body {
  padding: 16px 18px;
}

/* ---------- Metric / Imperial tabs ---------- */
.orm-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
  background: var(--surface-2);
  padding: 4px;
  border-radius: var(--radius-pill);
  margin-bottom: 18px;
  border: 1px solid var(--border);
  min-width: 0;
}
.orm-tab {
  padding: 9px 12px;
  border-radius: var(--radius-pill);
  font-weight: 800;
  font-size: 14px;
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  transition: background 0.15s, color 0.15s, transform 0.04s;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
.orm-tab:hover { color: var(--text); }
.orm-tab:active { transform: translateY(1px); }
.orm-tab[aria-selected='true'] {
  background: var(--primary);
  color: #fff;
  font-weight: 900;
}

/* ---------- Form grid ---------- */
.orm-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  min-width: 0;
}

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

.orm-field {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.orm-label {
  font-size: 11px;
  font-weight: 800;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 5px;
}

/* Inputs & selects */
.orm-input,
.orm-select {
  width: 100%;
  min-width: 0;
  padding: 11px 13px;
  border: 1px solid var(--border);
  border-radius: var(--radius-input);
  font-size: 15px;
  font-weight: 600;
  background: var(--surface-2);
  color: var(--text);
  transition: border-color 0.15s, box-shadow 0.15s;
  appearance: none;
  -webkit-appearance: none;
}
.orm-input::placeholder { color: var(--text-muted); }
.orm-input:hover,
.orm-select:hover { border-color: #444; }
.orm-input:focus,
.orm-select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(255, 106, 0, 0.18);
}

/* Custom select arrow */
.orm-select {
  background-image: none;
  padding-right: 34px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%238a8a8a' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: calc(100% - 12px) 50%;
  background-size: 12px 8px;
}

.orm-hint {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 5px;
  line-height: 1.4;
}

.orm-error {
  color: var(--error);
  font-size: 13px;
  font-weight: 600;
  margin-top: 8px;
  display: none;
}

/* ---------- Actions ---------- */
.orm-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 16px;
}
.orm-btn {
  border: none;
  padding: 11px 22px;
  border-radius: var(--radius-pill);
  font-weight: 900;
  font-size: 14px;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.04s;
  white-space: nowrap;
}
.orm-btn:hover { opacity: 0.88; }
.orm-btn:active { transform: translateY(1px); }
.orm-primary { background: var(--primary); color: #fff; }
.orm-ghost {
  background: var(--surface-3);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}
.orm-ghost:hover { color: var(--text); border-color: #444; }

/* ---------- 1RM hero block ---------- */
.orm-1rm {
  margin: 0 0 14px;
  padding: 18px 14px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-input);
  text-align: center;
}
.orm-1rm .big {
  font-size: 52px;
  font-weight: 900;
  color: var(--primary);
  line-height: 1;
  margin-bottom: 4px;
}
.orm-1rm .sub {
  font-size: 13px;
  color: var(--text-muted);
}

/* ---------- Percentile badge ---------- */
.orm-badge {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-input);
  padding: 12px 16px;
  font-weight: 700;
  font-size: 14px;
  color: var(--text-secondary);
  text-align: center;
  margin-bottom: 14px;
}

/* ---------- Breakdown ---------- */
.orm-break {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-input);
  padding: 14px;
  margin-bottom: 12px;
  min-width: 0;
}
.orm-b-title {
  font-size: 11px;
  font-weight: 800;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 8px;
}
.orm-b-rows { display: grid; gap: 3px; min-width: 0; }
.orm-b-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 14px;
  color: var(--text-secondary);
  transition: background 0.12s;
  gap: 8px;
  min-width: 0;
}
.orm-b-row:hover { background: var(--surface-3); }
.orm-b-row div:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.orm-b-row strong { color: var(--text); font-weight: 800; white-space: nowrap; flex-shrink: 0; }

/* ---------- Charts ---------- */
.chart-wrap {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-input);
  padding: 14px;
  margin-bottom: 12px;
  min-width: 0;
}
.orm-m-title {
  font-size: 11px;
  font-weight: 800;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 10px;
}
.canvas-hold {
  position: relative;
  width: 100%;
  height: 230px;
  min-width: 0;
}
@media (max-width: 480px) { .canvas-hold { height: 180px; } }

/* Empty state overlay */
.canvas-hold.is-empty::after {
  content: attr(data-empty-message);
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 13px;
  text-align: center;
  padding: 0 16px;
}

/* ---------- Note ---------- */
.orm-note {
  border: 1px solid var(--border);
  border-radius: var(--radius-input);
  padding: 12px 14px;
  background: var(--surface-2);
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-muted);
  margin-top: 14px;
}

/* ---------- Results visibility ---------- */
.res-inner { display: none; }
.orm-wrap.has-results .res-inner { display: block; }

/* ---------- Focus a11y ---------- */
.orm-wrap :focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .orm-btn { transition: none !important; }
}

/* ---------- Small screen tweaks ---------- */
@media (max-width: 480px) {
  .orm-form  { padding: 14px; }
  .orm-body  { padding: 12px 14px; }
  .orm-1rm .big { font-size: 40px; }

  .orm-actions {
    flex-direction: column;
  }
  .orm-actions .orm-btn {
    width: 100%;
    text-align: center;
  }
}

/* ---------- RTL ---------- */
[dir='rtl'] .orm-b-row { flex-direction: row-reverse; }
