/* ============================================================
   Profile Submit – Frontend Form Styles  v1.2.0
   Uses --pa-* design tokens from person-directory-style.css (:root).
   All font sizes in px to match the site's own convention and avoid
   rem-scaling issues (the theme does not set html { font-size: 62.5% }).
   ============================================================ */

/* ── All --pa-* tokens come from person-directory-style.css (:root).
   No duplication needed — consume them directly. ─────────────────── */
.psubmit-page-wrap {
  font-family: inherit;
  color: var(--pa-text);
}

/* ── Layout overrides for the Bloglo Fullwidth page template ─────────
   The submit page uses template-bloglo-fullwidth.php which renders
   .bloglo-fullwidth-entry with NO .bloglo-container wrapper, so content
   is viewport-wide by default. We apply our own centering below.
   The theme's #primary adds margin-top:5rem / margin-bottom:7rem —
   zero those out to match profile pages. ──────────────────────────── */
.page-template-template-bloglo-fullwidth #primary {
  margin-top: 0 !important;
  margin-bottom: 0 !important;
}
.page-template-template-bloglo-fullwidth .bloglo-page-header {
  display: none !important;
}
.page-template-template-bloglo-fullwidth .bloglo-fullwidth-entry,
.page-template-template-bloglo-fullwidth .entry-content {
  padding: 0 !important;
  margin: 0 !important;
  max-width: 100% !important;
}

.psubmit-page-wrap {
  max-width: var(--pa-max-width);
  width: 100%;
  margin: 0 auto;
  padding: 0 24px 64px;
  box-sizing: border-box;
}

/* ── Breadcrumb (matches .paes-breadcrumbs exactly) ──────────────── */
.psubmit-breadcrumbs {
  font-size: 14px;
  color: var(--pa-text-light);
  padding: 18px 0 8px;
  font-family: inherit;
}
.psubmit-breadcrumbs a {
  color: var(--pa-text-muted);
  text-decoration: none;
  transition: color var(--pa-transition);
}
.psubmit-breadcrumbs a:hover { color: var(--pa-accent); }
.psubmit-bc-sep { margin: 0 7px; color: var(--pa-text-light); }
.psubmit-bc-current { color: var(--pa-text); font-weight: 500; }

/* ── Page hero header ────────────────────────────────────────────── */
.psubmit-hero {
  margin: 0 0 28px;
  padding: 36px 40px;
  background: var(--pa-surface);
  border: 1px solid var(--pa-border);
  border-radius: var(--pa-radius);
  box-shadow: 0 6px 18px rgba(44,40,37,0.06);
}
.psubmit-hero-inner {
  display: flex;
  align-items: center;
  gap: 20px;
}
.psubmit-hero-icon {
  flex-shrink: 0;
  width: 56px;
  height: 56px;
  background: var(--pa-accent-soft);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--pa-accent);
}
.psubmit-hero-icon svg { width: 26px; height: 26px; }
.psubmit-hero-text h1 {
  font-family: inherit;
  font-size: clamp(22px, 3vw, 30px);
  font-weight: 700;
  color: var(--pa-text);
  margin: 0 0 8px;
  line-height: 1.25;
  letter-spacing: -0.02em;
}
.psubmit-hero-text p {
  font-size: 15px;
  color: var(--pa-text-muted);
  margin: 0;
  line-height: 1.6;
}
.psubmit-hero-badge {
  margin-left: auto;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--pa-accent-soft);
  color: var(--pa-accent-dark);
  font-size: 12px;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 20px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}
.psubmit-hero-badge svg { width: 13px; height: 13px; }

