/* ================================================================
   mm_p.css  –  Midori Media Purchase Form Styles
   Complements mm.css (load that first via ../styles/mm.css)
   FF56+ compatible: flexbox, custom properties, no gap shorthand
   ================================================================ */

/* ----------------------------------------------------------------
   Error / validation box
   ---------------------------------------------------------------- */
.form-errors {
  background: #fdecea;
  border: 2px solid var(--color-vermillion);
  border-radius: 4px;
  padding: 0.9rem 1rem;
  margin-bottom: 1.25rem;
  font-family: Verdana, Geneva, Tahoma, sans-serif;
  font-size: 0.875rem;
  color: var(--text-dark);
}

.form-errors p {
  margin-bottom: 0.4rem;
  color: var(--text-dark);
  font-weight: bold;
}

.form-errors ul {
  margin: 0;
  padding-left: 1.4rem;
}

.form-errors li {
  margin-bottom: 0.2rem;
}

/* ----------------------------------------------------------------
   Required field marker
   ---------------------------------------------------------------- */
.req {
  color: var(--color-vermillion);
  font-weight: bold;
  font-style: normal;
}

/* ----------------------------------------------------------------
   Section blocks
   ---------------------------------------------------------------- */
.pf-section {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 4px;
  -webkit-box-shadow: 0 1px 4px rgba(0,0,0,0.07);
          box-shadow: 0 1px 4px rgba(0,0,0,0.07);
  margin-bottom: 0.85rem;
  overflow: hidden;
}

.pf-section .pf-section-title {
  font-family: Verdana, Geneva, Tahoma, sans-serif;
  font-size: 0.9rem;
  font-weight: bold;
  color: #ffffff;
  background: var(--color-structural);
  margin: 0;
  padding: 0.45rem 0.75rem;
  border-left: none;
}

.pf-section-note {
  display: inline;
  font-size: 0.775rem;
  font-weight: normal;
  color: #ffffff;
  margin-left: 0.4rem;
}

/* ----------------------------------------------------------------
   Form table (label / field rows)
   ---------------------------------------------------------------- */
.pf-table {
  width: 100%;
  border-collapse: collapse;
  font-family: Verdana, Geneva, Tahoma, sans-serif;
  font-size: 0.875rem;
}

.pf-table tr {
  border-bottom: 1px solid var(--border);
}

.pf-table tr:last-child {
  border-bottom: none;
}

.content-area .pf-table th {
  background: #E6F1FB;
  color: #444444;
  font-weight: bold;
  text-align: left;
  vertical-align: top;
  padding: 0.55rem 0.75rem;
  width: 28%;
  white-space: nowrap;
}

.pf-table td {
  padding: 0.5rem 0.75rem;
  color: #444444;
  vertical-align: top;
}

/* Text inputs inside table */
.pf-table input[type="text"],
.pf-table select {
  width: 100%;
  max-width: 400px;
  padding: 0.4rem 0.5rem;
  font-family: Verdana, Geneva, Tahoma, sans-serif;
  font-size: 0.875rem;
  color: #1a1a1a;
  background: #ffffff;
  border: 1px solid #aaaaaa;
  border-radius: 4px;
  -webkit-box-sizing: border-box;
          box-sizing: border-box;
  -webkit-transition: border-color 0.2s;
          transition: border-color 0.2s;
}

.pf-table input[type="text"]:focus,
.pf-table select:focus {
  outline: none;
  border-color: var(--color-structural);
  -webkit-box-shadow: 0 0 0 2px rgba(0,114,178,0.15);
          box-shadow: 0 0 0 2px rgba(0,114,178,0.15);
}

.qty-input {
  width: 3rem !important;
  text-align: center;
}

.checkbox-label {
  display: -webkit-flex;
  display: flex;
  -webkit-align-items: flex-start;
          align-items: flex-start;
  cursor: pointer;
  font-size: 0.875rem;
  color: #444444;
}

.checkbox-label input[type="checkbox"] {
  margin-top: 0.15rem;
  margin-right: 0.5rem;
  -webkit-flex: 0 0 auto;
          flex: 0 0 auto;
}

.field-hint {
  display: block;
  font-size: 0.75rem;
  color: #666666;
  margin-top: 0.2rem;
}

.gst-note {
  color: var(--text-dark);
}

/* ----------------------------------------------------------------
   Item grid (replaces the old colspan table layout)
   ---------------------------------------------------------------- */
.pf-item-grid {
  font-family: Verdana, Geneva, Tahoma, sans-serif;
  font-size: 0.875rem;
}

