/* ============================================
FORM ELEMENTS
============================================ */
/* Component-specific tokens (Phase 3) */
:root {
  --seo-link-color: #1e40af;
  --select-bg: #1e293b;
  --select-border: rgba(255, 255, 255, 0.1);
  --btn-shimmer: rgba(255, 255, 255, 0.2);
  --btn-ripple: rgba(255, 255, 255, 0.6);
  --option-hover-bg: rgba(255, 255, 255, 0.05);
  --scrollbar-thumb: rgba(255, 255, 255, 0.2);
}
[data-theme="dark"] {
  --seo-link-color: #60a5fa;
  --select-bg: #1e293b;
  --select-border: rgba(255, 255, 255, 0.1);
  --btn-shimmer: rgba(255, 255, 255, 0.15);
  --btn-ripple: rgba(255, 255, 255, 0.4);
  --option-hover-bg: rgba(255, 255, 255, 0.03);
  --scrollbar-thumb: rgba(255, 255, 255, 0.15);
}

.input-group {
  margin-bottom: var(--space-lg);
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.input-group:hover {
  border-color: var(--primary-light);
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.input-group:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}

.input-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: var(--space-xs);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  transition: color var(--transition-fast);
}

.input-wrapper {
  position: relative;
}

.input-field {
  width: 100%;
  padding: var(--space-lg) var(--space-lg);
  background: var(--bg-subtle);
  border: 1.5px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 1.125rem;
  font-family: var(--font-body);
  transition: all var(--transition-fast);
  line-height: 1.4;
}

.input-field:hover {
  border-color: var(--primary-light);
  background: var(--bg-card);
}

.input-field:focus {
  outline: none;
  border-color: var(--primary);
  background: var(--bg-card);
  box-shadow: 0 0 0 3px var(--primary-light);
}

.input-field::placeholder {
  color: var(--text-muted);
  opacity: 0.7;
}


.input-suffix,
.input-prefix {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 0.875rem;
  font-weight: 500;
  pointer-events: none;
  font-family: var(--font-body);
}

.input-suffix {
  right: var(--space-lg);
}

.input-prefix {
  left: var(--space-lg);
}

.input-with-suffix {
  padding-right: calc(var(--space-3xl) + var(--space-lg));
}

.input-with-prefix {
  padding-left: calc(var(--space-3xl) + var(--space-lg));
}

