/**
 * RVRSE Forms — Inputs, selects, textareas, checkboxes
 * Brand Book V2 · DEC-009, DEC-016
 */

/* ═══════════════════════════════════════════════════════════════════
   BASE INPUT
   ═══════════════════════════════════════════════════════════════════ */

.input {
  display: block;
  width: 100%;
  background: var(--color-graphite);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-sm);
  color: var(--color-ivory);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.5;
  padding: 11px 14px;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}

.input:focus {
  border-color: rgba(255, 255, 255, 0.18);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.04); /* DEC-016 */
}

.input::placeholder { color: var(--color-muted); }
.input:disabled     { opacity: 0.42; cursor: not-allowed; }
.input:read-only    { opacity: 0.7; cursor: default; background: rgba(30, 36, 50, 0.5); }

/* Monospace (token / ID inputs) */
.input-mono {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  letter-spacing: .02em;
}

/* Service-tinted focus states */
.input-directo:focus { border-color: rgba(16,  185, 129, 0.4); box-shadow: 0 0 0 3px rgba(16,  185, 129, 0.08); }
.input-subasta:focus { border-color: rgba(217, 119,   6, 0.4); box-shadow: 0 0 0 3px rgba(217, 119,   6, 0.08); }
.input-postor:focus  { border-color: rgba(76,   79, 184, 0.4); box-shadow: 0 0 0 3px rgba(76,   79, 184, 0.08); }

/* Error state */
.input.error {
  border-color: rgba(196, 86, 79, 0.5);
  box-shadow: 0 0 0 3px rgba(196, 86, 79, 0.08);
}

/* ═══════════════════════════════════════════════════════════════════
   TEXTAREA
   ═══════════════════════════════════════════════════════════════════ */

.textarea {
  display: block;
  width: 100%;
  background: var(--color-graphite);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-sm);
  color: var(--color-ivory);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.6;
  padding: 11px 14px;
  resize: vertical;
  min-height: 88px;
  outline: none;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  -webkit-appearance: none;
  appearance: none;
}
.textarea:focus {
  border-color: rgba(255, 255, 255, 0.18);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.04);
}
.textarea::placeholder { color: var(--color-muted); }

/* ═══════════════════════════════════════════════════════════════════
   SELECT
   ═══════════════════════════════════════════════════════════════════ */

.select {
  display: block;
  width: 100%;
  background: var(--color-graphite);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-sm);
  color: var(--color-ivory);
  font-family: var(--font-sans);
  font-size: 14px;
  padding: 11px 38px 11px 14px;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
  transition: border-color var(--transition-fast);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236E7A87' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
}
.select:focus { border-color: rgba(255, 255, 255, 0.18); }
.select option { background: var(--color-graphite); color: var(--color-ivory); }

/* ═══════════════════════════════════════════════════════════════════
   LABELS & HELPERS
   ═══════════════════════════════════════════════════════════════════ */

.form-label {
  display: block;
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .10em;
  text-transform: uppercase;
  color: var(--color-muted);
  margin-bottom: 6px;
}

.form-hint {
  font-family: var(--font-sans);
  font-size: 12px;
  color: var(--color-muted);
  margin-top: 5px;
  line-height: 1.5;
}

.form-error {
  font-family: var(--font-sans);
  font-size: 12px;
  color: var(--color-signal-red);
  margin-top: 5px;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ═══════════════════════════════════════════════════════════════════
   FIELD GROUPS & ROWS
   ═══════════════════════════════════════════════════════════════════ */

.form-field   { display: flex; flex-direction: column; }
.form-row     { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-row-3   { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }
.form-section { display: flex; flex-direction: column; gap: 16px; }

/* ═══════════════════════════════════════════════════════════════════
   CHECKBOX
   ═══════════════════════════════════════════════════════════════════ */

.checkbox-wrap {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
}

.checkbox-input {
  width: 16px;
  height: 16px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 3px;
  background: var(--color-graphite);
  flex-shrink: 0;
  margin-top: 1px;
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
  transition: background var(--transition-fast), border-color var(--transition-fast);
  position: relative;
}
.checkbox-input:checked {
  background: var(--color-ivory);
  border-color: var(--color-ivory);
}
.checkbox-input:checked::after {
  content: '';
  position: absolute;
  left: 4px;
  top: 1px;
  width: 5px;
  height: 8px;
  border: 2px solid var(--color-obsidian);
  border-top: none;
  border-left: none;
  transform: rotate(45deg);
}
.checkbox-label {
  font-family: var(--font-sans);
  font-size: 13px;
  color: var(--color-pearl);
  line-height: 1.55;
  cursor: pointer;
}

/* 18+ / legal consent variant */
.checkbox-legal .checkbox-label {
  font-size: 12px;
  color: var(--color-muted);
  line-height: 1.6;
}
.checkbox-legal .checkbox-label a {
  color: var(--color-ivory);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ═══════════════════════════════════════════════════════════════════
   INPUT WITH ICON / PREFIX
   ═══════════════════════════════════════════════════════════════════ */

.input-group { position: relative; }
.input-group .input { padding-left: 42px; }
.input-group-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--color-muted);
  pointer-events: none;
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

/* Input with inline suffix (e.g., "TKN") */
.input-suffix-wrap { position: relative; }
.input-suffix-wrap .input { padding-right: 52px; }
.input-suffix {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .18em;
  color: var(--color-muted);
  pointer-events: none;
  text-transform: uppercase;
}

/* ═══════════════════════════════════════════════════════════════════
   CHAR COUNTER
   ═══════════════════════════════════════════════════════════════════ */

.char-counter {
  font-size: 11px;
  color: var(--color-muted);
  text-align: right;
  margin-top: 4px;
}
.char-counter.near-limit { color: var(--color-signal-amber); }
.char-counter.at-limit   { color: var(--color-signal-red);   }

/* ═══════════════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════════════ */

@media (max-width: 640px) {
  .form-row,
  .form-row-3 { grid-template-columns: 1fr; }
}
