.pct-hidden {
  display: none!important;
}
#pct-spinner {
  position: fixed;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255,255,255,0.8);
  z-index: 9999;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  max-width: 100%;
  display: flex;
}

.spinner {
  border: 16px solid #f3f3f3;
  border-top: 16px solid #3498db;
  border-radius: 50%;
  width: 120px;
  height: 120px;
  animation: spin 2s linear infinite, colorchange 6s linear infinite;
  margin-bottom: 20px;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes colorchange {
  0%   { border-top-color: #3498db; }
  33%  { border-top-color: #e74c3c; }
  66%  { border-top-color: #f1c40f; }
  100% { border-top-color: #3498db; }
}

/* ── Spinner wait message cycling ── */
.pat-wait-creating {
  margin: 0 0 6px;
  font-weight: 600;
}
.pat-wait-msg {
  overflow: hidden;
  height: 1.5em;
  line-height: 1.5;
  text-align: center;
}
.pat-wait-text {
  display: block;
}

/* ── Transformation form rows — label above input ── */
#pet-artwork-form .pct-row {
  display: flex !important;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  margin-bottom: 10px;
}
#pet-artwork-form .pct-label {
  font-weight: 600;
}
#pet-artwork-form .pct-input {
  width: 100%;
}
#pet-artwork-form .pct-input input[type="text"],
#pet-artwork-form .pct-input input[type="file"],
#pet-artwork-form .pct-input input[type="submit"],
#pet-artwork-form .pct-input select {
  width: 100%;
  box-sizing: border-box;
}

/* ── Checkbox rows: label and checkbox side by side ── */
#pet-artwork-form .pct-row-check {
  flex-direction: row;
  align-items: center;
  gap: 10px;
}
#pet-artwork-form .pct-row-check .pct-input {
  width: auto;
}

/* ── Turnstile CAPTCHA widget ── */
#pet-artwork-form .pct-row-turnstile {
  display: flex !important;
  align-items: center;
  justify-content: center !important;
}
#pet-artwork-form .pct-row-turnstile .cf-turnstile {
  flex: 0 0 auto;
}

/* ── Result image ── */
.pat-result-img {
  max-width: 100%;
  max-height: 480px;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0,0,0,.15);
  display: block;
  margin: 0 auto 20px;
}

/* ── Preview container: covers any BB content behind/below ── */
#preview {
  background: #fff;
  position: relative;
  z-index: 1;
}

/* ── Action bar below the result ── */
.pat-actions {
  max-width: 480px;
  margin: 0 auto;
  text-align: center;
  padding: 0 16px 40px;
}

/* ── Logged-in completion message ── */
.pat-complete-msg {
  font-size: 1.1rem;
  color: #222;
  margin-bottom: 16px;
  line-height: 1.5;
}

/* ── Send magic-link button (fl-button handles visual styling) ── */
.pat-btn-download {
  cursor: pointer;
  margin-bottom: 16px;
}

/* ── Share button ── */
.pat-btn-share {
  display: block;
  margin-top: 12px;
  color: #e07b39;
  font-weight: 600;
  text-decoration: none;
  font-size: 1rem;
}
.pat-btn-share:hover { text-decoration: underline; }