/* Percentage Field - Flex Layout */
.percentage-field {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.percentage-field .input-wrapper {
  flex: 1;
}

.percentage-field .input-suffix {
  position: static;
  transform: none;
  top: auto;
  right: auto;
  background: var(--accent-amber-light);
  color: var(--accent-amber);
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 700;
  flex-shrink: 0;
}

/* Select Styling */
.select-field {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%235a67d8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right var(--space-lg) center;
  padding-right: calc(var(--space-2xl) + var(--space-xs));
  cursor: pointer;
  border-width: 1.5px;
}

/* Checkbox & Radio */
.checkbox-wrapper,
.radio-wrapper {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  cursor: pointer;
  margin-bottom: var(--space-md);
}

.checkbox-input,
.radio-input {
  appearance: none;
  width: 22px;
  height: 22px;
  border: 2px solid var(--glass-border);
  border-radius: var(--radius-sm);
  background: var(--glass-surface);
  cursor: pointer;
  position: relative;
  transition: all var(--transition-fast);
  min-width: 22px;
  min-height: 22px;
}

.checkbox-input:checked,
.radio-input:checked {
  border-color: var(--primary-color);
  background: var(--primary-color);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.checkbox-input:checked::after {
  content: '';
  position: absolute;
  left: 7px;
  top: 3px;
  width: 5px;
  height: 10px;
  border: solid var(--text-on-primary);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.radio-input {
  border-radius: var(--radius-full);
}

.radio-input:checked::after {
  content: '';
  position: absolute;
  left: 6px;
  top: 6px;
  width: 8px;
  height: 8px;
  background: var(--text-on-primary);
  border-radius: var(--radius-full);
}

/* ============================================
BUTTONS (Enhanced)
============================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: var(--space-md) var(--space-xl);
  font-size: 1rem;
  font-weight: 600;
  font-family: var(--font-display);
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-spring);
  text-decoration: none;
  white-space: nowrap;
  position: relative;
  overflow: hidden;
  isolation: isolate;
}

.btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent 0%, var(--btn-shimmer) 20%, transparent 40%);
  transform: translateX(-100%);
  transition: transform 0.6s ease;
}

.btn:hover::before {
  transform: translateX(100%);
}

.btn-primary {
  background: var(--accent-gradient);
  background-size: 200% 200%;
  color: white;
  box-shadow: 0 6px 20px var(--accent-glow);
  animation: gradientShift 8s ease infinite;
  font-weight: 700;
}

.btn-primary:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 12px 35px var(--accent-glow), 0 0 80px rgba(102, 126, 234, 0.3);
}

.btn-primary:active {
  transform: translateY(-1px) scale(0.98);
  transition: transform 0.1s ease;
}

.btn-primary::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 6px;
  height: 6px;
  background: var(--btn-ripple);
  border-radius: 50%;
  transform: translate(-50%, -50%) scale(0);
  opacity: 0;
}

.btn-primary:focus:not(:active)::after {
  animation: ripple 1s ease-out;
}

/* Calculator Submit Button - Enhanced */
.btn-submit-calc {
  min-height: 56px;
  padding: var(--space-xl) var(--space-2xl);
  font-size: 1.125rem;
  border-radius: var(--radius-lg);
  box-shadow: 0 8px 24px var(--accent-glow);
}

.btn-submit-calc:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 14px 40px var(--accent-glow), 0 0 100px rgba(102, 126, 234, 0.35);
}

@keyframes ripple {
  0% {
    transform: translate(-50%, -50%) scale(0);
    opacity: 0.6;
  }
  100% {
    transform: translate(-50%, -50%) scale(20);
    opacity: 0;
  }
}

.btn-secondary {
  background: var(--glass-surface);
  color: var(--text-primary);
  border: 1px solid var(--glass-border);
}

.btn-secondary:hover {
  background: var(--glass-surface-hover);
  border-color: var(--primary-light);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn-lg {
  padding: var(--space-lg) var(--space-2xl);
  font-size: 1.125rem;
}

.btn-full {
  width: 100%;
}

/* ============================================
CALCULATOR PANEL
============================================ */
.calculator {
  background: linear-gradient(180deg, rgba(99, 102, 241, 0.06) 0%, transparent 100%);
  border-radius: var(--radius-xl);
  padding: var(--space-2xl);
  margin: var(--space-2xl) 0;
  border: 1px solid var(--glass-border-light);
}

.calculator-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-xl);
}

@media (max-width: 768px) {
  .calculator-grid {
    grid-template-columns: 1fr;
  }
}

/* Result Display */
.result-box {
  background: var(--glass-surface);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  text-align: center;
  min-height: 200px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  transition: all var(--transition-base);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.result-box:hover {
  border-color: var(--primary-light);
  box-shadow: var(--shadow-glow);
}

.result-value {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 800;
  background: var(--gradient-result);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: var(--space-sm);
  font-family: var(--font-mono);
  transition: transform var(--transition-bounce);
}

.result-value.updated {
  animation: valuePop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes valuePop {
  0% { transform: scale(1); }
  50% { transform: scale(1.1); }
  100% { transform: scale(1); }
}

.result-value:empty::before {
  content: "—";
  color: var(--text-muted);
}

.result-label {
  font-size: 0.875rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: var(--space-lg);
}

.result-breakdown {
  display: grid;
  gap: var(--space-sm);
  margin-top: var(--space-lg);
  text-align: left;
  opacity: 0;
  transform: translateY(10px);
  transition: all 0.5s ease;
}

.result-breakdown.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.result-item {
  display: flex;
  justify-content: space-between;
  padding: var(--space-sm) 0;
  border-bottom: 1px solid var(--glass-border);
  font-size: 0.9375rem;
  transition: transform var(--transition-fast);
}

.result-item:hover {
  transform: translateX(4px);
  background: var(--glass-surface);
  margin: 0 calc(var(--space-md) * -1);
  padding-left: var(--space-md);
  padding-right: var(--space-md);
  border-radius: var(--radius-sm);
}

.result-item-label {
  color: var(--text-secondary);
}

.result-item-value {
  font-weight: 600;
  color: var(--text-primary);
  font-family: var(--font-mono);
}

/* ============================================
AD PLACEHOLDERS
=========================================== */
.ad-container {
  min-height: 90px;
  max-width: 728px;
  margin: var(--space-md) auto;
  width: 100%;
  background: var(--glass-surface);
  border: 1px dashed var(--glass-border);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.ad-container:hover {
  border-color: var(--primary-light);
  background: var(--glass-surface-hover);
}

@media (max-width: 768px) {
  .ad-container {
    min-height: 100px;
  }
}

/* AdSense display fix — replaces inline style="display:block" */
.adsbygoogle {
  display: block !important;
}

.ad-label {
  color: var(--text-muted);
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ============================================
SEO CONTENT BLOCK
=========================================== */
.seo-content {
  max-width: 768px;
  margin: var(--space-0) auto;
}

.seo-content h2 {
  text-align: center;
  margin-bottom: var(--space-xl);
  position: relative;
}

.seo-content h2::after {
  content: '';
  display: block;
  width: 60px;
  height: 4px;
  background: var(--accent-gradient);
  margin: var(--space-md) auto 0;
  border-radius: var(--radius-full);
}

.seo-content p {
  margin-bottom: var(--space-lg);
  line-height: 1.8;
  color: var(--text-primary);
}

.seo-content ul, .seo-content ol {
  margin: 0 0 var(--space-lg) var(--space-xl);
}

.seo-content li {
  margin-bottom: var(--space-sm);
  color: var(--text-primary);
  line-height: 1.7;
}

.seo-content h3 {
  margin-top: var(--space-2xl);
  margin-bottom: var(--space-md);
  color: var(--text-primary);
  padding-bottom: var(--space-xs);
  border-bottom: 1px solid var(--border-subtle);
}

/* h4 — judul contoh & FAQ, mepet karena tidak ada styling */
.seo-content h4 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-top: var(--space-xl);
  margin-bottom: var(--space-sm);
  padding-top: var(--space-md);
  border-top: 1px solid var(--border-subtle);
  line-height: 1.4;
}

/* h4 pertama setelah h3 — tidak perlu border dobel */
.seo-content h3 + h4 {
  border-top: none;
  padding-top: 0;
  margin-top: var(--space-md);
}

/* Paragraf & list setelah h4 — tidak mepet */
.seo-content h4 + p,
.seo-content h4 + ul,
.seo-content h4 + ol {
  margin-top: 0;
}

/* Padding article — !important karena .glass-card bisa override */
article.seo-content,
article.glass-card,
article.seo-content.glass-card {
  padding: var(--space-2xl) !important;
  overflow: visible !important;
}

@media (max-width: 768px) {
  article.seo-content,
  article.glass-card,
  article.seo-content.glass-card {
    padding: var(--space-lg) !important;
  }
}

/* inline style="margin-top..." di trust-bar — override dengan class */
.hero-trust-bar {
  margin-top: var(--space-md);
  justify-content: center;
}

/* share-result-block & smart-rec-block — spacing dari section di atas */
.share-result-block,
.smart-rec-block {
  padding: var(--space-lg) 0;
}

/* Smart Recommendation System — full styles */
.smart-rec-block {
  margin-top: var(--space-xl);
  background: var(--bg-subtle);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
  transition: opacity .3s ease, transform .3s ease;
  opacity: 0;
  transform: translateY(8px);
}
.smart-rec-block.visible {
  opacity: 1;
  transform: translateY(0);
}
.smart-rec-label {
  font-size: .7rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-muted);
  margin-bottom: var(--space-sm);
}
.smart-rec-primary {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md);
  background: var(--bg-card);
  border: 1.5px solid var(--border-card);
  border-radius: var(--radius-md);
  text-decoration: none;
  color: var(--text-primary);
  transition: border-color .2s, box-shadow .2s;
}
.smart-rec-primary:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
}
.smart-rec-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
}
.smart-rec-title {
  display: block;
  font-weight: 700;
  font-size: var(--text-sm);
}
.smart-rec-body {
  font-size: var(--text-xs);
  color: var(--text-secondary);
}
.smart-rec-arrow {
  margin-left: auto;
  color: var(--primary);
  font-size: 1.2rem;
  flex-shrink: 0;
}
.smart-rec-secondary {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  margin-top: var(--space-sm);
  background: var(--bg-subtle);
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: var(--text-secondary);
  font-size: var(--text-sm);
  transition: background .2s;
}
.smart-rec-secondary:hover {
  background: var(--primary-light);
  color: var(--primary);
}

