/* ==============================
   VIDSOTKY CALCULATOR — UKRAINIAN
   Калькулятор відсотків — стилі
   ============================== */

/* Breadcrumb */
.breadcrumb {
  padding: 12px 0;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  font-size: 0.85rem;
  transition: background var(--transition), border var(--transition);
}
.breadcrumb ol {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  list-style: none;
  padding: 0;
  margin: 0;
}
.breadcrumb li { display: inline-flex; align-items: center; }
.breadcrumb li:not(:last-child)::after {
  content: "›";
  margin-left: 8px;
  color: var(--text-muted);
  font-size: 1.1rem;
}
.breadcrumb a { color: var(--accent); text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb [aria-current="page"] { color: var(--text-secondary); font-weight: 500; }

/* Hero */
.pct-hero {
  padding: 40px 0 32px;
  text-align: center;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  transition: background var(--transition), border var(--transition);
}
.pct-hero h1 {
  font-size: 2.4rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 10px;
  background: linear-gradient(135deg, var(--accent), #7c3aed);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.pct-hero-subtitle {
  font-size: 1.1rem;
  color: var(--text-secondary);
  max-width: 720px;
  margin: 0 auto 16px;
  line-height: 1.6;
}
.pct-hero-badge {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 0.9rem;
  color: var(--text-muted);
}
.pct-hero-badge span:first-child { color: #16a34a; font-weight: 500; }

/* Calculator Section */
.pct-calculator-section { padding: 40px 0 20px; }
.pct-calculator-wrapper { max-width: 1000px; margin: 0 auto; }

/* Mode Tabs */
.pct-tabs-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  padding: 8px;
  margin-bottom: 24px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}
.pct-tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border: none;
  border-radius: var(--radius);
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
  min-height: 40px;
  white-space: nowrap;
}
.pct-tab-btn:hover { background: var(--bg-secondary); color: var(--text); }
.pct-tab-btn.active {
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
}
.pct-tab-btn span { font-size: 1.05rem; }

/* Panels */
.pct-panel { display: none; }
.pct-panel.active { display: block; }

/* Grid */
.pct-calc-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  transition: background var(--transition), border var(--transition);
}

/* Form Card */
.pct-form-card { display: flex; flex-direction: column; gap: 16px; }
.pct-form-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 4px;
}
.pct-form-title span { font-size: 1.3rem; }

.pct-field { display: flex; flex-direction: column; gap: 6px; }
.pct-field label {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
}
.pct-input-wrap {
  position: relative;
  display: flex;
  align-items: stretch;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  overflow: hidden;
  transition: border var(--transition), box-shadow var(--transition);
}
.pct-input-wrap:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}
.pct-input-wrap input {
  flex: 1;
  padding: 12px 14px;
  border: none;
  background: transparent;
  color: var(--text);
  font-size: 1rem;
  font-family: inherit;
  min-height: 48px;
  width: 100%;
}
.pct-input-wrap input:focus { outline: none; }
.pct-input-wrap input::placeholder { color: var(--text-muted); }
.pct-input-affix {
  display: flex;
  align-items: center;
  padding: 0 14px;
  color: var(--text-muted);
  background: var(--bg-secondary);
  font-weight: 600;
  font-size: 0.95rem;
  border-left: 1px solid var(--border);
}

/* Radio */
.pct-radio-group { display: flex; flex-direction: column; gap: 8px; margin-top: 4px; }
.pct-radio-label {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 0.95rem;
  color: var(--text-secondary);
  transition: background 0.2s, border 0.2s, color 0.2s;
}
.pct-radio-label:hover { background: var(--bg-secondary); }
.pct-radio-label input[type="radio"] {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
  cursor: pointer;
  flex-shrink: 0;
}
.pct-radio-label:has(input:checked) {
  border-color: var(--accent);
  background: var(--accent-light);
  color: var(--text);
  font-weight: 500;
}

/* Buttons */
.pct-btn-group { display: flex; gap: 10px; margin-top: 6px; }
.pct-btn {
  padding: 10px 20px;
  border: none;
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
  min-height: 44px;
}
.pct-btn:hover { transform: translateY(-1px); }
.pct-btn.secondary {
  background: var(--bg-secondary);
  color: var(--text);
  border: 1px solid var(--border);
}
.pct-btn.secondary:hover { background: var(--border); }

