/* TRX Energy production components — Selected C / Warm Infrastructure. */

.trx-app {
  background: var(--trx-color-canvas);
  color: var(--trx-color-ink);
  font: 400 var(--trx-text-base) / var(--trx-leading-body) var(--trx-font-ui);
}

.trx-app *,
.trx-app *::before,
.trx-app *::after {
  box-sizing: border-box;
}

.trx-app :where(button, input) {
  color: inherit;
  font: inherit;
}

.trx-app :where(button, input, [tabindex]):focus-visible {
  outline: 3px solid var(--trx-color-focus);
  outline-offset: 3px;
}

.trx-heading {
  font-size: var(--trx-text-2xl);
  font-weight: 650;
  letter-spacing: -0.04em;
  line-height: var(--trx-leading-tight);
  margin: 0;
  text-wrap: balance;
}

.trx-body-copy {
  color: var(--trx-color-text-muted);
  margin: 0;
  max-width: 68ch;
  text-wrap: pretty;
}

.trx-mono {
  font-family: var(--trx-font-mono);
  font-variant-numeric: tabular-nums;
}

.trx-button {
  align-items: center;
  border: 1px solid transparent;
  border-radius: var(--trx-radius-sm);
  cursor: pointer;
  display: inline-flex;
  font-weight: 750;
  gap: var(--trx-space-2);
  justify-content: center;
  line-height: 1.25;
  min-height: var(--trx-control-min);
  padding: var(--trx-space-3) var(--trx-space-5);
  text-decoration: none;
  transition: background-color var(--trx-duration-fast) var(--trx-ease-standard),
    border-color var(--trx-duration-fast) var(--trx-ease-standard),
    color var(--trx-duration-fast) var(--trx-ease-standard);
}

.trx-button--primary {
  background: var(--trx-color-action);
  color: var(--trx-color-on-action);
}

.trx-button--primary:hover:not(:disabled) {
  background: var(--trx-color-action-hover);
}

.trx-button--secondary {
  background: var(--trx-color-surface);
  border-color: var(--trx-color-border-strong);
  color: var(--trx-color-ink);
}

.trx-button--secondary:hover:not(:disabled) {
  background: var(--trx-color-surface-subtle);
  border-color: var(--trx-color-action);
}

.trx-button:disabled,
.trx-button[aria-disabled="true"] {
  background: var(--trx-color-disabled-bg);
  border-color: var(--trx-color-border);
  color: var(--trx-color-disabled);
  cursor: not-allowed;
}

.trx-button[aria-busy="true"]::before {
  animation: trx-spin 800ms linear infinite;
  border: 2px solid currentColor;
  border-radius: 50%;
  border-right-color: transparent;
  content: "";
  height: 1rem;
  width: 1rem;
}

.trx-field {
  display: grid;
  gap: var(--trx-space-2);
}

.trx-field__label {
  font-size: var(--trx-text-sm);
  font-weight: 750;
}

.trx-address-control {
  align-items: stretch;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
}

.trx-address-input {
  background: var(--trx-color-surface-strong);
  border: 1px solid var(--trx-color-border-strong);
  border-radius: var(--trx-radius-sm) 0 0 var(--trx-radius-sm);
  font: 400 var(--trx-text-base) / 1.4 var(--trx-font-mono);
  min-height: 48px;
  min-width: 0;
  padding: var(--trx-space-3);
}

.trx-address-input::placeholder {
  color: var(--trx-color-text-quiet);
}

.trx-address-input[aria-invalid="true"] {
  background: var(--trx-color-danger-soft);
  border-color: var(--trx-color-danger);
}

.trx-address-action {
  background: var(--trx-color-surface-subtle);
  border: 1px solid var(--trx-color-border-strong);
  border-left: 0;
  border-radius: 0 var(--trx-radius-sm) var(--trx-radius-sm) 0;
  color: var(--trx-color-action);
  cursor: pointer;
  font-size: var(--trx-text-sm);
  font-weight: 750;
  min-height: 48px;
  padding: var(--trx-space-2) var(--trx-space-4);
}

.trx-address-action:disabled {
  color: var(--trx-color-disabled);
  cursor: not-allowed;
}

.trx-field__help,
.trx-field__error {
  font-size: var(--trx-text-sm);
  margin: 0;
}

.trx-field__help {
  color: var(--trx-color-text-muted);
}

.trx-field__error {
  color: var(--trx-color-danger);
  font-weight: 650;
}

.trx-quote {
  background: var(--trx-color-surface);
  border: 1px solid var(--trx-color-border);
  box-shadow: var(--trx-shadow-surface);
}

.trx-quote__hero {
  background: var(--trx-color-rail);
  color: var(--trx-color-on-rail);
  padding: var(--trx-space-6);
}