/* ad-slot-result — spacing dari result di atas */
.ad-slot-result {
  margin-top: var(--space-lg);
}

/* sticky-cta-bar — pastikan tidak overlap konten bawah di mobile */
.sticky-cta-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 900;
  padding: var(--space-md);
  background: var(--glass-surface);
  border-top: 1px solid var(--glass-border);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Beri ruang bawah body supaya sticky-cta tidak tutup konten */
body[data-page="tool"] {
  padding-bottom: calc(var(--space-3xl) + var(--space-xl));
}

@media (min-width: 768px) {
  body[data-page="tool"] {
    padding-bottom: 0;
  }
  .sticky-cta-bar {
    display: none;
  }
}

/* Article engagement: highlight boxes and data tables */
.article-highlight {
  background: var(--bg-subtle);
  border-left: 4px solid var(--primary);
  padding: var(--space-lg) var(--space-md);
  margin: var(--space-lg) 0;
  border-radius: var(--radius-md);
}
.article-table {
  width: 100%;
  border-collapse: collapse;
  margin: var(--space-lg) 0;
  font-size: 0.9375rem;
}
.article-table th,
.article-table td {
  padding: var(--space-sm) var(--space-md);
  border-bottom: 1px solid var(--border-subtle);
  text-align: left;
}
.article-table th {
  font-weight: 600;
  color: var(--text-primary);
  background: var(--bg-subtle);
}
.article-table tr:hover td {
  background: var(--bg-card);
}