.pf-item-header,
.pf-item-row,
.pf-total-row,
.pf-gst-row {
  display: -webkit-flex;
  display: flex;
  -webkit-align-items: center;
          align-items: center;
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--border);
}

.pf-item-header {
  background: var(--bg-pale);
  font-weight: bold;
  color: #444444;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.pf-item-row:last-child,
.pf-total-row {
  border-bottom: none;
}

.pf-total-row {
  background: var(--bg-pale);
  font-size: 0.9rem;
  border-top: 2px solid var(--border);
}

.pf-gst-row {
  background: var(--bg-pale);
  font-size: 0.8rem;
  color: var(--text-dark);
  padding-top: 0.35rem;
  padding-bottom: 0.35rem;
}

/* Column widths */
.pf-col-main  { -webkit-flex: 1; flex: 1; }
.pf-col-qty   { -webkit-flex: 0 0 5rem; flex: 0 0 5rem; text-align: center; }
.pf-col-unit  { -webkit-flex: 0 0 7rem; flex: 0 0 7rem; text-align: right; }
.pf-col-total { -webkit-flex: 0 0 7rem; flex: 0 0 7rem; text-align: right; }

.pf-note {
  display: block;
  font-size: 0.75rem;
  font-weight: normal;
  color: #666666;
  margin-top: 0.15rem;
}

/* ----------------------------------------------------------------
   Buttons
   ---------------------------------------------------------------- */

/* Visually hidden submit (default Enter-key trap) */
.btn-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  border: 0;
}

/* Shared Tier-1 button base: Continue, Cancel Purchase, Amend Details,
   Proceed to Secure Payment. Same size/weight for all — colour-coded
   by role via border, not by size. */
.btn {
  display: inline-block;
  font-family: Verdana, Geneva, Tahoma, sans-serif;
  font-size: 1rem;
  font-weight: bold;
  padding: 0.65rem 1.5rem;
  border-radius: 4px;
  border: 2px solid transparent;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  -webkit-transition: background 0.2s, border-color 0.2s;
          transition: background 0.2s, border-color 0.2s;
}

/* NEXT — Continue, Proceed to Secure Payment */
.btn-primary {
  background: var(--color-brand);
  color: #ffffff;
  border-color: var(--color-brand);
}

.btn-primary:hover,
.btn-primary:focus {
  background: var(--color-brand-hover);
  outline: none;
}

/* CHANGE — Amend Details (Tier 1), Change Licence / Update Total (Tier 2 via .btn-sm) */
.btn-secondary {
  background: #f4f4f4;
  color: #1a1a1a;
  border-color: var(--color-amber);
}

.btn-secondary:hover,
.btn-secondary:focus {
  background: #e8e8e8;
  outline: none;
}

/* CANCEL */
.btn-cancel {
  background: #f4f4f4;
  color: #1a1a1a;
  border-color: var(--color-vermillion);
}

.btn-cancel:hover,
.btn-cancel:focus {
  background: #e8e8e8;
  outline: none;
}

/* Tier 2 — small inline utility buttons (Change Licence, Update Total).
   Shrinks the shared .btn base; colour still comes from .btn-secondary. */
.btn-sm {
  font-size: 0.75rem !important;
  padding: 0.25rem 0.6rem !important;
  margin-left: 0.5rem;
  vertical-align: middle;
}

.btn-pay {
  display: block;
  width: 100%;
  background: var(--color-brand);
  color: #ffffff;
  border: none;
  font-family: Verdana, Geneva, Tahoma, sans-serif;
  font-size: 1rem;
  font-weight: bold;
  padding: 0.7rem 1rem;
  border-radius: 4px;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  -webkit-transition: background 0.2s;
          transition: background 0.2s;
}

.btn-pay:hover,
.btn-pay:focus {
  background: var(--color-brand-hover);
  color: #ffffff;
  outline: none;
  text-decoration: none;
}

/* ----------------------------------------------------------------
   Result boxes  (purchase_callback.asp / purchase_cancel.asp)
   Moved here from inline <style> blocks in each page.
   ---------------------------------------------------------------- */
.result-box {
  border-radius: 4px;
  padding: 1.1rem 1.25rem;
  margin-bottom: 1.25rem;
  font-family: Verdana, Geneva, Tahoma, sans-serif;
  font-size: 0.9rem;
}

