/* ==============================================================
   Request to Purchase Releasable Capacity
   --------------------------------------------------------------
   The HTML structure is intentionally identical to the legacy
   `public/trasco-cascade/RequestToPurchaseReleasableCapacity.html`
   (tables, document.write blocks, original ids/names). This file
   only ADDS styling on top of that markup so the form matches
   the approved design - no markup or business logic changes.
   ============================================================== */

body.rprc-page {
  margin: 0;
  padding: 6px 10px;
  background-color: transparent;

  /* Slightly tighter field height for this form */
  --input-height: 28px;
}

/* ==============================================================
   CARD HEADER (legacy WGPpgTitle from document.write)
   ============================================================== */

.rprc-page .WGPpgTitle {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: var(--color-text-dark);
}

/* ==============================================================
   CARD BODY OVERRIDES (legacy markup uses inline widths/colors)
   ============================================================== */

.rprc-page .card-body {
  padding: 16px 20px 20px;
}

/* The legacy markup wraps everything in `#forms` with an h4 intro */
.rprc-page #forms > h4 {
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text-secondary);
  margin: 0 0 14px 0;
  text-align: left !important;
}

/* ==============================================================
   LEGACY TABLE LAYOUT
   --------------------------------------------------------------
   The legacy form uses two <table bgcolor="#f4faff"> blocks and
   inline width:750px wrappers. We neutralize the bg/border and
   let the table fill the available width.
   ============================================================== */

.rprc-page #forms > div[style*="width: 750px"] {
  width: 100% !important;
  padding: 0 !important;
}

.rprc-page #forms table {
  width: 100%;
  background-color: transparent !important;
  border: 0 !important;
  border-collapse: separate;
  border-spacing: 0 6px;
}

.rprc-page #forms table tbody tr > td:first-child:empty,
.rprc-page #forms table tbody tr > td[style*="padding: 0px;"]:empty {
  display: none;
}

.rprc-page #forms table td {
  padding: 0 8px;
  vertical-align: middle;
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text-dark);
  line-height: 1.4;
}

/* Right-aligned label cells - render as bold left-aligned labels */
.rprc-page #forms table td[style*="text-align: right"] {
  text-align: left !important;
  width: 180px;
  padding-right: 12px;
  white-space: nowrap;
}

/* ==============================================================
   INPUTS / SELECTS
   ============================================================== */

.rprc-page #forms input[type="text"],
.rprc-page #forms input[type="email"],
.rprc-page #forms select {
  height: var(--input-height);
  width: 100%;
  max-width: 320px;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 400;
  font-family: var(--font-family);
  color: var(--color-text-dark);
  background-color: var(--color-input-bg);
  border: 1px solid var(--color-input-border);
  border-radius: var(--radius-sm);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  vertical-align: middle;
  box-sizing: border-box;
}

.rprc-page #forms input:focus,
.rprc-page #forms select:focus {
  border-color: var(--color-input-focus);
  box-shadow: 0 0 0 3px var(--color-input-focus-ring);
}

.rprc-page #forms select {
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%234e545a' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 28px;
}

/* ==============================================================
   PHONE FIELD
   --------------------------------------------------------------
   Legacy markup is:
     <input id="Phone"    name="Phone"    size="10" type="text" />
     <input id="PhoneExt" name="PhoneExt" size="4"  type="text" />
     (999-999-9999 | xxxx)
   We keep all three inline on the same row.
   ============================================================== */

.rprc-page #forms td:has(> input#Phone),
.rprc-page #forms td:has(> input#PhoneExt) {
  white-space: nowrap;
  font-size: 11px;
  font-weight: 400;
  color: var(--color-text-muted);
}

.rprc-page #forms input#Phone {
  width: 140px;
  max-width: 140px;
  display: inline-block;
}

.rprc-page #forms input#PhoneExt {
  width: 60px;
  max-width: 60px;
  display: inline-block;
  margin-left: 6px;
  margin-right: 6px;
}

/* Smaller numeric inputs (Max Rate, Daily Quantities, etc. - size="10") */
.rprc-page #forms input[size="10"]:not(#Phone) {
  width: 140px;
  max-width: 140px;
  display: inline-block;
}

/* Wide inputs in colspan=4 cells (Special Terms, Additional Info) */
.rprc-page #forms input[size="91"] {
  width: 100%;
  max-width: 100%;
}

/* Datepicker inputs */
.rprc-page #forms input#datepicker,
.rprc-page #forms input#zdatepicker {
  width: 160px;
  max-width: 160px;
  display: inline-block;
}

/* Checkbox styling (Firm Capacity Release / Secondary Capacity Release) */
.rprc-page #forms input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--color-primary);
  cursor: pointer;
  vertical-align: middle;
}

/* Special Terms / Additional Info wrapper cell */
.rprc-page #forms td[colspan="4"] {
  padding: 12px 8px 4px !important;
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text-dark);
  text-align: left !important;
  width: auto !important;
  white-space: normal !important;
}

.rprc-page #forms td[colspan="4"] p {
  margin: 6px 0;
  font-weight: 400;
}

.rprc-page #forms td[colspan="4"] p[style*="font-size: 11px"] {
  margin-top: 12px;
  font-weight: 600 !important;
  font-size: 12px !important;
  color: var(--color-text-dark) !important;
  font-family: var(--font-family) !important;
}

/* ==============================================================
   SUBMIT SECTION (#forms0)
   ============================================================== */

.rprc-page #forms0 {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--color-card-border);
}

.rprc-page #forms > div + div[style*="width: 750px"] {
  width: 100% !important;
}

.rprc-page #forms0 table {
  width: 100% !important;
  background-color: transparent !important;
  border: 0 !important;
  margin-bottom: 12px;
}

.rprc-page #forms0 table td {
  padding: 0 !important;
  border: 0 !important;
  font-size: 13px;
  color: var(--color-text-secondary);
  font-weight: 400;
}

.rprc-page #forms0 table td span,
.rprc-page #forms0 table td div {
  font-size: 13px !important;
  color: var(--color-text-dark);
  font-weight: 600;
}

.rprc-page #forms0 .g-recaptcha {
  margin: 12px 0;
}

/* SUBMIT FORM button */
.rprc-page #forms0 input[type="submit"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 30px;
  padding: 0 22px;
  font-size: 12px;
  font-weight: 600;
  font-family: var(--font-family);
  line-height: 1;
  color: #ffffff;
  background-color: var(--color-primary);
  border: 1px solid var(--color-primary);
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-transform: none;
  letter-spacing: 0.3px;
  transition: background-color 0.15s, box-shadow 0.15s, border-color 0.15s;
}

.rprc-page #forms0 input[type="submit"]:hover {
  background-color: var(--color-primary-dark);
  border-color: var(--color-primary-dark);
  box-shadow: 0 2px 6px rgba(0, 72, 144, 0.25);
}

.rprc-page #forms0 input[type="submit"]:active {
  transform: translateY(1px);
}

.rprc-page #forms0 p[align="left"] {
  margin: 12px 0 0 0;
  text-align: left !important;
}