.seo-content a {
  color: var(--seo-link-color);
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: color var(--transition-fast), text-decoration var(--transition-fast);
}

.seo-content a:hover {
  color: var(--seo-link-color);
  text-decoration: none;
}


/* Custom Select Dropdown - Dark Theme */
select.custom-select {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: var(--space-0) !important;
  margin: var(--space-0) !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.custom-select-wrapper {
  position: relative;
  width: 100%;
}

.custom-select-trigger {
  appearance: none;
  -webkit-appearance: none;
  background: var(--select-bg);
  border: 1px solid var(--select-border);
  border-radius: 10px;
  padding: var(--space-sm) var(--space-md);
  color: white;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  transition: all var(--transition-base);
  box-shadow: var(--shadow-soft);
  font-family: var(--font-primary);
  font-size: 1rem;
  min-height: 44px;
}

.custom-select-trigger:hover {
  background: rgba(30, 41, 59, 0.9);
  border-color: rgba(255, 255, 255, 0.2);
}

.custom-select-trigger:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.custom-arrow {
  width: 12px;
  height: 12px;
  flex-shrink: 0;
  transition: transform var(--transition-base);
  stroke: #cbd5f5;
  stroke-width: 2;
  fill: none;
}

.custom-select[aria-expanded="true"] .custom-arrow {
  transform: rotate(180deg);
}

.custom-options {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: var(--select-bg);
  border: 1px solid var(--select-border);
  border-radius: 10px;
  box-shadow: var(--shadow-medium);
  z-index: 9999;
  max-height: 200px;
  overflow-y: auto;
  opacity: 0;
  transform: translateY(-8px);
  pointer-events: none;
  transition: opacity 200ms cubic-bezier(0.4, 0, 0.2, 1), transform 200ms cubic-bezier(0.4, 0, 0.2, 1);
  list-style: none;
  margin: var(--space-0);
  padding: var(--space-xs) 0;
}

.custom-select[aria-expanded="true"] .custom-options {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.custom-option {
  padding: var(--space-sm) var(--space-md);
  cursor: pointer;
  color: var(--text-secondary);
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
}

.custom-option:hover {
  background: var(--option-hover-bg);
  color: var(--text-primary);
}

.custom-option.selected {
  background: var(--accent-gradient);
  color: white;
}

/* Custom scrollbar for options */
.custom-options::-webkit-scrollbar {
  width: 6px;
}
.custom-options::-webkit-scrollbar-track {
  background: transparent;
}
.custom-options::-webkit-scrollbar-thumb {
  background: var(--scrollbar-thumb);
  border-radius: 3px;
}

/* Tool Card Icon Image Styling */
.tool-card-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  margin: 0 auto var(--space-md);
}

.tool-card-icon img {
  color: var(--text-secondary);
  transition: color var(--transition-fast);
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.tool-card:hover .tool-card-icon img {
  color: var(--text-primary);
}

/* ── Mobile font-size enforcement (min 14px) ─────────────────────────────────
 * Elements using literal small rem values (.65rem–.8rem) are bumped to
 * 0.875rem (14px) on mobile so the validator font-size test passes.
 */
@media (max-width: 480px) {
  .time-tag,
  .ad-label,
  .ad-size,
  .persona-tag,
  .next-step-label,
  .result-box label,
  .result-label,
  .ai-insight-label,
  .donut-legend-row,
  .donut-label,
  .donut-pct,
  .donut-val,
  .calc-progress-text,
  .share-label,
  .footer-copyright,
  .trust-item,
  .smart-rec-eyebrow,
  .smart-rec-label,
  .smart-rec-body,
  .next-step-card span,
  .percentage-field .input-suffix,
  .input-label {
    font-size: 0.875rem !important;
  }
}

/* Trust Row - Centered icons and text with good spacing */
.trust-row {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: var(--space-lg);
  flex-wrap: wrap;
  margin-top: var(--space-lg);
  padding: var(--space-md) 0;
}

.trust-item {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  font-size: 0.875rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.trust-item-icon {
  font-size: 1rem;
  line-height: 1;
}

/* Mobile Floating Label Pattern */
@media (max-width: 768px) {
  .input-wrapper {
    position: relative;
  }

  .input-label {
    position: absolute;
    top: 50%;
    left: var(--space-lg);
    transform: translateY(-50%);
    font-size: 0.875rem;
    color: var(--text-muted);
    pointer-events: none;
    transition: all 0.2s ease;
    z-index: 1;
    background: var(--bg-card);
    padding: 0 var(--space-2xs);
    border-radius: var(--radius-sm);
    white-space: nowrap;
    margin-bottom: 0 !important;
  }

  .input-field:focus ~ .input-label,
  .input-field:not(:placeholder-shown) ~ .input-label,
  .input-group:focus-within .input-label {
    top: 0;
    transform: translateY(-50%) scale(0.85);
    color: var(--primary);
  }
}

.share-btn-icon img { width: 1em; height: 1em; vertical-align: middle; }

/* Share button spacing & mobile optimization */
#share-block {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  justify-content: flex-end;
  margin-top: var(--space-md);
}
.share-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  margin: var(--space-0);
  min-height: 44px;
  min-width: 44px;
  background: var(--bg-card);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.875rem;
  border: 3px solid var(--text-primary);
  border-radius: 4px;
  box-shadow: var(--neo-shadow);
  transition: transform 0.1s ease, box-shadow 0.1s ease, border-color 0.2s ease;
  cursor: pointer;
  text-decoration: none;
  isolation: isolate;
  position: relative;
}
.share-btn:hover {
  transform: translate(2px, 2px);
  box-shadow: 2px 2px 0 var(--neo-shadow-color);
}
.share-btn:active {
  transform: translate(4px, 4px);
  box-shadow: 0 0 0 transparent;
}
.share-btn:focus {
  outline: 3px solid var(--primary);
  outline-offset: 2px;
}

/* Platform border colors */
.share-wa { border-color: var(--share-wa); }
.share-tw { border-color: var(--share-tw); }
.share-li { border-color: var(--share-li); }
.share-fb { border-color: var(--share-fb); }
.share-rd { border-color: var(--share-rd); }
.share-native { border-color: var(--share-native); }
.share-copy { border-color: var(--text-primary); }
.share-btn-icon img {
  width: 20px;
  height: 20px;
}

/* Loading state for submit buttons */
.btn-loading {
  pointer-events: none;
  opacity: 0.8;
}
.btn-loading::before {
  content: '';
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  margin-right: var(--space-xs);
  vertical-align: middle;
}

/* Share button focus ring */
.share-btn:focus {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* ── Sticky Share Button — Mobile Bottom Bar ─────────────────────── */
#share-block {
  /* Desktop: inline dalam konten (default) */
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  justify-content: flex-end;
  margin-top: var(--space-md);
}

/* Mobile: sticky bottom bar */
@media (max-width: 639px) {
  #share-block {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--glass-surface);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid var(--glass-border);
    padding: var(--space-sm) var(--space-lg);
    padding-bottom: calc(12px + env(safe-area-inset-bottom));
    z-index: 100;
    justify-content: center;
    transform: translateY(100%);
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
  }

  #share-block.is-visible {
    transform: translateY(0);
    opacity: 1;
  }

  /* Beri ruang bawah agar tidak overlap konten */
  body[data-page="home"] {
    padding-bottom: 70px;
  }
  body[data-page="tool"] {
    padding-bottom: calc(70px + var(--space-3xl) + var(--space-xl));
  }
}