/* ── Login gate (guest) ── */
.pat-gate-msg {
  font-weight: 700;
  margin-bottom: 4px;
  color: #222;
}
.pat-gate-sub {
  color: #555;
  margin-bottom: 14px;
}
.pat-gate-email {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: 8px;
}
.pat-gate-email input[type="email"] {
  flex: 1 1 200px;
  padding: 12px 14px;
  border: 1px solid #ccc;
  border-radius: 4px;
  max-width: 260px;
}
.pat-turnstile-wrap {
  display: flex;
  justify-content: center;
  margin: 10px 0 4px;
}
.pat-turnstile-wrap .cf-turnstile {
  flex: 0 0 auto;
}
.pat-privacy-note {
  font-size: 0.78rem;
  color: #888;
  margin: 4px 0 0;
}
.pat-magic-status {
  min-height: 1.4em;
  margin: 4px 0 8px;
}
.pat-magic-status.pat-success { color: #2d8a4e; font-weight: 600; }
.pat-magic-status.pat-error   { color: #c0392b; }

.pat-gate-or {
  color: #888;
  margin: 12px 0;
}
.pat-btn-login {
  display: inline-block;
  background: #f0f0f0;
  color: #333 !important;
  padding: 11px 28px;
  border-radius: 4px;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid #ccc;
}
.pat-btn-login:hover { background: #e0e0e0; }

/* ─────────────────────────────────────────────────────────────────────────────
   Artwork share page  (/artwork/slug/)
───────────────────────────────────────────────────────────────────────────── */
.pat-share-page {
    max-width: 680px;
    margin: 40px auto;
    padding: 0 20px 60px;
    text-align: center;
    font-family: inherit;
}
.pat-share-image-wrap { margin-bottom: 24px; }
.pat-share-image {
    width: 100%;
    max-width: 600px;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 24px rgba(0,0,0,.15);
}
.pat-share-title {
    font-size: 1.6rem;
    margin-bottom: 12px;
}
.pat-share-style { font-weight: 400; color: #666; }
.pat-share-tagline {
    font-size: 1.1rem;
    color: #444;
    margin-bottom: 20px;
}

/* Share button column */
.pat-share-buttons {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    max-width: 360px;
    margin-left: auto;
    margin-right: auto;
}
/* Suppress stray <br> tags injected between shortcode outputs */
.pat-share-buttons br { display: none; }
/* Structural base for all share buttons */
.pat-share-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    cursor: pointer;
    width: 100%;
}
/* Facebook — keep blue; owns its own padding/radius since base no longer sets them */
.pat-share-btn--fb {
    background: #1877f2;
    color: #fff !important;
    padding: 10px;
    border-radius: 4px;
    font-weight: 600;
    text-decoration: none;
    border: none;
}
.pat-share-btn--fb:hover { background: #1464d0; color: #fff !important; }

/* Native share — fl-button-wrap handles layout */
.pat-share-btn--native svg { vertical-align: middle; }

.pat-share-btn--instagram {
    background: radial-gradient(circle at 30% 107%, #fdf497 0%, #fdf497 5%, #fd5949 45%, #d6249f 60%, #285AEB 90%);
    color: #fff !important;
}
.pat-share-btn--instagram:hover { opacity: .88; color: #fff !important; }

.pat-instagram-tip {
    color: #666;
    margin: -8px 0 12px;
    width: 100%;
}

/* Primary CTA (download) — fl-button-wrap handles layout */

/* Secondary CTA (create your own) */
.pat-share-cta--secondary {
    display: inline-block;
    background: #f0f0f0;
    color: #333 !important;
    padding: 12px 28px;
    border-radius: 4px;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    border: 1px solid #ccc;
    margin-left: 8px;
}
.pat-share-cta--secondary:hover { background: #e0e0e0; color: #333 !important; }

@media (max-width: 480px) {
    .pat-share-cta--secondary { display: block; margin: 0 0 10px; }
}

/* ─────────────────────────────────────────────────────────────────────────────
   Phase 4a: Ad zone layout
   .pat-layout = form + sidebar flex row
   .pat-main   = form column (stretches)
   .pat-sidebar = 160px skyscraper ad column (desktop only)
───────────────────────────────────────────────────────────────────────────── */
.pat-layout {
    display: flex;
    gap: 24px;
    align-items: flex-start;
}
.pat-main {
    flex: 1 1 0;
    min-width: 0;
}
.pat-sidebar {
    flex: 0 0 160px;
    width: 160px;
}

/* Keep ad containers from collapsing when empty */
#pat-ad-top,
#pat-ad-processing,
#pat-ad-result {
    min-height: 0;
}
#pat-ad-sidebar {
    min-height: 0;
    position: sticky;
    top: 24px;
}

/* Hide sidebar ad on mobile */
@media (max-width: 768px) {
    .pat-sidebar { display: none; }
}
