/* ==========================================================================
   BarrioRadar - Standalone Spanish Property Purchase Tax Calculator
   Route: /property-tax-calculator-spain/
   ========================================================================== */

.ptc-page {
  background-color: var(--br-bg-page, #f8fafc);
  color: var(--br-text-primary, #0f172a);
  font-family: var(--br-font-sans, 'Inter', -apple-system, BlinkMacSystemFont, sans-serif);
  min-height: 100vh;
}

.ptc-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* Hero Section - Compact so Calculator Appears Immediately Above the Fold */
.ptc-hero {
  padding: 2.25rem 0 1.5rem;
  border-bottom: 1px solid var(--br-border-light, #e2e8f0);
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
}

.ptc-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--br-primary, #1e40af);
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  padding: 0.3rem 0.75rem;
  border-radius: 9999px;
  margin-bottom: 0.85rem;
}

.ptc-hero-title {
  font-family: var(--br-font-display, 'Plus Jakarta Sans', sans-serif);
  font-size: clamp(1.75rem, 3.2vw, 2.5rem);
  font-weight: 800;
  line-height: 1.18;
  letter-spacing: -0.025em;
  color: var(--br-text-primary, #0f172a);
  margin: 0 0 0.65rem;
}

.ptc-hero-subtitle {
  font-size: clamp(0.95rem, 1.4vw, 1.1rem);
  line-height: 1.55;
  color: var(--br-text-secondary, #475569);
  max-width: 820px;
  margin: 0 0 1rem;
}

.ptc-hero-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.ptc-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: #334155;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 0.35rem 0.7rem;
}

.ptc-hero-badge svg {
  width: 15px;
  height: 15px;
  color: #0284c7;
  flex-shrink: 0;
}

/* Main Calculator Two-Column Workspace */
.ptc-workspace {
  padding: 1.75rem 0 2.5rem;
}

.ptc-calc-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: 1.75rem;
  align-items: start;
}

@media (max-width: 960px) {
  .ptc-calc-grid {
    grid-template-columns: 1fr;
  }
}

/* Form Card (Left Column) */
.ptc-form-card {
  background: #ffffff;
  border: 1px solid var(--br-border-light, #e2e8f0);
  border-radius: 16px;
  padding: 1.6rem;
  box-shadow: 0 4px 20px -4px rgba(15, 23, 42, 0.05);
}

.ptc-card-header {
  margin-bottom: 1.25rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #f1f5f9;
}

.ptc-card-title {
  font-family: var(--br-font-display, 'Plus Jakarta Sans', sans-serif);
  font-size: 1.2rem;
  font-weight: 700;
  color: #0f172a;
  margin: 0 0 0.25rem;
}

.ptc-card-subtitle {
  font-size: 0.875rem;
  color: #64748b;
  margin: 0;
}

.ptc-field-group {
  margin-bottom: 1.35rem;
}

.ptc-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 0.45rem;
}

.ptc-select,
.ptc-input {
  width: 100%;
  min-height: 46px;
  padding: 0.65rem 0.9rem;
  font-size: 0.95rem;
  font-family: inherit;
  color: #0f172a;
  background-color: #ffffff;
  border: 1.5px solid #cbd5e1;
  border-radius: 10px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  box-sizing: border-box;
}

.ptc-select:focus,
.ptc-input:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.14);
}

.ptc-input-mono {
  font-family: var(--br-font-mono, 'JetBrains Mono', monospace);
  font-weight: 600;
  font-size: 1.05rem;
}

.ptc-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.ptc-currency-prefix {
  position: absolute;
  left: 0.9rem;
  font-family: var(--br-font-mono, 'JetBrains Mono', monospace);
  font-weight: 700;
  color: #475569;
  pointer-events: none;
  font-size: 0.95rem;
}

.ptc-input-with-prefix {
  padding-left: 3.1rem;
}

.ptc-hint {
  font-size: 0.8rem;
  color: #64748b;
  margin: 0.4rem 0 0;
  line-height: 1.45;
}

.ptc-error-msg {
  font-size: 0.82rem;
  font-weight: 600;
  color: #dc2626;
  margin: 0.4rem 0 0;
}

/* Price Preset Chips */
.ptc-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.55rem;
}

