/* Premju għall-Arti Voting Plugin — Frontend Styles */

.pv-widget {
  --pv-gold: #1B1F4E;
  --pv-gold-light: #F5EDD4;
  --pv-gold-dark: #111D4F;
  --pv-ink: #1A1612;
  --pv-ink-mid: #4A3F33;
  --pv-ink-muted: #8A7D6E;
  --pv-surface: #FDFAF5;
  --pv-surface-2: #F5EDD4;
  --pv-border: rgba(201, 168, 76, 0.25);
  --pv-border-str: rgba(201, 168, 76, 0.55);
  --pv-green: #2E6B44;
  --pv-green-light: #E3F2EA;
  --pv-red: #B03A2A;
  --pv-red-light: #FBEAE8;
  --pv-radius: 10px;
  --pv-radius-lg: 16px;

  font-family: Georgia, 'Times New Roman', serif;
  color: var(--pv-ink);
  max-width: 600px;
  margin: 0 auto;
  padding: 1.5rem 0;
  box-sizing: border-box;
}

.pv-widget *,
.pv-widget *::before,
.pv-widget *::after {
  box-sizing: border-box;
}

/* ── Header ─────────────────────────────────────────────────────── */
.pv-header {
  text-align: center;
  margin-bottom: 1.75rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--pv-gold);
}

.pv-eyebrow {
  font-family: Arial, sans-serif;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--pv-gold-dark);
  margin: 0 0 0.5rem;
}

.pv-title {
  font-size: 26px;
  font-weight: normal;
  margin: 0 0 0.3rem;
}

.pv-title em {
  font-style: italic;
  color: var(--pv-gold-dark);
}

.pv-subtitle {
  font-family: Arial, sans-serif;
  font-size: 13px;
  color: var(--pv-ink-muted);
  margin: 0;
}

/* ── Step nav ───────────────────────────────────────────────────── */
.pv-step-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  margin-bottom: 1.5rem;
}

.pv-step-item {
  display: flex;
  align-items: center;
  gap: 7px;
  font-family: Arial, sans-serif;
  font-size: 12px;
  color: var(--pv-ink-muted);
}

.pv-step-item.pv-active {
  color: var(--pv-gold-dark);
}

.pv-step-item.pv-done {
  color: var(--pv-green);
}

.pv-step-num {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 1.5px solid currentColor;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: bold;
  flex-shrink: 0;
}

.pv-step-item.pv-done .pv-step-num {
  background: var(--pv-green);
  border-color: var(--pv-green);
  color: white;
}

.pv-step-item.pv-active .pv-step-num {
  background: var(--pv-gold);
  border-color: var(--pv-gold);
  color: white;
}

.pv-step-divider {
  width: 28px;
  height: 1px;
  background: var(--pv-border-str);
  margin: 0 5px;
  flex-shrink: 0;
}

/* ── Cards ──────────────────────────────────────────────────────── */
.pv-card {
  background: white;
  border: 1px solid var(--pv-gold);
  border-radius: var(--pv-radius-lg);
  padding: 1.5rem;
  box-shadow: 0 2px 16px rgba(26, 22, 18, 0.07);
  margin-bottom: 1rem;
}

.pv-label {
  font-family: Arial, sans-serif;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--pv-gold-dark);
  margin: 0 0 0.4rem;
}

.pv-card-title {
  font-size: 19px;
  font-weight: normal;
  margin: 0 0 0.4rem;
}

.pv-card-desc {
  font-family: Arial, sans-serif;
  font-size: 13px;
  color: var(--pv-ink-muted);
  margin: 0 0 1.25rem;
  line-height: 1.6;
}

/* ── Steps ──────────────────────────────────────────────────────── */
.pv-step {
  display: none;
}

.pv-step.pv-step-active {
  display: block;
}

/* ── Name / email fields ────────────────────────────────────────── */
.pv-field-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 14px;
}

.pv-field {
  margin-bottom: 14px;
}

.pv-field-grid .pv-field {
  margin-bottom: 0;
}

.pv-field label {
  display: block;
  font-family: Arial, sans-serif;
  font-size: 13px;
  color: var(--pv-ink-mid);
  margin-bottom: 6px;
}

.pv-field input {
  width: 100%;
  height: 44px;
  border: 1.5px solid var(--pv-border-str);
  border-radius: var(--pv-radius);
  padding: 0 14px;
  font-family: Arial, sans-serif;
  font-size: 15px;
  background: var(--pv-surface);
  color: var(--pv-ink);
  outline: none;
  transition: border-color 0.15s;
}