/* ── Notices ─────────────────────────────────────────────────────── */
.psubmit-notice {
  padding: 14px 18px;
  border-radius: var(--pa-radius-xs);
  margin-bottom: 20px;
  font-size: 15px;
  font-weight: 500;
  border-left: 3px solid transparent;
  font-family: inherit;
}
.psubmit-notice--center {
  max-width: 760px;
  margin: 28px auto;
  padding: 24px 28px;
  text-align: center;
  font-size: 20px;
  font-weight: 700;
  border-left-width: 0;
  border-radius: 14px;
}
.psubmit-notice--success {
  background: #f0fdf4;
  border-color: #16a34a;
  color: #14532d;
}
.psubmit-notice--error {
  background: #fef2f2;
  border-color: #dc2626;
  color: #7f1d1d;
}
.psubmit-notice--info {
  background: var(--pa-accent-soft);
  border-color: var(--pa-accent);
  color: var(--pa-accent-dark);
}

/* ── Form body ───────────────────────────────────────────────────── */
#psubmit-form { margin-top: 0; }

/* ── Section card ────────────────────────────────────────────────── */
.psubmit-section {
  background: var(--pa-surface);
  border: 1px solid var(--pa-border);
  border-radius: var(--pa-radius);
  margin-bottom: 16px;
  overflow: hidden;
  box-shadow: var(--pa-shadow-sm);
  transition: box-shadow var(--pa-transition);
}
.psubmit-section:hover {
  box-shadow: var(--pa-shadow-md);
}
.psubmit-section--submitter {
  border-color: #c7d2fe;
  background: #f8f7ff;
}

/* ── Section header ──────────────────────────────────────────────── */
.psubmit-section-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 22px;
  cursor: pointer;
  user-select: none;
  background: var(--pa-surface-alt);
  border-bottom: 1px solid var(--pa-border-light);
  transition: background var(--pa-transition);
}
.psubmit-section-header:hover { background: var(--pa-accent-soft); }
.psubmit-section-header:focus-visible {
  outline: 2px solid var(--pa-accent);
  outline-offset: -2px;
}

.psubmit-section-icon {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: var(--pa-surface);
  border: 1px solid var(--pa-border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--pa-accent);
  transition: background var(--pa-transition), border-color var(--pa-transition);
}
.psubmit-section-icon svg { width: 16px; height: 16px; }
.psubmit-section-header:hover .psubmit-section-icon {
  background: var(--pa-accent);
  border-color: var(--pa-accent);
  color: #fff;
}

.psubmit-section-title {
  flex: 1;
  font-family: inherit;
  font-size: 16px;
  font-weight: 600;
  margin: 0;
  color: var(--pa-text);
  letter-spacing: -0.01em;
}

.psubmit-toggle-chevron {
  color: var(--pa-text-light);
  transition: transform 0.22s ease;
  flex-shrink: 0;
}
.psubmit-section-header[aria-expanded="false"] .psubmit-toggle-chevron {
  transform: rotate(-90deg);
}

/* ── Section body ────────────────────────────────────────────────── */
.psubmit-section-body {
  padding: 22px 24px;
  display: none;
}
.psubmit-section-body--open { display: block; }

.psubmit-section-desc {
  font-size: 14px;
  color: var(--pa-text-muted);
  margin: 0 0 18px;
  background: var(--pa-accent-soft);
  border-radius: var(--pa-radius-xs);
  padding: 10px 14px;
  border-left: 3px solid var(--pa-accent);
  line-height: 1.5;
}

/* ── Two-column field grid ───────────────────────────────────────── */
.psubmit-fields-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px 28px;
}
.psubmit-field--full { grid-column: 1 / -1; }

@media (max-width: 640px) {
  .psubmit-fields-grid { grid-template-columns: 1fr; }
  .psubmit-field--full { grid-column: 1; }
}

/* ── Individual field ────────────────────────────────────────────── */
.psubmit-field { display: flex; flex-direction: column; gap: 6px; }
.psubmit-field--photo { margin-top: 20px; }

.psubmit-label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--pa-text);
  font-family: inherit;
  line-height: 1.35;
}
.psubmit-req {
  color: var(--pa-accent);
  margin-left: 2px;
}
.psubmit-field-hint {
  font-size: 13px;
  color: var(--pa-text-light);
  line-height: 1.5;
}

