/* MPYP public UI consistency layer
   Keeps forms/pages visually aligned without changing business logic. */

:root {
  --mpyp-control-height: 50px;
  --mpyp-card-gap: 22px;
  --mpyp-field-radius: 14px;
  --mpyp-card-padding: clamp(20px, 3.2vw, 30px);
}

/* ---------- baseline ---------- */
body.public-page,
body.home-page,
body.age-page {
  line-height: 1.55;
  -webkit-text-size-adjust: 100%;
}

body.public-page img,
body.home-page img { max-width: 100%; }

.public-page .public-shell,
.home-page .home-shell {
  min-width: 0;
}

.public-page .public-main {
  padding-top: clamp(30px, 5vw, 54px);
  padding-bottom: clamp(58px, 8vw, 90px);
}

.public-page .page-heading {
  margin-bottom: clamp(28px, 5vw, 42px);
}

.public-page .page-heading h1 {
  text-wrap: balance;
}

.public-page .page-heading p,
.public-page .soft-panel p,
.public-page .form-card p,
.public-page .success-card p {
  line-height: 1.6;
}

/* ---------- shared content cards ---------- */
.public-page .soft-panel,
.public-page .about-card,
.public-page .success-card,
.public-page .order-summary-card {
  border: 1px solid var(--line);
  border-radius: var(--site-radius, 24px);
  box-shadow: var(--site-shadow, 0 10px 28px rgba(70,35,50,.08));
}

.public-page .public-main > section + section,
.public-page .public-main > .soft-panel + .soft-panel,
.public-page .public-main > .form-card + .form-card {
  margin-top: var(--mpyp-card-gap);
}

.public-page section > h2:first-child,
.public-page .soft-panel > h2:first-child,
.public-page .form-card > h2:first-child,
.public-page .about-card > h2:first-child {
  margin-top: 0;
}

.public-page h2,
.public-page h3 {
  font-family: var(--rounded-font);
  line-height: 1.18;
  text-wrap: balance;
}

.public-page h2 { letter-spacing: -.35px; }

.public-page .help,
.public-page small,
.public-page .muted {
  line-height: 1.45;
}

/* ---------- form controls ---------- */
.public-page form {
  min-width: 0;
}

.public-page label {
  min-width: 0;
}

.public-page input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="color"]),
.public-page select,
.public-page textarea {
  display: block;
  width: 100% !important;
  max-width: 100%;
  min-width: 0;
  min-height: var(--mpyp-control-height);
  border: 1.5px solid var(--line) !important;
  border-radius: var(--mpyp-field-radius) !important;
  background: #fff;
  color: var(--ink);
  padding: 12px 14px !important;
  font: inherit;
  line-height: 1.35;
  box-shadow: none;
}

.public-page textarea {
  min-height: 130px;
  resize: vertical;
  line-height: 1.55;
}

.public-page select {
  cursor: pointer;
  padding-right: 38px !important;
}

.public-page input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="color"]):focus,
.public-page select:focus,
.public-page textarea:focus {
  outline: none;
  border-color: #e989ad !important;
  box-shadow: 0 0 0 4px rgba(230,85,138,.10) !important;
}

.public-page input::placeholder,
.public-page textarea::placeholder {
  color: #a5979e;
  opacity: 1;
}

.public-page .field-label,
.public-page form > label:not(.check-row):not(.radio-row):not(.type-option):not(.addon-check) {
  display: block;
  margin: 18px 0 7px;
  font-family: var(--rounded-font);
  font-weight: 800;
  line-height: 1.3;
}

.public-page .field-label:first-child { margin-top: 0; }

.public-page input[type="checkbox"],
.public-page input[type="radio"] {
  accent-color: var(--pink);
}

.public-page .check-row,
.public-page .radio-row,
.public-page .addon-check {
  line-height: 1.45;
}

/* File inputs need their own treatment so they do not look like raw browser UI. */
.public-page input[type="file"] {
  min-height: 58px;
  padding: 7px !important;
  color: var(--muted);
  background: var(--pink-softer);
  cursor: pointer;
}

.public-page input[type="file"]::file-selector-button {
  min-height: 40px;
  margin-right: 11px;
  padding: 9px 14px;
  border: 0;
  border-radius: 10px;
  background: var(--pink-soft);
  color: var(--ink);
  font: 800 14px/1 var(--rounded-font);
  cursor: pointer;
}