/* Result Card */
.pct-result-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 16px;
}
.pct-result-header {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.pct-highlight-box {
  padding: 20px 24px;
  background: var(--bg-secondary);
  border-radius: var(--radius);
  border-left: 4px solid var(--accent);
  margin-bottom: 16px;
  transition: background var(--transition);
}
.pct-highlight-box .result-label {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: 6px;
  font-weight: 500;
}
.pct-highlight-box .result-val {
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--accent);
  letter-spacing: -0.03em;
  line-height: 1.1;
  word-break: break-word;
}
.pct-highlight-box .result-val.positive { color: #16a34a; }
.pct-highlight-box .result-val.negative { color: #dc2626; }

/* Breakdown List */
.pct-breakdown-list {
  list-style: none;
  padding: 0;
  margin: 0 0 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.pct-breakdown-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.9rem;
  transition: background var(--transition), border var(--transition);
}
.pct-breakdown-label { color: var(--text-secondary); }
.pct-breakdown-value {
  font-weight: 600;
  color: var(--text);
  text-align: right;
  word-break: break-word;
}

/* Formula Box */
.pct-formula-box {
  padding: 12px 16px;
  background: var(--bg-secondary);
  border-radius: var(--radius);
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.6;
  transition: background var(--transition);
}
.pct-formula-box code {
  display: inline-block;
  padding: 2px 6px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  font-family: 'Courier New', Courier, monospace;
  font-size: 0.85rem;
  color: var(--text);
  margin-top: 4px;
}

/* Copy Bar */
.pct-copy-bar {
  display: flex;
  justify-content: flex-end;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}
.pct-copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 18px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.2s, border 0.2s;
  min-height: 40px;
}
.pct-copy-btn:hover {
  background: var(--bg-secondary);
  border-color: var(--border-hover);
}

/* SEO Content */
.pct-content-article {
  padding: 40px 0;
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  transition: background var(--transition), border var(--transition);
}
.pct-content-wrapper { max-width: 850px; margin: 0 auto; }
.pct-content-wrapper h2 {
  font-size: 1.6rem;
  font-weight: 700;
  margin: 28px 0 14px;
  color: var(--text);
  letter-spacing: -0.02em;
}
.pct-content-wrapper h2:first-child { margin-top: 0; }
.pct-content-wrapper h3 {
  font-size: 1.2rem;
  font-weight: 600;
  margin: 24px 0 10px;
  color: var(--text);
}
.pct-content-wrapper h4 {
  font-size: 1.05rem;
  font-weight: 600;
  margin: 16px 0 8px;
  color: var(--text);
}
.pct-content-wrapper p {
  color: var(--text-secondary);
  font-size: 1.02rem;
  line-height: 1.75;
  margin-bottom: 16px;
}
.pct-content-wrapper ul,
.pct-content-wrapper ol {
  color: var(--text-secondary);
  font-size: 1.02rem;
  line-height: 1.75;
  margin: 12px 0 20px 24px;
}
.pct-content-wrapper li { margin-bottom: 6px; }
.pct-content-wrapper strong { color: var(--text); }
.pct-content-wrapper code {
  padding: 2px 6px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 4px;
  font-family: 'Courier New', Courier, monospace;
  font-size: 0.9em;
  color: var(--text);
}

/* Formula Grid */
.formula-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin: 20px 0 24px;
}
.formula-card {
  padding: 18px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: background var(--transition), border var(--transition);
}
.formula-card h4 {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 8px;
}
.formula-card .math-expr {
  display: block;
  padding: 8px 10px;
  background: var(--bg-secondary);
  border-radius: 6px;
  font-family: 'Courier New', Courier, monospace;
  font-size: 0.85rem;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 8px;
  overflow-x: auto;
}
.formula-card p {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.5;
}

/* Callout */
.pct-callout {
  padding: 18px 22px;
  background: #fff7ed;
  border-left: 4px solid #f59e0b;
  border-radius: var(--radius);
  margin: 24px 0;
}
[data-theme="dark"] .pct-callout { background: #1f1a10; }
.pct-callout h4 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 8px;
}
.pct-callout p {
  font-size: 0.95rem;
  color: var(--text-secondary);
  margin: 0;
  line-height: 1.7;
}