.pv-field input:focus {
  border-color: var(--pv-gold);
}

.pv-field input.pv-error {
  border-color: var(--pv-red);
  background: var(--pv-red-light);
}

/* ── Privacy notice / newsletter opt-in ────────────────────────────*/
.pv-privacy-notice {
  margin-top: 1rem;
  padding: 14px 16px;
  background: var(--pv-surface);
  border: 1px solid var(--pv-border);
  border-radius: var(--pv-radius);
  font-family: Arial, sans-serif;
  font-size: 11.5px;
  line-height: 1.6;
  color: var(--pv-ink-muted);
  max-width: 100%;
  overflow-wrap: break-word;
  word-break: break-word;
}

/* The notice body is admin-editable WYSIWYG content rendered inside the
   theme's page content area — themes commonly reset "p { margin: 0 }" or
   similar at a matching specificity, which (depending on stylesheet load
   order) can collapse all the paragraphs into one run-on block. !important
   is deliberate here to guarantee this box always reads as separate
   paragraphs, regardless of the active theme. */
.pv-privacy-notice p {
  display: block !important;
  margin: 0 0 8px !important;
  max-width: 100%;
  overflow-wrap: break-word;
  word-break: break-word;
  font-size: 14px;
}

.pv-privacy-notice p:last-of-type {
  margin-bottom: 10px !important;
}

.pv-privacy-title,
.pv-privacy-subtitle,
.pv-privacy-notice strong {
  font-weight: bold !important;
  color: var(--pv-ink-mid);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 11px;
}

.pv-privacy-notice strong {
  font-size: 16px;
}

.pv-privacy-subtitle {
  margin-top: 12px !important;
}

.pv-privacy-notice p:has(> strong:only-child) {
  margin-top: 12px !important;
}

.pv-privacy-notice p:first-child {
  margin-top: 0 !important;
}

.pv-privacy-notice a {
  color: var(--pv-gold-dark);
  overflow-wrap: break-word;
  word-break: break-word;
}

.pv-privacy-notice ul,
.pv-privacy-notice ol {
  display: block !important;
  margin: 0 0 8px !important;
  padding-left: 1.2em;
}

.pv-privacy-notice li {
  display: list-item !important;
}

.pv-privacy-notice br {
  display: block !important;
  content: "";
  margin-top: 6px;
}

.pv-checkbox-row {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  cursor: pointer;
  margin: 0;
}

.pv-checkbox-row input[type="checkbox"] {
  flex-shrink: 0;
  width: 15px;
  height: 15px;
  margin-top: 2px;
  accent-color: var(--pv-gold);
}

.pv-checkbox-row span {
  font-family: Arial, sans-serif;
  font-size: 14px;
  line-height: 15px;
  color: var(--pv-ink-muted);
}

/* ── ID Field ───────────────────────────────────────────────────── */
.pv-id-field label {
  display: block;
  font-family: Arial, sans-serif;
  font-size: 13px;
  color: var(--pv-ink-mid);
  margin-bottom: 6px;
}

.pv-id-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.pv-id-row input {
  flex: 1;
  min-width: 140px;
  height: 44px;
  border: 1.5px solid var(--pv-border-str);
  border-radius: var(--pv-radius);
  padding: 0 14px;
  font-family: Arial, sans-serif;
  font-size: 15px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: var(--pv-surface);
  color: var(--pv-ink);
  outline: none;
  transition: border-color 0.15s;
}

.pv-id-row input:focus {
  border-color: var(--pv-gold);
}

.pv-id-row input.pv-error {
  border-color: var(--pv-red);
  background: var(--pv-red-light);
}

/* ── Buttons ────────────────────────────────────────────────────── */
.pv-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 44px;
  padding: 0 18px;
  border-radius: var(--pv-radius);
  border: 1.5px solid var(--pv-gold);
  background: transparent;
  color: var(--pv-ink-mid);
  font-family: Arial, sans-serif;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}

.pv-btn:hover {
  background: var(--pv-surface-2);
  border-color: var(--pv-gold);
}

.pv-btn-primary {
  background: var(--pv-gold);
  border-color: var(--pv-gold);
  color: white;
}

.pv-btn-primary:hover {
  background: var(--pv-gold-dark);
  border-color: var(--pv-gold-dark);
}

.pv-btn-primary:disabled {
  background: var(--pv-surface-2);
  border-color: var(--pv-border);
  color: var(--pv-ink-muted);
  cursor: not-allowed;
}