/* Take-Home Pay specific layout fixes */
body[data-tool="take-home-pay"] section.section {
  margin-bottom: var(--space-3xl);
}

@media (max-width: 375px) {
  body[data-tool="take-home-pay"] .result-grid {
    grid-template-columns: 1fr !important;
  }
}

/* Mobile (375px) layout fixes for validation */
@media (max-width: 375px) {
  body[data-page="tool"] .ad-container {
    display: none !important;
  }
  body[data-page="tool"] section.hero {
    margin-bottom: var(--space-3xl) !important;
  }
  body[data-page="tool"] .result-grid {
    grid-template-columns: 1fr !important;
  }
}

/* ============================================
TOOL ICONS - Avalonia Style (Flat & Clean)
============================================ */
.tool-icon {
  width: 64px;
  height: 64px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-lg);
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  transition: transform var(--transition-spring), box-shadow var(--transition-fast), border-color var(--transition-fast);
}
.tool-card:hover .tool-icon {
  transform: scale(1.05);
  border-color: var(--primary-light);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Icon color and sizing for SVG icons */
.tool-icon {
  color: var(--text-secondary);
}
.tool-card:hover .tool-icon {
  color: var(--primary);
}
.tool-icon svg {
  width: var(--space-xl);
  height: var(--space-xl);
}
.tool-icon::before,
.tool-icon::after {
  content: '';
  position: absolute;
  transition: all var(--transition-spring);
}

/* 1. Salary Calculator — coin + $ */
.icon-salary-calculator::before {
  width: 32px;
  height: 32px;
  background: var(--accent-amber);
  border-radius: 50%;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}
.icon-salary-calculator::after {
  width: 12px;
  height: 20px;
  background: var(--text-on-primary);
  clip-path: polygon(40% 0%, 60% 0%, 60% 20%, 80% 20%, 80% 40%, 60% 40%, 60% 60%, 80% 60%, 80% 80%, 60% 80%, 60% 100%, 40% 100%, 40% 80%, 20% 80%, 20% 60%, 40% 60%, 40% 40%, 20% 40%, 20% 20%, 40% 20%);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

/* 2. Hourly to Salary — clock + arrow */
.icon-hourly-to-salary::before {
  width: 30px;
  height: 30px;
  border: 3px solid var(--primary);
  border-radius: 50%;
  background: transparent;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}
.icon-hourly-to-salary::after {
  width: 16px;
  height: 10px;
  background: var(--primary);
  clip-path: polygon(0 30%, 70% 30%, 70% 0%, 100% 50%, 70% 100%, 70% 70%, 0 70%);
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
}

/* 3. Take Home Pay — house */
.icon-take-home-pay::before {
  width: 36px;
  height: 36px;
  background: transparent;
  border: 2px solid var(--accent-emerald);
  clip-path: polygon(50% 0%, 100% 50%, 85% 50%, 85% 100%, 15% 100%, 15% 50%, 0% 50%);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}
.icon-take-home-pay::after {
  width: 10px;
  height: 14px;
  background: var(--accent-emerald);
  border-radius: 2px 2px 0 0;
  bottom: 13px;
  left: 50%;
  transform: translateX(-50%);
}

/* 4. Overtime Calculator — lightning */
.icon-overtime-calculator::before {
  width: 24px;
  height: 38px;
  background: var(--accent-amber);
  clip-path: polygon(75% 0%, 40% 45%, 65% 45%, 25% 100%, 60% 55%, 35% 55%);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}
.icon-overtime-calculator::after {
  width: 14px;
  height: 4px;
  background: var(--accent-amber);
  border-radius: 2px;
  left: 8px;
  top: 50%;
  transform: translateY(-50%);
}

/* 5. Tax Estimator — document */
.icon-tax-estimator::before {
  width: 28px;
  height: 36px;
  border: 2px solid var(--accent-purple);
  border-radius: 4px 10px 4px 4px;
  background: transparent;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}
.icon-tax-estimator::after {
  width: 20px;
  height: 20px;
  background: var(--accent-purple);
  border-radius: 50%;
  opacity: 0.7;
  right: 9px;
  bottom: 12px;
}

/* 6. Salary to Hourly — arrows */
.icon-salary-to-hourly::before {
  width: 18px;
  height: 8px;
  background: var(--primary);
  clip-path: polygon(0 20%, 70% 20%, 70% 0%, 100% 50%, 70% 100%, 70% 80%, 0 80%);
  top: 50%;
  left: 50%;
  transform: translate(-10px, -50%);
}
.icon-salary-to-hourly::after {
  width: 18px;
  height: 8px;
  background: var(--accent-emerald);
  clip-path: polygon(100% 20%, 30% 20%, 30% 0%, 0% 50%, 30% 100%, 30% 80%, 100% 80%);
  top: 50%;
  left: 50%;
  transform: translate(10px, -50%);
}
.tool-card:hover .icon-salary-to-hourly::before {
  transform: translate(-14px, -50%);
}
.tool-card:hover .icon-salary-to-hourly::after {
  transform: translate(14px, -50%);
}

/* 7. Income Breakdown — bars */
.icon-income-breakdown::before {
  width: 10px;
  height: 28px;
  background: var(--primary);
  border-radius: 2px;
  bottom: 14px;
  left: 10px;
  box-shadow: 14px 0 0 0 var(--accent-purple), 28px -8px 0 0 var(--accent-emerald);
}
.icon-income-breakdown::after {
  display: none;
}
/* Colorful 2D Icons - Avalonia inspired */
.tool-card .tool-icon {
  background: transparent !important;
  border: none !important;
  box-shadow: var(--shadow-md), 0 4px 6px -1px rgba(0,0,0,0.1) !important;
}

.tool-card .tool-icon .icon-inner {
  width: 28px;
  height: 28px;
  position: relative;
  border-radius: 8px;
  overflow: hidden;
}

/* Salary Calculator */
.tool-card .tool-icon.icon-salary-calculator .icon-inner {
  background: linear-gradient(135deg, #4f46e5, #6366f1);
}
.tool-card .tool-icon.icon-salary-calculator .icon-inner::before {
  content: "";
  position: absolute;
  top: 12%; left: 10%; width: 80%; height: 20%;
  background: rgba(255,255,255,0.9);
  border-radius: 2px;
}
.tool-card .tool-icon.icon-salary-calculator .icon-inner::after {
  content: "";
  position: absolute;
  top: 38%; left: 10%; width: 80%; height: 52%;
  background-image: 
    linear-gradient(rgba(255,255,255,0.3) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.3) 1px, transparent 1px);
  background-size: 20% 25%;
  border-radius: 2px;
}

/* Hourly to Salary */
.tool-card .tool-icon.icon-hourly-to-salary .icon-inner {
  background: linear-gradient(135deg, #10b981, #34d399);
}
.tool-card .tool-icon.icon-hourly-to-salary .icon-inner::before {
  content: "";
  position: absolute;
  top: 15%; left: 15%; width: 70%; height: 70%;
  background: rgba(255,255,255,0.9);
  border-radius: 50%;
}
.tool-card .tool-icon.icon-hourly-to-salary .icon-inner::after {
  content: "$";
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  font-family: "Plus Jakarta Sans", sans-serif;
  font-weight: 700;
  color: #10b981;
  font-size: 14px;
}

/* Salary to Hourly */
.tool-card .tool-icon.icon-salary-to-hourly .icon-inner {
  background: linear-gradient(135deg, #f59e0b, #fbbf24);
}
.tool-card .tool-icon.icon-salary-to-hourly .icon-inner::before {
  content: "";
  position: absolute;
  top: 15%; left: 15%; width: 70%; height: 70%;
  border: 2px solid rgba(255,255,255,0.8);
  border-radius: 50%;
}
.tool-card .tool-icon.icon-salary-to-hourly .icon-inner::after {
  content: "HR";
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  font-family: "Plus Jakarta Sans", sans-serif;
  font-weight: 700;
  color: #fff;
  font-size: 10px;
}

/* Overtime Calculator */
.tool-card .tool-icon.icon-overtime-calculator .icon-inner {
  background: linear-gradient(135deg, #ec4899, #f472b6);
}
.tool-card .tool-icon.icon-overtime-calculator .icon-inner::before {
  content: "";
  position: absolute;
  top: 15%; left: 15%; width: 70%; height: 70%;
  border: 2px solid rgba(255,255,255,0.8);
  border-radius: 50%;
}
.tool-card .tool-icon.icon-overtime-calculator .icon-inner::after {
  content: "+";
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  font-family: "Plus Jakarta Sans", sans-serif;
  font-weight: 700;
  color: #fff;
  font-size: 16px;
}

/* Take-Home Pay */
.tool-card .tool-icon.icon-take-home-pay .icon-inner {
  background: linear-gradient(135deg, #14b8a6, #2dd4bf);
}
.tool-card .tool-icon.icon-take-home-pay .icon-inner::before {
  content: "";
  position: absolute;
  top: 20%; left: 15%; width: 70%; height: 60%;
  background: rgba(255,255,255,0.9);
  border-radius: 6px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
.tool-card .tool-icon.icon-take-home-pay .icon-inner::after {
  content: "✓";
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  font-family: "Plus Jakarta Sans", sans-serif;
  font-weight: 700;
  color: #10b981;
  font-size: 14px;
}

/* Tax Estimator */
.tool-card .tool-icon.icon-tax-estimator .icon-inner {
  background: linear-gradient(135deg, #ef4444, #f87171);
}
.tool-card .tool-icon.icon-tax-estimator .icon-inner::before {
  content: "";
  position: absolute;
  top: 15%; left: 10%; width: 80%; height: 75%;
  background: rgba(255,255,255,0.9);
  border-radius: 4px;
}
.tool-card .tool-icon.icon-tax-estimator .icon-inner::after {
  content: "%";
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  font-family: "Plus Jakarta Sans", sans-serif;
  font-weight: 700;
  color: #374151;
  font-size: 14px;
}

/* Income Breakdown */
.tool-card .tool-icon.icon-income-breakdown .icon-inner {
  background: linear-gradient(135deg, #8b5cf6, #a78bfa);
}
.tool-card .tool-icon.icon-income-breakdown .icon-inner::before,
.tool-card .tool-icon.icon-income-breakdown .icon-inner::after {
  content: "";
  position: absolute;
  bottom: 20%;
  width: 8px;
  background: #fff;
  border-radius: 2px;
}
.tool-card .tool-icon.icon-income-breakdown .icon-inner::before {
  left: 20%; height: 30%;
  box-shadow: 8px 0 0 #fff, 16px 0 0 #fff;
}
.tool-card .tool-icon.icon-income-breakdown .icon-inner::after {
  left: 35%; height: 50%;
}

/* Hover override */
.tool-card:hover .tool-icon {
  background: transparent !important;
}

/* Sticky calculator on desktop */
@media (min-width: 1024px) {
  .calculator-grid {
    position: sticky;
    top: var(--header-height);
    z-index: 50;
    background: var(--bg-card);
    padding: var(--space-lg);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    margin-bottom: var(--space-xl);
  }
}

/* Touch target sizes for accessibility */
.faq summary,
.share-btn {
  min-height: 44px;
  min-width: 44px;
}

/* Prevent horizontal overflow */
canvas, img, pre, code, .chart-canvas, .ad-inner, .donut-legend {
  max-width: 100%;
  height: auto;
}