/* ── Inputs ──────────────────────────────────────────────────────── */
.psubmit-input,
.psubmit-textarea,
.psubmit-select,
.psubmit-date {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--pa-border);
  border-radius: 10px;
  font-size: 15px;
  font-family: inherit;
  color: var(--pa-text);
  background: #fff;
  transition: border-color var(--pa-transition), box-shadow var(--pa-transition);
  appearance: none;
  line-height: 1.5;
}
.psubmit-input::placeholder,
.psubmit-textarea::placeholder { color: var(--pa-text-light); font-size: 15px; }
.psubmit-input:focus,
.psubmit-textarea:focus,
.psubmit-select:focus,
.psubmit-date:focus {
  outline: none;
  border-color: var(--pa-accent);
  box-shadow: 0 0 0 3px rgba(192,101,52,0.14);
}
.psubmit-input--error {
  border-color: #dc2626 !important;
  box-shadow: 0 0 0 3px rgba(220,38,38,0.12) !important;
}
.psubmit-textarea { resize: vertical; min-height: 100px; }
.psubmit-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='7'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%237a7470' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
  cursor: pointer;
}
.psubmit-date { cursor: pointer; }

/* ── Date dropdown group (Day / Month / Year) ───────────────────── */
.psubmit-date-group {
  display: grid;
  grid-template-columns: 1fr 1.4fr 1fr;
  gap: 10px;
}
.psubmit-date-group .psubmit-date-part {
  min-width: 0;
}

/* ── Photo upload ────────────────────────────────────────────────── */
.psubmit-photo-wrap {
  display: flex;
  align-items: flex-start;
  gap: 24px;
  flex-wrap: wrap;
}
.psubmit-photo-drop {
  width: 130px;
  height: 130px;
  border: 2px dashed var(--pa-border);
  border-radius: var(--pa-radius-sm);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  overflow: hidden;
  cursor: pointer;
  background: var(--pa-bg);
  position: relative;
  transition: border-color var(--pa-transition), background var(--pa-transition);
  flex-shrink: 0;
}
.psubmit-photo-drop:hover,
.psubmit-photo-drop--active {
  border-color: var(--pa-accent);
  background: var(--pa-accent-soft);
}
.psubmit-photo-drop-icon { color: var(--pa-text-light); }
.psubmit-photo-drop-icon svg { width: 30px; height: 30px; }
.psubmit-photo-drop-label {
  font-size: 12px;
  color: var(--pa-text-muted);
  text-align: center;
  padding: 0 8px;
  line-height: 1.4;
  pointer-events: none;
}
.psubmit-photo-preview-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: calc(var(--pa-radius-sm) - 2px);
  display: none;
}
.psubmit-file-input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}
.psubmit-photo-info {
  display: flex;
  flex-direction: column;
  gap: 8px;
  justify-content: flex-start;
  align-items: flex-start;
  padding-top: 4px;
}
.psubmit-photo-info-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--pa-text);
  margin: 0;
}
/* Use high-specificity selector to override theme's
   .entry-content ul li and .bloglo-entry ul rules */
.psubmit-page-wrap .psubmit-photo-info-hint {
  font-size: 14px;
  color: var(--pa-text-muted);
  line-height: 1.6;
  padding: 0 !important;
  margin: 0 !important;
  list-style: none !important;
  margin-left: 0 !important;
}
.psubmit-page-wrap .psubmit-photo-info-hint li {
  list-style: none !important;
  padding-left: 0 !important;
  margin-bottom: 4px !important;
  margin-left: 0 !important;
  display: flex !important;
  align-items: baseline;
  gap: 6px;
}
.psubmit-page-wrap .psubmit-photo-info-hint li::before {
  content: '✓';
  color: var(--pa-accent);
  font-weight: 700;
  font-size: 13px;
  flex-shrink: 0;
}
#psubmit-photo-name {
  font-size: 13px;
  color: var(--pa-accent-dark);
  font-weight: 500;
  display: none;
}

/* ── Repeater ────────────────────────────────────────────────────── */
.psubmit-repeater { display: flex; flex-direction: column; gap: 8px; }
.psubmit-repeater-row {
  display: flex;
  gap: 8px;
  align-items: center;
}
.psubmit-repeater-row .psubmit-input { flex: 1; }