.pv-btn-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 1.25rem;
  gap: 10px;
  flex-wrap: wrap;
}

/* ── Notice ─────────────────────────────────────────────────────── */
.pv-notice {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  background: var(--pv-gold-light);
  border: 1px solid var(--pv-border-str);
  border-radius: var(--pv-radius);
  padding: 12px 14px;
  margin-top: 1rem;
  font-family: Arial, sans-serif;
  font-size: 12px;
  color: var(--pv-ink-mid);
  line-height: 1.5;
}

.pv-notice-icon {
  font-size: 15px;
  flex-shrink: 0;
  margin-top: 1px;
}

/* ── Error / status ─────────────────────────────────────────────── */
.pv-error-text {
  font-family: Arial, sans-serif;
  font-size: 12px;
  color: var(--pv-red);
  margin: 7px 0 0;
}

.pv-api-status {
  display: none;
  padding: 10px 14px;
  border-radius: var(--pv-radius);
  font-family: Arial, sans-serif;
  font-size: 13px;
  margin-bottom: 1rem;
}

.pv-api-status.pv-error {
  display: block;
  background: var(--pv-red-light);
  border: 1px solid rgba(176, 58, 42, 0.3);
  color: var(--pv-red);
}

.pv-api-status.pv-success {
  display: block;
  background: var(--pv-green-light);
  border: 1px solid rgba(46, 107, 68, 0.3);
  color: var(--pv-green);
}

/* ── Loading ────────────────────────────────────────────────────── */
.pv-loading-indicator {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: Arial, sans-serif;
  font-size: 14px;
  color: var(--pv-ink-muted);
}

.pv-spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid var(--pv-border-str);
  border-top-color: var(--pv-gold);
  border-radius: 50%;
  animation: pv-spin 0.7s linear infinite;
}

@keyframes pv-spin {
  to {
    transform: rotate(360deg);
  }
}

/* ── Progress ───────────────────────────────────────────────────── */
.pv-progress-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 6px;
}

.pv-progress-label {
  font-family: Arial, sans-serif;
  font-size: 12px;
  color: var(--pv-ink-muted);
}

.pv-progress-pct {
  font-family: Arial, sans-serif;
  font-size: 12px;
  font-weight: bold;
  color: var(--pv-gold-dark);
}

.pv-progress-track {
  height: 3px;
  background: var(--pv-surface-2);
  border-radius: 99px;
  overflow: hidden;
  margin-bottom: 1.25rem;
}

.pv-progress-fill {
  height: 100%;
  background: var(--pv-gold);
  border-radius: 99px;
  transition: width 0.4s ease;
}

/* ── Category tabs ──────────────────────────────────────────────── */
.pv-cat-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
}

.pv-cat-tab {
  padding: 7px 14px;
  border-radius: 99px;
  border: 1.5px solid var(--pv-border-str);
  background: transparent;
  font-family: Arial, sans-serif;
  font-size: 12px;
  color: var(--pv-ink-mid);
  cursor: pointer;
  transition: all 0.15s;
}

.pv-cat-tab:hover {
  border-color: var(--pv-gold);
  color: var(--pv-gold-dark);
}

.pv-cat-tab.pv-active {
  background: var(--pv-gold);
  border-color: var(--pv-gold);
  color: white;
}

.pv-cat-tab.pv-voted:not(.pv-active) {
  background: var(--pv-green-light);
  border-color: var(--pv-green);
  color: var(--pv-green);
}

.pv-cat-tab .pv-tick {
  display: none;
  margin-left: 3px;
}

.pv-cat-tab.pv-voted .pv-tick {
  display: inline;
}

/* ── Finalist cards ─────────────────────────────────────────────── */
.pv-finalist-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pv-finalist-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 13px 15px;
  border: 1.5px solid var(--pv-border);
  border-radius: var(--pv-radius);
  cursor: pointer;
  transition: all 0.15s;
  background: var(--pv-surface);
}

.pv-finalist-card:hover {
  border-color: var(--pv-gold);
  background: var(--pv-gold-light);
}

.pv-finalist-card.pv-selected {
  border-color: var(--pv-gold);
  background: var(--pv-gold-light);
  box-shadow: 0 0 0 1px var(--pv-gold);
}

.pv-radio-ring {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1.5px solid var(--pv-border-str);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}

.pv-finalist-card.pv-selected .pv-radio-ring {
  background: var(--pv-gold);
  border-color: var(--pv-gold);
}

.pv-radio-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: white;
  display: none;
}

.pv-finalist-card.pv-selected .pv-radio-dot {
  display: block;
}