/* Table */
.pct-table-wrap {
  overflow-x: auto;
  margin: 20px 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.pct-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
  background: var(--bg-card);
}
.pct-table thead {
  background: var(--bg-secondary);
}
.pct-table th {
  padding: 12px 14px;
  text-align: left;
  font-weight: 600;
  color: var(--text-secondary);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 2px solid var(--border);
  white-space: nowrap;
}
.pct-table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  color: var(--text-secondary);
}
.pct-table tr:last-child td { border-bottom: none; }
.pct-table strong { color: var(--text); }

/* FAQ */
.pct-faq-section {
  padding: 40px 0 56px;
}
.pct-faq-wrapper {
  max-width: 800px;
  margin: 0 auto;
}
.pct-faq-wrapper h2 {
  font-size: 1.8rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 28px;
  letter-spacing: -0.02em;
}
.pct-faq-wrapper .faq-item {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 8px;
  overflow: hidden;
  transition: border var(--transition);
}
.pct-faq-wrapper .faq-item:focus-within { border-color: var(--accent); }
.pct-faq-wrapper .faq-question {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  background: var(--bg-card);
  border: none;
  font-size: 1rem;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
  font-family: inherit;
  text-align: left;
  transition: background var(--transition);
}
.pct-faq-wrapper .faq-question:hover { background: var(--bg-secondary); }
.pct-faq-wrapper .faq-icon {
  font-size: 1.3rem;
  font-weight: 300;
  transition: transform 0.25s ease;
  color: var(--text-muted);
  flex-shrink: 0;
  margin-left: 16px;
}
.pct-faq-wrapper .faq-question[aria-expanded="true"] .faq-icon {
  transform: rotate(45deg);
}
.pct-faq-wrapper .faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s ease, padding 0.3s ease;
  background: var(--bg-secondary);
}
.pct-faq-wrapper .faq-answer[aria-hidden="false"] {
  max-height: 400px;
  padding: 16px 20px 20px;
}
.pct-faq-wrapper .faq-answer p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.98rem;
  line-height: 1.7;
}

/* ==============================
   RESPONSIVE
   ============================== */

@media (max-width: 820px) {
  .pct-calc-grid {
    grid-template-columns: 1fr;
    gap: 24px;
    padding: 22px;
  }
  .pct-hero h1 { font-size: 2rem; }
  .formula-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 700px) {
  .pct-hero h1 { font-size: 1.7rem; }
  .pct-hero-subtitle { font-size: 1rem; }
  .pct-hero-badge { font-size: 0.8rem; gap: 4px; }
  .pct-tabs-nav {
    flex-direction: column;
    gap: 4px;
    padding: 8px;
    overflow-x: auto;
  }
  .pct-tab-btn {
    width: 100%;
    justify-content: flex-start;
    font-size: 0.85rem;
    padding: 10px 14px;
  }
  .pct-calc-grid {
    padding: 16px;
    gap: 20px;
  }
  .pct-form-title { font-size: 1.05rem; }
  .pct-input-wrap input {
    font-size: 16px !important;
    min-height: 44px;
    padding: 10px 12px;
  }
  .pct-highlight-box .result-val { font-size: 1.7rem; }
  .pct-breakdown-item { font-size: 0.85rem; padding: 8px 12px; }
  .pct-content-wrapper h2 { font-size: 1.35rem; }
  .pct-content-wrapper h3 { font-size: 1.1rem; }
  .pct-content-wrapper p,
  .pct-content-wrapper ul,
  .pct-content-wrapper ol { font-size: 0.97rem; }
  .formula-grid { grid-template-columns: 1fr; gap: 12px; }
  .pct-table th,
  .pct-table td { padding: 8px 10px; font-size: 0.85rem; }
  .pct-copy-bar { justify-content: stretch; }
  .pct-copy-btn { width: 100%; justify-content: center; }
  .breadcrumb { padding: 8px 0; font-size: 0.8rem; }
}

@media (max-width: 480px) {
  .pct-hero { padding: 32px 0 24px; }
  .pct-hero h1 { font-size: 1.45rem; }
  .pct-calc-grid { padding: 14px; }
  .pct-highlight-box { padding: 16px; }
  .pct-highlight-box .result-val { font-size: 1.5rem; }
  .pct-faq-wrapper h2 { font-size: 1.4rem; }
  .pct-faq-wrapper .faq-question { font-size: 0.95rem; padding: 14px 16px; }
  .pct-faq-wrapper .faq-answer p { font-size: 0.92rem; }
}