.ptc-preset-chip {
  min-height: 36px;
  padding: 0.35rem 0.75rem;
  font-size: 0.8rem;
  font-family: var(--br-font-mono, 'JetBrains Mono', monospace);
  font-weight: 600;
  color: #334155;
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.ptc-preset-chip:hover {
  background: #e2e8f0;
  color: #0f172a;
}

.ptc-preset-chip.is-active {
  background: #1e40af;
  color: #ffffff;
  border-color: #1e40af;
}

/* Property Type Segmented Toggle */
.ptc-type-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
}

@media (max-width: 520px) {
  .ptc-type-grid {
    grid-template-columns: 1fr;
  }
}

.ptc-type-btn {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  min-height: 64px;
  padding: 0.75rem 1rem;
  text-align: left;
  background: #f8fafc;
  border: 1.5px solid #cbd5e1;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.ptc-type-btn:hover {
  border-color: #94a3b8;
  background: #f1f5f9;
}

.ptc-type-btn.is-active {
  background: #eff6ff;
  border-color: #2563eb;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.12);
}

.ptc-type-btn-title {
  font-size: 0.92rem;
  font-weight: 700;
  color: #0f172a;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.ptc-type-btn.is-active .ptc-type-btn-title {
  color: #1e40af;
}

.ptc-type-btn-sub {
  font-size: 0.78rem;
  color: #64748b;
  margin-top: 0.2rem;
}

/* Collapsible Optional Sections (Address Lookup & Valor de Referencia) */
.ptc-details {
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #f8fafc;
  margin-bottom: 1.15rem;
  overflow: visible;
}

.ptc-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  font-size: 0.84rem;
  font-weight: 600;
  color: #1e3a8a;
  cursor: pointer;
  list-style: none;
  min-height: 44px;
}

.ptc-summary::-webkit-details-marker {
  display: none;
}

.ptc-details-body {
  padding: 0 1rem 1rem;
  border-top: 1px solid #e2e8f0;
}

.ptc-vdr-explain {
  font-size: 0.8rem;
  line-height: 1.5;
  color: #475569;
  margin: 0.65rem 0;
  background: #ffffff;
  padding: 0.7rem 0.85rem;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
}

.ptc-external-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: #2563eb;
  text-decoration: none;
}

.ptc-external-link:hover {
  text-decoration: underline;
}

/* Optional Address Autocomplete Dropdown */
.ptc-autocomplete-wrap {
  position: relative;
  margin-top: 0.65rem;
}

.ptc-suggestions {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 40;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  box-shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.15);
  max-height: 240px;
  overflow-y: auto;
  margin: 0;
  padding: 0.35rem 0;
  list-style: none;
}

.ptc-suggestion-item {
  padding: 0.6rem 0.9rem;
  font-size: 0.85rem;
  color: #0f172a;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.ptc-suggestion-item:hover {
  background: #eff6ff;
}

.ptc-suggestion-sub {
  font-size: 0.75rem;
  color: #64748b;
}

.ptc-resolved-chip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-top: 0.55rem;
  padding: 0.45rem 0.75rem;
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  border-radius: 8px;
  font-size: 0.8rem;
  color: #065f46;
  font-weight: 600;
}

.ptc-link-btn {
  background: none;
  border: none;
  color: #2563eb;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0.2rem 0.4rem;
  text-decoration: underline;
}

/* Primary Residence Callout inside Form */
.ptc-primary-res-note {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-left: 3.5px solid #0284c7;
  border-radius: 10px;
  padding: 0.85rem 1rem;
  margin-top: 0.5rem;
}

.ptc-primary-res-title {
  font-size: 0.84rem;
  font-weight: 700;
  color: #0f172a;
  margin: 0 0 0.25rem;
}

.ptc-primary-res-body {
  font-size: 0.8rem;
  line-height: 1.48;
  color: #475569;
  margin: 0 0 0.35rem;
}

/* Results Panel (Right Column - Sticky on Desktop) */
.ptc-results-card {
  position: sticky;
  top: 5.25rem;
  background: #ffffff;
  border: 1.5px solid #cbd5e1;
  border-radius: 16px;
  padding: 1.6rem;
  box-shadow: 0 10px 30px -8px rgba(15, 23, 42, 0.08);
}

.ptc-results-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 1.15rem;
  border-bottom: 1px solid #e2e8f0;
  margin-bottom: 1.15rem;
}

.ptc-results-eyebrow {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #0284c7;
  margin-bottom: 0.3rem;
}

.ptc-total-label {
  font-size: 0.88rem;
  font-weight: 600;
  color: #475569;
  margin-bottom: 0.2rem;
}