.pv-fin-info {
  flex: 1;
  min-width: 0;
}

.pv-fin-name {
  font-size: 15px;
  color: var(--pv-ink);
  margin: 0 0 2px;
}

.pv-fin-work {
  font-family: Arial, sans-serif;
  font-size: 12px;
  color: var(--pv-ink-muted);
  margin: 0;
}

/* Finalist image — large panel between the radio and the text */
.pv-fin-thumb {
  flex-shrink: 0;
  width: 200px;
  height: 180px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--pv-border);
  background: var(--pv-surface-2);
}

.pv-fin-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.pv-finalist-card.pv-selected .pv-fin-thumb {
  border-color: var(--pv-gold);
}

/* Confirm-row layout with thumbnail */
.pv-confirm-main {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.pv-confirm-thumb {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--pv-border);
  background: var(--pv-surface-2);
}

.pv-confirm-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ── Confirm step ───────────────────────────────────────────────── */
.pv-confirm-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 13px 0;
  border-bottom: 1px solid var(--pv-gold);
}

.pv-confirm-row:last-child {
  border-bottom: none;
}

.pv-confirm-cat {
  font-family: Arial, sans-serif;
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--pv-ink-muted);
  margin: 0 0 3px;
}

.pv-confirm-name {
  font-size: 15px;
  color: var(--pv-ink);
  margin: 0;
}

.pv-confirm-badge {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--pv-green-light);
  border: 1px solid var(--pv-green);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  flex-shrink: 0;
}

/* ── Success ────────────────────────────────────────────────────── */
.pv-success-wrap {
  text-align: center;
  padding: 1.5rem 0;
}

.pv-success-seal {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  background: var(--pv-gold-light);
  border: 2px solid var(--pv-gold);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  margin: 0 auto 1.25rem;
}

.pv-success-title {
  font-size: 21px;
  font-weight: normal;
  margin: 0 0 0.5rem;
}

.pv-success-sub {
  font-family: Arial, sans-serif;
  font-size: 13px;
  color: var(--pv-ink-muted);
  line-height: 1.6;
  margin: 0 0 1.5rem;
  max-width: 360px;
  margin-left: auto;
  margin-right: auto;
}

.pv-ref-box {
  display: inline-block;
  background: var(--pv-surface-2);
  border: 1px solid var(--pv-border-str);
  border-radius: var(--pv-radius);
  padding: 12px 20px;
}

.pv-ref-label {
  font-family: Arial, sans-serif;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--pv-ink-muted);
  margin: 0 0 4px;
}

.pv-ref-code {
  font-family: 'Courier New', monospace;
  font-size: 16px;
  font-weight: bold;
  color: var(--pv-gold-dark);
  letter-spacing: 0.05em;
  margin: 0;
}

.pv-hint {
  font-family: Arial, sans-serif;
  font-size: 12px;
  color: var(--pv-ink-muted);
}

/* ── Responsive ─────────────────────────────────────────────────── */
@media (max-width: 480px) {
  .pv-title {
    font-size: 22px;
  }

  .pv-btn-row {
    flex-direction: column-reverse;
    align-items: stretch;
  }

  .pv-btn,
  .pv-btn-primary {
    justify-content: center;
    width: 100%;
  }

  .pv-id-row {
    flex-direction: column;
    align-items: stretch;
  }

  .pv-id-row input {
    width: 100%;
  }

  .pv-field-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .pv-step-divider {
    width: 18px;
  }

  .pv-fin-thumb {
    width: 110px;
    height: 100px;
  }
}

/* ── ID reminder on confirm step ────────────────────────────────── */
.pv-id-reminder {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--pv-gold-light);
  border: 1px solid var(--pv-border-str);
  border-radius: var(--pv-radius);
  padding: 12px 16px;
  margin-bottom: 1.1rem;
}

.pv-id-reminder-icon {
  font-size: 22px;
  flex-shrink: 0;
}

.pv-id-reminder-label {
  font-family: Arial, sans-serif;
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--pv-ink-muted);
  margin: 0 0 3px;
}

.pv-id-reminder-val {
  font-family: 'Courier New', monospace;
  font-size: 15px;
  font-weight: bold;
  color: var(--pv-gold-dark);
  margin: 0;
  letter-spacing: 0.06em;
}

/* ── Edition year / subtitle ─────────────────────────────────────── */
.pv-edition {
  font-family: Arial, sans-serif;
  font-size: 13px;
  font-weight: bold;
  color: var(--pv-gold-dark);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin: 0 0 0.25rem;
}