.public-page input[type="file"]::file-selector-button:hover {
  background: #f0d8e2;
}

/* ---------- buttons ---------- */
.public-page .btn,
.public-page button:not(.modal-close):not(.reaction):not(.queued-file-chip button) {
  min-height: 46px;
  max-width: 100%;
  padding: 11px 17px;
  border-radius: var(--site-button-radius, 999px);
  line-height: 1.2;
  text-align: center;
}

.public-page form .btn,
.public-page form button[type="submit"],
.public-page form button[type="button"] {
  margin-top: 16px;
}

.public-page .btn + .btn { margin-left: 6px; }

/* ---------- order portal ---------- */
.order-portal-page .order-portal-shell {
  width: min(900px, calc(100% - 30px));
}

.order-portal-page .order-summary-card,
.order-portal-page .form-card,
.order-portal-page .soft-panel {
  padding: var(--mpyp-card-padding) !important;
  overflow: visible;
}

.order-portal-page .order-summary-card,
.order-portal-page .form-card,
.order-portal-page .soft-panel {
  margin-bottom: 0;
}

.order-portal-page .form-card > h2,
.order-portal-page .soft-panel > h2,
.order-portal-page .order-summary-card h2 {
  margin: 0 0 8px;
  font-size: clamp(21px, 3vw, 27px);
}

.order-portal-page .form-card > p,
.order-portal-page .soft-panel > p {
  margin: 0 0 16px;
  color: var(--muted);
}

.order-portal-page .order-upload-card input[type="file"] {
  margin-top: 12px;
}

.order-portal-page .order-upload-card .help {
  margin: 9px 0 0;
}

.order-portal-page .order-contact-card form {
  margin-top: 18px;
}

.order-portal-page .order-detail-grid {
  gap: 12px;
}

.order-portal-page .order-detail-grid > div {
  min-width: 0;
}

/* ---------- commission / submission forms ---------- */
.form-page .form-card {
  overflow: hidden;
}

.form-page .form-section {
  padding: clamp(22px, 4vw, 32px) !important;
}

.form-page .form-section-title {
  margin-bottom: 20px;
}

.form-page .choice-box,
.form-page .reference-upload-box,
.form-page .commission-addon,
.form-page .commission-addon-panel,
.form-page .tip-panel,
.form-page .total-panel {
  min-width: 0;
}

.form-page .two-grid,
.form-page .commission-addon-grid,
.form-page .commission-addon-controls {
  min-width: 0;
}

/* ---------- public navigation ---------- */
.public-header-row {
  min-width: 0;
}

.public-nav a,
.public-logo {
  white-space: nowrap;
}

/* ---------- tables / wide content ---------- */
.public-page table {
  max-width: 100%;
}

.public-page .table-wrap,
.public-page .admin-table-wrap {
  max-width: 100%;
  overflow-x: auto;
}

/* ---------- accessibility / responsive ---------- */
@media (max-width: 760px) {
  .public-header { padding-top: 18px; }
  .public-header-row {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
  }
  .public-nav {
    width: 100%;
    justify-content: flex-start;
    gap: 5px;
  }
  .public-nav a { padding: 8px 10px; }

  .public-page input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="color"]),
  .public-page select,
  .public-page textarea {
    font-size: 16px;
  }

  .public-page .btn + .btn { margin-left: 0; }
  .order-portal-page .order-summary-card,
  .order-portal-page .form-card,
  .order-portal-page .soft-panel {
    padding: 20px !important;
  }
}

@media (max-width: 560px) {
  .public-page .public-shell,
  .order-portal-page .order-portal-shell {
    width: min(100% - 22px, 900px);
  }

  .public-page .page-heading h1 {
    font-size: clamp(36px, 12vw, 56px);
  }

  .form-page .form-section { padding: 20px 16px !important; }

  .form-page .two-grid,
  .form-page .commission-addon-grid,
  .form-page .commission-addon-controls {
    grid-template-columns: 1fr !important;
  }

  .public-page .btn,
  .public-page button:not(.modal-close):not(.reaction):not(.queued-file-chip button) {
    width: 100%;
  }
}
