/*
 * Go PH Common UI — canonical repeated controls/cards
 * Shared by public page families. Page-specific CSS may extend these classes,
 * but must not redefine their base geometry, typography, borders, or spacing.
 */

:root {
  --goph-ui-control-h: 48px;
  --goph-page-gutter: clamp(16px, 3vw, 32px);
  --goph-content-max: 1120px;
  --goph-ui-radius: 12px;
  --goph-ui-gap: 12px;
  --goph-ui-border: var(--goph-line);
  --goph-ui-text: var(--goph-ink);
  --goph-ui-muted: #5d6b7d;
}

.goph-field {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.goph-field__label {
  color: var(--goph-ui-text);
  font-size: .9375rem;
  font-weight: 600;
  line-height: 1.35;
}

.goph-input,
.goph-select,
.goph-textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--goph-ui-border);
  border-radius: var(--goph-ui-radius);
  background: #fff;
  color: var(--goph-ui-text);
  font: inherit;
  line-height: 1.4;
  outline: none;
}

.goph-input,
.goph-select { min-height: var(--goph-ui-control-h); padding: 11px 14px; }

.goph-textarea {
  min-height: 120px;
  padding: 12px 14px;
  resize: vertical;
}

.goph-input:focus-visible,
.goph-select:focus-visible,
.goph-textarea:focus-visible {
  border-color: #0b5fbd;
  box-shadow: 0 0 0 3px rgba(11,95,189,.16);
}

.goph-field__hint,
.goph-field__error {
  font-size: .8125rem;
  line-height: 1.4;
}