.psubmit-remove-row {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--pa-border);
  background: var(--pa-surface-alt);
  color: var(--pa-text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  line-height: 1;
  transition: background var(--pa-transition), color var(--pa-transition), border-color var(--pa-transition);
}
.psubmit-remove-row:hover {
  background: #fef2f2;
  color: #dc2626;
  border-color: #fca5a5;
}

.psubmit-add-row {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  background: transparent;
  border: 1px dashed var(--pa-accent);
  border-radius: var(--pa-radius-xs);
  color: var(--pa-accent);
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background var(--pa-transition);
  margin-top: 2px;
}
.psubmit-add-row svg { width: 13px; height: 13px; }
.psubmit-add-row:hover { background: var(--pa-accent-soft); }

/* ── GDPR consent ────────────────────────────────────────────────── */
.psubmit-consent-row {
  background: var(--pa-surface-alt);
  border: 1px solid var(--pa-border);
  border-radius: var(--pa-radius-sm);
  padding: 18px 20px;
  margin: 24px 0 0;
}
.psubmit-consent-label {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  font-size: 14px;
  color: var(--pa-text-muted);
  cursor: pointer;
  line-height: 1.6;
}
.psubmit-consent-label input[type="checkbox"] {
  flex-shrink: 0;
  margin-top: 2px;
  width: 18px;
  height: 18px;
  accent-color: var(--pa-accent);
  cursor: pointer;
}
.psubmit-turnstile-row {
  margin-top: 14px;
}

/* ── Submit row ──────────────────────────────────────────────────── */
.psubmit-submit-row {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 20px;
  flex-wrap: wrap;
}
.psubmit-submit-note {
  font-size: 13px;
  color: var(--pa-text-light);
  display: flex;
  align-items: center;
  gap: 5px;
}
.psubmit-submit-note svg { width: 14px; height: 14px; color: var(--pa-accent); }

/* ── Primary button ──────────────────────────────────────────────── */
.psubmit-btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--pa-accent);
  color: #fff;
  border: none;
  border-radius: 50px;
  padding: 14px 30px;
  font-size: 16px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: background var(--pa-transition), transform 0.1s ease, box-shadow var(--pa-transition);
  box-shadow: 0 2px 8px rgba(192,101,52,0.25);
  letter-spacing: 0.01em;
}
#psubmit-submit-btn {
  border-radius: 50px;
}
.psubmit-btn-primary svg { width: 18px; height: 18px; }
.psubmit-btn-primary:hover {
  background: var(--pa-accent-dark);
  box-shadow: 0 4px 14px rgba(192,101,52,0.35);
}
.psubmit-btn-primary:active { transform: scale(0.98); }
.psubmit-btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}
.psubmit-btn-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255,255,255,0.45);
  border-top-color: #fff;
  border-radius: 50%;
  animation: psubmit-spin 0.7s linear infinite;
}
@keyframes psubmit-spin { to { transform: rotate(360deg); } }

/* ── Required / Optional badge on section headers ────────────────── */
.psubmit-req-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 10px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.psubmit-req-badge--required {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
}
.psubmit-req-badge--optional {
  background: var(--pa-surface-alt);
  color: var(--pa-text-light);
  border: 1px solid var(--pa-border);
}

/* ── Responsive ──────────────────────────────────────────────────── */
@media (max-width: 860px) {
  .psubmit-page-wrap { padding: 0 16px 48px; }
  .psubmit-hero { padding: 24px 20px; }
  .psubmit-hero-badge { display: none; }
}
@media (max-width: 600px) {
  .psubmit-section-body { padding: 16px; }
  .psubmit-btn-primary { width: 100%; justify-content: center; }
  .psubmit-submit-row { flex-direction: column; align-items: flex-start; }
  .psubmit-hero-text h1 { font-size: 22px; }
  .psubmit-section-title { font-size: 15px; }
}