.result-box p       { margin-bottom: 0.5rem; color: #444; }
.result-box p:last-child { margin-bottom: 0; }

.result-heading {
  font-family: Verdana, Geneva, Tahoma, sans-serif;
  font-size: 1.05rem;
  font-weight: bold;
  margin-bottom: 0.6rem;
}

.result-approved { background: #e3f5ef; border: 2px solid var(--color-brand); }
.result-approved .result-heading { color: var(--text-dark); }

.result-info     { background: #e8f0ff; border: 2px solid var(--color-structural); }
.result-info     .result-heading { color: var(--text-dark); }

.result-error    { background: #fff8e0; border: 2px solid var(--color-amber); }
.result-error    .result-heading { color: var(--text-dark); }

.result-cancelled { background: #fdecea; border: 2px solid var(--color-vermillion); }
.result-cancelled .result-heading { color: var(--text-dark); }

/* Email destination highlight in approved receipt */
.email-dest {
  font-family: Verdana, Geneva, Tahoma, sans-serif;
  font-size: 0.95rem;
  color: var(--text-dark);
  margin: 0.5rem 0;
}

/* Inline code (invoice ref, payment intent ID in receipt) */
code {
  font-family: 'Courier New', Courier, monospace;
  font-size: 0.85rem;
  color: var(--text-dark);
}

/* ----------------------------------------------------------------
   Licence selector  (purchase_scge.asp)
   Moved here from inline <style> block in purchase_scge.asp.
   ---------------------------------------------------------------- */
.licence-selector {
  display: -webkit-flex;
  display: flex;
  -webkit-flex-wrap: wrap;
          flex-wrap: wrap;
  margin-bottom: 1.25rem;
}

.licence-option {
  -webkit-flex: 1 1 200px;
          flex: 1 1 200px;
  border: 2px solid var(--border);
  border-radius: 4px;
  padding: 0.75rem 1rem;
  margin-right: 0.75rem;
  margin-bottom: 0.75rem;
  cursor: pointer;
  font-family: Verdana, Geneva, Tahoma, sans-serif;
  font-size: 0.875rem;
  color: #444444;
  -webkit-transition: border-color 0.2s, background 0.2s;
          transition: border-color 0.2s, background 0.2s;
}

.licence-option:last-child {
  margin-right: 0;
}

.licence-option.selected,
.licence-option:hover {
  border-color: var(--color-brand);
  background: #e3f5ef;
}

.licence-option input[type="radio"] {
  margin-right: 0.4rem;
}

.licence-option .price {
  font-weight: bold;
  color: var(--text-dark);
  display: block;
  margin-top: 0.2rem;
}

/* ----------------------------------------------------------------
   Licence list — single-column stacked layout (purchase_scge.asp)
   Replaces the two-card .licence-selector layout above for pages
   using the new stacked design. Scales to future products with
   longer descriptions or more licence tiers.
   ---------------------------------------------------------------- */
.licence-list {
  display: -webkit-flex;
  display: flex;
  -webkit-flex-direction: column;
          flex-direction: column;
  margin-bottom: 1.25rem;
  max-width: 640px;
}

.licence-row {
  display: -webkit-flex;
  display: flex;
  -webkit-flex-wrap: wrap;
          flex-wrap: wrap;
  -webkit-align-items: flex-start;
          align-items: flex-start;
  border: 2px solid var(--border);
  border-radius: 4px;
  padding: 0.75rem 1rem;
  margin-bottom: 0.75rem;
  cursor: pointer;
  font-family: Verdana, Geneva, Tahoma, sans-serif;
  font-size: 0.875rem;
  color: #444444;
  -webkit-transition: border-color 0.2s, background 0.2s;
          transition: border-color 0.2s, background 0.2s;
}

.licence-row:last-child {
  margin-bottom: 0;
}

.licence-row.selected,
.licence-row:hover {
  border-color: var(--color-brand);
  background: #e3f5ef;
}

.licence-row input[type="radio"] {
  margin-right: 0.6rem;
  margin-top: 0.15rem;
  -webkit-flex-shrink: 0;
          flex-shrink: 0;
}

.licence-row-main {
  display: -webkit-flex;
  display: flex;
  -webkit-flex: 1 1 auto;
          flex: 1 1 auto;
  -webkit-justify-content: space-between;
          justify-content: space-between;
  -webkit-align-items: baseline;
          align-items: baseline;
  -webkit-flex-wrap: wrap;
          flex-wrap: wrap;
  gap: 0.5rem;
}

.licence-title {
  font-weight: normal;
}

.licence-price {
  font-weight: bold;
  color: var(--text-dark);
  white-space: nowrap;
}

/* Optional secondary description line — only rendered in markup
   when a product supplies one, so it takes no space when absent. */
.licence-desc {
  -webkit-flex: 1 1 100%;
          flex: 1 1 100%;
  margin-left: 1.7rem;
  margin-top: 0.3rem;
  font-size: 0.8rem;
  color: #666666;
}

/* ----------------------------------------------------------------
   Two-line payment button (purchase_scge.asp)
   Only affects buttons that contain these child spans — the
   single-line Stripe button on purchase.asp (shares .btn-pay) is
   unaffected since it has no .btn-pay-line1/2 children.
   ---------------------------------------------------------------- */
.btn-pay-line1 {
  display: block;
}

.btn-pay-line2 {
  display: block;
  font-size: 0.95em;
  font-weight: normal;
  opacity: 0.9;
  margin-top: 0.2rem;
}

/* ----------------------------------------------------------------
   Payment section + order summary  (purchase_scge.asp)
   Moved here from inline <style> block in purchase_scge.asp.
   ---------------------------------------------------------------- */
.payment-section {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1rem 1.5rem 1.5rem;
  margin-bottom: 1.5rem;
  max-width: 640px;
}

.payment-section h3 {
  font-family: Verdana, Geneva, Tahoma, sans-serif;
  font-size: 1rem;
  font-weight: bold;
  color: var(--text-dark);
  margin: 0 0 0.75rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--border);
}

.order-summary {
  background: var(--bg-pale);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.75rem 1rem;
  margin-bottom: 1.25rem;
  font-family: Verdana, Geneva, Tahoma, sans-serif;
  font-size: 0.875rem;
  color: #444444;
}

.order-summary table {
  width: 100%;
  border-collapse: collapse;
}

.order-summary td {
  padding: 0.2rem 0;
  border: none;
  background: none;
}

.order-summary td:first-child {
  color: #666666;
  width: 45%;
  font-weight: bold;
}

.order-summary .total-row td {
  font-weight: bold;
  color: var(--text-dark);
  padding-top: 0.4rem;
  border-top: 1px solid var(--border);
}

/* Security / SSL assurance note */
.security-note {
  font-family: Verdana, Geneva, Tahoma, sans-serif;
  font-size: 0.775rem;
  color: #666666;
  margin-top: 0.75rem;
  display: -webkit-flex;
  display: flex;
  -webkit-align-items: flex-start;
          align-items: flex-start;
}

.security-note .lock-icon {
  margin-right: 0.4rem;
  color: var(--text-dark);
  font-size: 0.9rem;
  line-height: 1.4;
}

/* ----------------------------------------------------------------
   Form actions bar (OPF buttons)
   ---------------------------------------------------------------- */
.pf-actions {
  display: -webkit-flex;
  display: flex;
  -webkit-flex-wrap: wrap;
          flex-wrap: wrap;
  -webkit-align-items: center;
          align-items: center;
  padding: 0.75rem 0;
  margin-bottom: 1rem;
}

.pf-actions .btn,
.pf-actions button {
  margin-right: 0.75rem;
  margin-bottom: 0.4rem;
}

/* ----------------------------------------------------------------
   CDF actions bar (three separate forms side by side)
   ---------------------------------------------------------------- */
.pf-cdf-actions {
  display: -webkit-flex;
  display: flex;
  -webkit-flex-wrap: wrap;
          flex-wrap: wrap;
  -webkit-align-items: center;
          align-items: center;
  padding: 0.5rem 0;
  margin-bottom: 0.75rem;
}

.pf-cdf-actions form {
  margin-right: 0.75rem;
  margin-bottom: 0.4rem;
}

/* ----------------------------------------------------------------
   Important notes block
   ---------------------------------------------------------------- */
.pf-notes {
  background: var(--bg-pale);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.75rem 1rem;
  margin-bottom: 0.85rem;
  font-family: Verdana, Geneva, Tahoma, sans-serif;
  font-size: 0.825rem;
  color: #444444;
}

.pf-notes h3 {
  font-size: 0.875rem;
  font-weight: bold;
  color: var(--text-dark);
  margin-top: 0;
  margin-bottom: 0.5rem;
}

.pf-notes ul {
  margin: 0;
  padding-left: 1.4rem;
}

.pf-notes li {
  margin-bottom: 0.3rem;
  color: #444444;
}

/* ----------------------------------------------------------------
   RESPONSIVE
   ---------------------------------------------------------------- */

/* Tablet */
@media screen and (max-width: 800px) {
  .pf-col-unit {
    display: none;
  }
  .pf-col-qty  { -webkit-flex: 0 0 4rem; flex: 0 0 4rem; }
  .pf-col-total { -webkit-flex: 0 0 6rem; flex: 0 0 6rem; }

  .pf-table th {
    width: 35%;
    white-space: normal;
  }
}

/* Mobile */
@media screen and (max-width: 600px) {

  .pf-table {
    display: block;
  }

  .pf-table tr,
  .pf-table tbody {
    display: block;
  }

  .pf-table th,
  .pf-table td {
    display: block;
    width: 100%;
    padding: 0.4rem 0.75rem;
    white-space: normal;
  }

  .pf-table th {
    background: var(--bg-pale);
    padding-bottom: 0.2rem;
    border-bottom: none;
  }

  .pf-table td {
    padding-top: 0.2rem;
  }

  .pf-table input[type="text"],
  .pf-table select {
    max-width: 100%;
  }

  /* Item grid: stack on phone */
  .pf-item-header {
    display: none; /* hide column headings — context is clear */
  }

  .pf-item-row,
  .pf-total-row {
    -webkit-flex-direction: column;
            flex-direction: column;
    -webkit-align-items: flex-start;
            align-items: flex-start;
  }

  .pf-col-main,
  .pf-col-qty,
  .pf-col-unit,
  .pf-col-total {
    -webkit-flex: none;
            flex: none;
    width: 100%;
    text-align: left;
    display: block;
  }

  .pf-col-unit  { display: none; }

  .pf-col-qty::before   { content: "Qty: "; color: #666; font-weight: bold; }
  .pf-col-total::before { content: "Total: AUD "; color: #666; font-weight: bold; }

  .pf-cdf-actions {
    -webkit-flex-direction: column;
            flex-direction: column;
    -webkit-align-items: flex-start;
            align-items: flex-start;
  }

  .pf-cdf-actions form {
    width: 100%;
    margin-right: 0;
  }

  .pf-cdf-actions form .btn {
    width: 100%;
    text-align: center;
  }

  .pf-actions {
    -webkit-flex-direction: column;
            flex-direction: column;
    -webkit-align-items: flex-start;
            align-items: flex-start;
  }

  .pf-actions .btn,
  .pf-actions button {
    width: 100%;
    margin-right: 0;
    text-align: center;
  }

  /* Licence selector: stack on phone */
  .licence-option {
    -webkit-flex-basis: 100%;
            flex-basis: 100%;
    margin-right: 0;
  }

  /* Payment section: tighter padding on phone */
  .payment-section {
    padding: 1rem;
    max-width: 100%;
  }
}

/* ----------------------------------------------------------------
   Step indicator (purchase_scge.asp, purchase.asp, purchase_callback.asp)
   ---------------------------------------------------------------- */
.step-indicator {
  margin-bottom: 1.5rem;
}

.step-indicator ol {
  display: -webkit-flex;
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
  -webkit-flex-wrap: wrap;
          flex-wrap: wrap;
}

.step-indicator li {
  display: -webkit-flex;
  display: flex;
  -webkit-align-items: center;
          align-items: center;
  font-family: Verdana, Geneva, Tahoma, sans-serif;
  font-size: 0.8rem;
  color: #999999;
  white-space: nowrap;
}

.step-indicator li:not(:last-child)::after {
  content: "";
  display: inline-block;
  width: 2rem;
  height: 1px;
  background: var(--border);
  margin: 0 0.6rem;
}

.step-indicator .step-num {
  display: -webkit-inline-flex;
  display: inline-flex;
  -webkit-align-items: center;
          align-items: center;
  -webkit-justify-content: center;
          justify-content: center;
  width: 1.4rem;
  height: 1.4rem;
  border-radius: 50%;
  border: 1px solid var(--border);
  color: #999999;
  font-weight: bold;
  font-size: 0.75rem;
  margin-right: 0.4rem;
  -webkit-flex-shrink: 0;
          flex-shrink: 0;
}

.step-indicator li.step-done .step-num {
  background: var(--color-brand);
  border-color: var(--color-brand);
  color: #ffffff;
}

.step-indicator li.step-done {
  color: var(--color-brand);
}

.step-indicator li.step-current .step-num {
  background: #ffffff;
  border-color: var(--color-brand);
  border-width: 2px;
  color: var(--color-brand);
}

.step-indicator li.step-current {
  color: var(--color-brand);
  font-weight: bold;
}

.step-indicator li.step-error .step-num {
  background: #ffffff;
  border-color: var(--color-vermillion);
  border-width: 2px;
  color: var(--color-vermillion);
}

.step-indicator li.step-error {
  color: var(--color-vermillion);
  font-weight: bold;
}

.step-indicator li.step-info .step-num {
  background: #ffffff;
  border-color: var(--color-structural);
  border-width: 2px;
  color: var(--color-structural);
}

.step-indicator li.step-info {
  color: var(--color-structural);
  font-weight: bold;
}