.ptc-total-value {
  font-family: var(--br-font-mono, 'JetBrains Mono', monospace);
  font-size: clamp(1.85rem, 3vw, 2.35rem);
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.ptc-rate-badge {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 12px;
  padding: 0.55rem 0.85rem;
  text-align: right;
  flex-shrink: 0;
}

.ptc-rate-badge-val {
  font-family: var(--br-font-mono, 'JetBrains Mono', monospace);
  font-size: 1.25rem;
  font-weight: 800;
  color: #1e40af;
}

.ptc-rate-badge-sub {
  font-size: 0.72rem;
  color: #475569;
  font-weight: 600;
}

/* Summary KPI Strip */
.ptc-kpi-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-bottom: 1.15rem;
}

@media (max-width: 480px) {
  .ptc-kpi-grid {
    grid-template-columns: 1fr;
  }
}

.ptc-kpi-box {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 0.75rem 0.9rem;
}

.ptc-kpi-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: #64748b;
  margin-bottom: 0.25rem;
}

.ptc-kpi-val {
  font-family: var(--br-font-mono, 'JetBrains Mono', monospace);
  font-size: 1rem;
  font-weight: 700;
  color: #0f172a;
}

.ptc-kpi-val-text {
  font-family: var(--br-font-sans, 'Inter', sans-serif);
  font-size: 0.92rem;
  font-weight: 700;
  color: #0f172a;
}

/* Calculation Basis Box */
.ptc-basis-box {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 0.8rem 0.95rem;
  margin-bottom: 1.15rem;
  font-size: 0.82rem;
  line-height: 1.48;
  color: #334155;
}

.ptc-basis-box.is-vdr-higher {
  background: #fffbeb;
  border-color: #fde68a;
  color: #92400e;
}

.ptc-basis-box.is-foral {
  background: #f0f9ff;
  border-color: #bae6fd;
  color: #0c4a6e;
}

.ptc-basis-heading {
  font-weight: 700;
  margin-bottom: 0.2rem;
  color: inherit;
}

/* Breakdown & Progressive Tables */
.ptc-section-subtitle {
  font-size: 0.85rem;
  font-weight: 700;
  color: #0f172a;
  margin: 0 0 0.5rem;
}

.ptc-table-wrap {
  overflow-x: auto;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  margin-bottom: 1.15rem;
}

.ptc-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}

.ptc-table th {
  background: #f8fafc;
  color: #475569;
  font-weight: 700;
  text-align: left;
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid #e2e8f0;
  white-space: nowrap;
}

.ptc-table td {
  padding: 0.65rem 0.75rem;
  border-bottom: 1px solid #f1f5f9;
  color: #0f172a;
}

.ptc-table tr:last-child td {
  border-bottom: none;
}

.ptc-table .num {
  text-align: right;
  font-family: var(--br-font-mono, 'JetBrains Mono', monospace);
  font-weight: 600;
  white-space: nowrap;
}

.ptc-component-note {
  display: block;
  font-size: 0.74rem;
  color: #64748b;
  margin-top: 0.2rem;
  font-weight: 400;
}

/* Unsupported Ceuta/Melilla New-Build IPSI Notice */
.ptc-unsupported-box {
  background: #fffbeb;
  border: 1.5px solid #f59e0b;
  border-radius: 12px;
  padding: 1rem 1.1rem;
  margin-bottom: 1.15rem;
}

.ptc-unsupported-title {
  font-size: 0.92rem;
  font-weight: 700;
  color: #92400e;
  margin: 0 0 0.35rem;
}

.ptc-unsupported-body {
  font-size: 0.82rem;
  line-height: 1.5;
  color: #78350f;
  margin: 0;
}

/* Provenance Metadata Footer inside Results */
.ptc-provenance {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 0.8rem 0.95rem;
  margin-bottom: 1rem;
  font-size: 0.78rem;
  color: #475569;
}

.ptc-provenance-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.45rem 0.85rem;
  margin-top: 0.45rem;
}

@media (max-width: 480px) {
  .ptc-provenance-grid {
    grid-template-columns: 1fr;
  }
}

.ptc-prov-item strong {
  color: #0f172a;
}

.ptc-disclaimer {
  font-size: 0.76rem;
  line-height: 1.48;
  color: #64748b;
  margin: 0;
}

/* Conversion CTA Banner ("Know the taxes. Now check the location.") */
.ptc-cta-section {
  padding: 0.5rem 0 2.75rem;
}