.goph-field__hint { color: var(--goph-ui-muted); }
.goph-field__error { color: #b42318; }

.goph-card {
  min-width: 0;
  border: 1px solid var(--goph-ui-border);
  border-radius: 16px;
  background: #fff;
  overflow: hidden;
}

.goph-card__body { padding: 20px; }
.goph-card__title {
  margin: 0;
  color: var(--goph-ui-text);
  font-weight: 700;
  line-height: 1.3;
}
.goph-card__text {
  margin: 6px 0 0;
  color: #27384e;
  line-height: 1.55;
}

@media (max-width: 767px) {
  .goph-card__body { padding: 16px; }
}


/* Canonical action + form-state system — v3.08.0 */
:root {
  --goph-ui-primary: var(--goph-navy);
  --goph-ui-primary-hover: #08234d;
  --goph-ui-success: var(--goph-green);
  --goph-ui-success-bg: #ecfdf3;
  --goph-ui-success-border: #a7f3d0;
  --goph-ui-danger: var(--goph-red);
  --goph-ui-danger-bg: #fef3f2;
  --goph-ui-danger-border: #fecdca;
  --goph-ui-warning: #a15c00;
  --goph-ui-warning-bg: #fffaeb;
  --goph-ui-warning-border: #fedf89;
  --goph-ui-info: #075985;
  --goph-ui-info-bg: #eff8ff;
  --goph-ui-info-border: #b2ddff;
}

/* Buttons: one public contract for links and button elements. */
.goph-btn,
button.goph-btn,
a.goph-btn {
  box-sizing: border-box;
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 18px;
  border: 1px solid transparent;
  border-radius: var(--goph-ui-radius);
  font: inherit;
  font-weight: 700;
  line-height: 1.25;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: background-color .16s ease, border-color .16s ease, box-shadow .16s ease, transform .16s ease, opacity .16s ease;
}
.goph-btn:hover { transform: translateY(-1px); }
.goph-btn:active { transform: translateY(0); }
.goph-btn:focus-visible,
.goph-input:focus-visible,
.goph-select:focus-visible,
.goph-textarea:focus-visible,
.goph-choice:focus-within {
  outline: 3px solid rgba(11,95,189,.18);
  outline-offset: 2px;
}
.goph-btn-primary { background: var(--goph-ui-primary); color: #fff; box-shadow: 0 8px 20px rgba(11,45,98,.16); }
.goph-btn-primary:hover { background: var(--goph-ui-primary-hover); }
.goph-btn-secondary { background: #fff; color: var(--goph-ui-primary); border-color: #b8c6d6; }
.goph-btn-secondary:hover { background: #f8fafc; border-color: #94a3b8; }
.goph-btn-light { background: #f1f5f9; color: var(--goph-ui-primary); border-color: #e2e8f0; }
.goph-btn-light:hover { background: #e2e8f0; }
.goph-btn-success,
.goph-btn-green { background: var(--goph-ui-success); color: #fff; }
.goph-btn-success:hover,
.goph-btn-green:hover { background: #166534; }
.goph-btn-danger,
.goph-btn-red { background: #dc2626; color: #fff; box-shadow: 0 8px 20px rgba(220,38,38,.14); }
.goph-btn-danger:hover,
.goph-btn-red:hover { background: #b91c1c; }
.goph-btn-outline { background: #fff; color: var(--goph-ui-primary); border-color: var(--goph-ui-primary); }
.goph-btn-outline:hover { background: #eff6ff; }
.goph-btn-ghost { background: transparent; color: var(--goph-ui-primary); border-color: transparent; }
.goph-btn-ghost:hover { background: #f1f5f9; }
.goph-btn-sm { min-height: 40px; padding: 9px 14px; border-radius: 10px; font-size: .875rem; }
.goph-btn-lg { min-height: 52px; padding: 14px 20px; }
.goph-btn-pill { border-radius: 999px; }
.goph-btn-block { width: 100%; }
.goph-btn:disabled,
.goph-btn[aria-disabled="true"] { opacity: .58; cursor: not-allowed; transform: none; box-shadow: none; }
.goph-btn[data-loading="true"] { cursor: wait; }
.goph-btn[data-loading="true"]::after {
  content: "";
  width: 15px;
  height: 15px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: goph-spin .7s linear infinite;
}
@keyframes goph-spin { to { transform: rotate(360deg); } }

/* Form controls and validation states. */
.goph-input,
.goph-select,
.goph-textarea,
.goph-form__control {
  transition: border-color .16s ease, box-shadow .16s ease, background-color .16s ease;
}
.goph-input:disabled,
.goph-select:disabled,
.goph-textarea:disabled,
.goph-form__control:disabled { background: #f8fafc; color: #64748b; cursor: not-allowed; }
.goph-input[aria-invalid="true"],
.goph-select[aria-invalid="true"],
.goph-textarea[aria-invalid="true"],
.goph-form__control[aria-invalid="true"] { border-color: #dc2626; }
.goph-input[aria-invalid="true"]:focus-visible,
.goph-select[aria-invalid="true"]:focus-visible,
.goph-textarea[aria-invalid="true"]:focus-visible,
.goph-form__control[aria-invalid="true"]:focus-visible { box-shadow: 0 0 0 3px rgba(220,38,38,.14); }
.goph-field:has([aria-invalid="true"]) .goph-field__label { color: var(--goph-ui-danger); }
.goph-field__error { color: var(--goph-ui-danger); }
.goph-field__error[hidden] { display: none; }

/* One message component; state is expressed by data-state, not ad-hoc Tailwind colors. */
.goph-form__message,
[data-form-message] {
  box-sizing: border-box;
  display: block;
  margin-top: 12px;
  padding: 12px 14px;
  border: 1px solid transparent;
  border-radius: var(--goph-ui-radius);
  font-size: .875rem;
  line-height: 1.55;
}
.goph-form__message[hidden],
[data-form-message][hidden] { display: none; }
.goph-form__message[data-state="success"],
[data-form-message][data-state="success"] { background: var(--goph-ui-success-bg); color: #166534; border-color: var(--goph-ui-success-border); }
.goph-form__message[data-state="error"],
[data-form-message][data-state="error"] { background: var(--goph-ui-danger-bg); color: #991b1b; border-color: var(--goph-ui-danger-border); }
.goph-form__message[data-state="warning"],
[data-form-message][data-state="warning"] { background: var(--goph-ui-warning-bg); color: #854d0e; border-color: var(--goph-ui-warning-border); }
.goph-form__message[data-state="info"],
[data-form-message][data-state="info"] { background: var(--goph-ui-info-bg); color: var(--goph-ui-info); border-color: var(--goph-ui-info-border); }
.goph-form__message[data-state="loading"],
[data-form-message][data-state="loading"] { background: #f8fafc; color: #475569; border-color: #dbe3ec; }
.goph-form__message a { color: inherit; font-weight: 700; text-decoration: underline; }
.goph-form__message strong { font-weight: 800; }

/* Success/error message may contain a compact action without changing geometry. */
.goph-form__message-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; }

@media (max-width: 639px) {
  .goph-btn:not(.goph-btn-sm) { min-height: 48px; }
  .goph-form__message,
  [data-form-message] { padding: 11px 13px; }
}
@media (prefers-reduced-motion: reduce) {
  .goph-btn,
  .goph-input,
  .goph-select,
  .goph-textarea,
  .goph-form__control { transition: none; }
  .goph-btn:hover { transform: none; }
  .goph-btn[data-loading="true"]::after { animation: none; }
}


/* Shared icon and phone-select primitives. */
.goph-svg-icon { display: block; flex: 0 0 auto; overflow: visible; color: currentColor; }
.goph-icon { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; background: #eef5ff; color: var(--goph-ui-primary, #0b2d62); }
.goph-icon > .goph-svg-icon, .goph-icon img { width: 25px; height: 25px; }
.goph-icon.goph-icon-active { background: #eaf2ff; }
.goph-phone-country-select, select[name="phone_country_code"], select[name="recipient_phone_country_code"] { min-height: var(--goph-ui-control-h, 48px); }