.trx-quote__kicker,
.trx-quote__id {
  color: #d8cbbb;
  font: 700 var(--trx-text-xs) / 1.4 var(--trx-font-mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.trx-quote__header {
  align-items: center;
  display: flex;
  gap: var(--trx-space-4);
  justify-content: space-between;
}

.trx-quote__amount {
  align-items: baseline;
  display: flex;
  flex-wrap: wrap;
  gap: var(--trx-space-3);
  margin-top: var(--trx-space-5);
}

.trx-quote__amount strong {
  font-size: clamp(2.75rem, 8vw, 4.75rem);
  font-weight: 650;
  letter-spacing: -0.055em;
  line-height: 0.95;
}

.trx-quote__amount span {
  color: #a9cbbb;
  font: 700 var(--trx-text-sm) / 1 var(--trx-font-mono);
  text-transform: uppercase;
}

.trx-quote__details {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.trx-quote__detail {
  border-top: 1px solid var(--trx-color-border);
  display: grid;
  gap: var(--trx-space-1);
  padding: var(--trx-space-4) var(--trx-space-5);
}

.trx-quote__detail:nth-child(even) {
  border-left: 1px solid var(--trx-color-border);
}

.trx-quote__detail span {
  color: var(--trx-color-text-muted);
  font-size: var(--trx-text-sm);
}

.trx-quote__detail strong {
  font-family: var(--trx-font-mono);
}

.trx-payment-methods {
  border: 0;
  display: grid;
  gap: var(--trx-space-3);
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 0;
  padding: 0;
}

.trx-payment-methods legend {
  font-size: var(--trx-text-sm);
  font-weight: 750;
  margin-bottom: var(--trx-space-2);
}

.trx-payment-method {
  cursor: pointer;
  display: block;
  min-width: 0;
  position: relative;
}

.trx-payment-method > input {
  height: 1px;
  opacity: 0;
  position: absolute;
  width: 1px;
}

.trx-payment-method__body {
  background: var(--trx-color-surface);
  border: 1px solid var(--trx-color-border-strong);
  border-radius: var(--trx-radius-md);
  display: grid;
  gap: var(--trx-space-1);
  min-height: 76px;
  padding: var(--trx-space-4);
}

.trx-payment-method__body small {
  color: var(--trx-color-text-muted);
}

.trx-payment-method > input:checked + .trx-payment-method__body {
  background: var(--trx-color-action-soft);
  border-color: var(--trx-color-action);
  box-shadow: inset 4px 0 0 var(--trx-color-action);
}

.trx-payment-method > input:focus-visible + .trx-payment-method__body {
  outline: 3px solid var(--trx-color-focus);
  outline-offset: 3px;
}

.trx-payment-method > input:disabled + .trx-payment-method__body {
  background: var(--trx-color-disabled-bg);
  color: var(--trx-color-disabled);
  cursor: not-allowed;
}

.trx-status {
  align-items: center;
  background: var(--trx-color-action-soft);
  border: 1px solid #a9c9ba;
  border-radius: var(--trx-radius-status);
  color: var(--trx-color-action-hover);
  display: inline-flex;
  font: 700 var(--trx-text-xs) / 1.2 var(--trx-font-mono);
  gap: var(--trx-space-2);
  min-height: 32px;
  padding: var(--trx-space-2) var(--trx-space-3);
  text-transform: uppercase;
}

.trx-status::before {
  background: currentColor;
  border-radius: 50%;
  content: "";
  height: 0.4rem;
  width: 0.4rem;
}

.trx-status--error {
  background: var(--trx-color-danger-soft);
  border-color: #d3a49d;
  color: var(--trx-color-danger);
}

.trx-status--loading {
  background: var(--trx-color-info-soft);
  border-color: #abc3d1;
  color: var(--trx-color-info);
}

.trx-status--disabled {
  background: var(--trx-color-disabled-bg);
  border-color: var(--trx-color-border-strong);
  color: var(--trx-color-disabled);
}

.trx-alert {
  background: var(--trx-color-info-soft);
  border: 1px solid #abc3d1;
  border-left: 4px solid var(--trx-color-info);
  border-radius: var(--trx-radius-sm);
  color: var(--trx-color-ink);
  display: grid;
  gap: var(--trx-space-1);
  padding: var(--trx-space-4);
}

.trx-alert strong {
  font-size: var(--trx-text-sm);
}

.trx-alert p {
  color: var(--trx-color-text-muted);
  margin: 0;
}

.trx-alert--error {
  background: var(--trx-color-danger-soft);
  border-color: #d3a49d;
  border-left-color: var(--trx-color-danger);
}

.trx-alert--warning {
  background: var(--trx-color-warning-soft);
  border-color: #d8bf98;
  border-left-color: var(--trx-color-warning);
}

.trx-dialog {
  background: var(--trx-color-surface);
  border: 1px solid var(--trx-color-border-strong);
  border-radius: var(--trx-radius-lg);
  box-shadow: var(--trx-shadow-dialog);
  color: var(--trx-color-ink);
  margin: auto;
  max-width: min(34rem, calc(100% - 2rem));
  padding: 0;
  width: 100%;
}

.trx-dialog::backdrop {
  background: rgba(49, 43, 37, 0.62);
}

.trx-dialog__header,
.trx-dialog__body,
.trx-dialog__actions {
  padding: var(--trx-space-5);
}

.trx-dialog__header {
  border-bottom: 1px solid var(--trx-color-border);
}

.trx-dialog__header h2,
.trx-dialog__body p {
  margin: 0;
}

.trx-dialog__header h2 {
  font-size: var(--trx-text-xl);
}

.trx-dialog__body p {
  color: var(--trx-color-text-muted);
}

.trx-dialog__actions {
  background: var(--trx-color-surface-subtle);
  display: flex;
  flex-wrap: wrap;
  gap: var(--trx-space-3);
  justify-content: flex-end;
}

@keyframes trx-spin {
  to { transform: rotate(360deg); }
}

@media (max-width: 520px) {
  .trx-address-control,
  .trx-payment-methods,
  .trx-quote__details {
    grid-template-columns: minmax(0, 1fr);
  }

  .trx-address-input {
    border-radius: var(--trx-radius-sm);
  }

  .trx-address-action {
    border: 1px solid var(--trx-color-border-strong);
    border-radius: var(--trx-radius-sm);
    margin-top: var(--trx-space-2);
  }

  .trx-quote__detail:nth-child(even) {
    border-left: 0;
  }

  .trx-dialog__actions,
  .trx-dialog__actions .trx-button {
    align-items: stretch;
    flex-direction: column;
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .trx-app *,
  .trx-app *::before,
  .trx-app *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