.ptc-cta-card {
  background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 100%);
  color: #ffffff;
  border-radius: 18px;
  padding: 2rem 2.25rem;
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) auto;
  gap: 1.75rem;
  align-items: center;
  box-shadow: 0 14px 32px -10px rgba(15, 23, 42, 0.25);
}

@media (max-width: 820px) {
  .ptc-cta-card {
    grid-template-columns: 1fr;
    padding: 1.6rem;
  }
}

.ptc-cta-eyebrow {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #93c5fd;
  margin-bottom: 0.4rem;
}

.ptc-cta-title {
  font-family: var(--br-font-display, 'Plus Jakarta Sans', sans-serif);
  font-size: clamp(1.35rem, 2.3vw, 1.75rem);
  font-weight: 800;
  color: #ffffff;
  margin: 0 0 0.5rem;
}

.ptc-cta-subtitle {
  font-size: 0.95rem;
  line-height: 1.55;
  color: #cbd5e1;
  margin: 0 0 1rem;
  max-width: 640px;
}

.ptc-cta-features {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  font-size: 0.8rem;
  color: #e2e8f0;
  font-weight: 500;
}

.ptc-cta-actions {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  min-width: 220px;
}

.ptc-btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 48px;
  padding: 0.75rem 1.35rem;
  font-size: 0.95rem;
  font-weight: 700;
  color: #0f172a;
  background: #38bdf8;
  border-radius: 10px;
  text-decoration: none;
  transition: transform 0.15s ease, background 0.15s ease;
}

.ptc-btn-primary:hover {
  background: #7dd3fc;
  transform: translateY(-1px);
}

.ptc-btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0.6rem 1.15rem;
  font-size: 0.84rem;
  font-weight: 600;
  color: #e2e8f0;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 10px;
  text-decoration: none;
}

.ptc-btn-secondary:hover {
  background: rgba(255, 255, 255, 0.15);
}

/* SEO Editorial Guide & Regional Summary Table */
.ptc-editorial {
  padding: 2.5rem 0 4rem;
  border-top: 1px solid #e2e8f0;
  background: #ffffff;
}

.ptc-editorial-grid {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 2.5rem;
  align-items: start;
}

@media (max-width: 900px) {
  .ptc-editorial-grid {
    grid-template-columns: 1fr;
  }
}

.ptc-toc {
  position: sticky;
  top: 5.5rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 1.15rem;
}

.ptc-toc-title {
  font-size: 0.82rem;
  font-weight: 700;
  color: #0f172a;
  margin: 0 0 0.65rem;
}

.ptc-toc-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.ptc-toc-list a {
  font-size: 0.82rem;
  color: #475569;
  text-decoration: none;
  line-height: 1.4;
  display: block;
  padding: 0.25rem 0;
}

.ptc-toc-list a:hover {
  color: #1e40af;
}

.ptc-article-section {
  margin-bottom: 2.5rem;
  scroll-margin-top: 5.5rem;
}

.ptc-article-section h2 {
  font-family: var(--br-font-display, 'Plus Jakarta Sans', sans-serif);
  font-size: 1.4rem;
  font-weight: 800;
  color: #0f172a;
  margin: 0 0 0.75rem;
}

.ptc-article-section h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: #0f172a;
  margin: 1.1rem 0 0.45rem;
}

.ptc-article-section p,
.ptc-article-section li {
  font-size: 0.95rem;
  line-height: 1.65;
  color: #334155;
}

.ptc-article-section ul {
  padding-left: 1.25rem;
  margin: 0.5rem 0 1rem;
}

.ptc-article-section li {
  margin-bottom: 0.45rem;
}

.ptc-compare-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 1rem;
}

@media (max-width: 640px) {
  .ptc-compare-cards {
    grid-template-columns: 1fr;
  }
}

.ptc-compare-card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 1.15rem;
}

/* FAQ Accordion */
.ptc-faq-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.ptc-faq-item {
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #f8fafc;
}

.ptc-faq-item summary {
  padding: 1rem 1.15rem;
  font-size: 0.96rem;
  font-weight: 700;
  color: #0f172a;
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.ptc-faq-item summary::-webkit-details-marker {
  display: none;
}

.ptc-faq-answer {
  padding: 0 1.15rem 1.1rem;
  font-size: 0.92rem;
  line-height: 1.62;
  color: #334155;
  border-top: 1px solid #e2e8f0;
  padding-top: 0.85rem;
}

.is-hidden {
  display: none !important;
}
