/* Profilecode shared components.
   Additive: existing pages keep their inline styles until regenerated (P3/P4).
   All classes are pc- prefixed to avoid collisions with legacy inline CSS. */

.pc-page {
  font-family: var(--pc-font);
  line-height: var(--pc-lh);
  color: var(--pc-text);
  background: var(--pc-bg);
  margin: 0;
}

/* Card */
.pc-card {
  background: var(--pc-surface);
  border: 1px solid var(--pc-border);
  border-radius: var(--pc-radius-lg);
  box-shadow: var(--pc-shadow-md);
  padding: var(--pc-sp-8);
}
.pc-card--flat {
  box-shadow: none;
  border: 1px solid var(--pc-border);
}
a.pc-card:hover,
.pc-card--link:hover {
  transform: translateY(-3px);
  box-shadow: var(--pc-shadow-lg);
  border-color: var(--pc-accent-1);
}
a.pc-card,
.pc-card--link {
  display: block;
  text-decoration: none;
  color: inherit;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

/* Buttons */
.pc-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 30px;
  border: none;
  border-radius: var(--pc-radius-pill);
  font-family: inherit;
  font-size: var(--pc-fs-base);
  font-weight: 700;
  text-decoration: none;
  text-align: center;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
  min-height: 48px;
}
.pc-btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--pc-shadow-lg);
}
.pc-btn:active {
  transform: translateY(0);
}
.pc-btn:focus-visible {
  outline: 3px solid var(--pc-accent-2);
  outline-offset: 2px;
}
.pc-btn--primary {
  background: var(--pc-gradient);
  background-image: linear-gradient(135deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0) 55%),
    var(--pc-gradient);
  color: #fff;
  box-shadow: var(--pc-shadow-sm);
}
.pc-btn--ghost {
  background: var(--pc-surface);
  color: var(--pc-brand);
  border: 2px solid var(--pc-brand);
}
.pc-btn--soft {
  background: var(--pc-brand-soft);
  color: var(--pc-brand-dark);
}
.pc-btn--block {
  display: flex;
  width: 100%;
}

/* Gradient hero header */
.pc-hero {
  position: relative;
  background: var(--pc-gradient);
  color: #fff;
  padding: var(--pc-sp-15) var(--pc-sp-5);
  text-align: center;
  overflow: hidden;
}
.pc-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 15% 20%, rgba(255, 255, 255, 0.16), transparent 45%),
    radial-gradient(circle at 85% 80%, rgba(255, 255, 255, 0.12), transparent 50%);
  pointer-events: none;
}
.pc-hero > * {
  position: relative;
  z-index: 1;
}
.pc-hero--typed {
  background: linear-gradient(135deg, var(--type-primary) 0%, var(--type-secondary) 100%);
}
.pc-hero h1 {
  margin: 0 0 var(--pc-sp-3);
  font-size: var(--pc-fs-hero);
}
.pc-hero .pc-hero-sub {
  font-size: var(--pc-fs-md);
  opacity: 0.92;
  margin: 0;
}

/* Progress bar */
.pc-progress {
  width: 100%;
  height: 8px;
  background: var(--pc-border);
  border-radius: var(--pc-radius-pill);
  overflow: hidden;
}
.pc-progress__fill {
  height: 100%;
  background: var(--pc-gradient);
  border-radius: var(--pc-radius-pill);
  transition: width 0.3s ease;
}

/* Tabs */
.pc-tabs {
  display: flex;
  gap: var(--pc-sp-2);
  flex-wrap: wrap;
  border-bottom: 2px solid var(--pc-border);
  margin-bottom: var(--pc-sp-6);
}
.pc-tab {
  padding: 10px 18px;
  border: none;
  background: none;
  font-family: inherit;
  font-size: var(--pc-fs-base);
  font-weight: 600;
  color: var(--pc-text-muted);
  cursor: pointer;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  transition: color 0.15s ease, border-color 0.15s ease;
}
.pc-tab:hover {
  color: var(--pc-brand);
}
.pc-tab.active {
  color: var(--pc-brand);
  border-bottom-color: var(--pc-brand);
}

/* Score bar (result screens) */
.pc-score {
  margin-bottom: var(--pc-sp-4);
}
.pc-score__labels {
  display: flex;
  justify-content: space-between;
  font-size: var(--pc-fs-sm);
  color: var(--pc-text-soft);
  margin-bottom: var(--pc-sp-1);
}
.pc-score__value {
  font-weight: 700;
  color: var(--pc-text);
}
.pc-score__bar {
  height: 12px;
  background: var(--pc-border);
  border-radius: var(--pc-radius-pill);
  overflow: hidden;
}
.pc-score__fill {
  height: 100%;
  background: linear-gradient(90deg, var(--type-primary), var(--type-secondary));
  border-radius: var(--pc-radius-pill);
  transition: width 0.6s ease;
}

/* Badge */
.pc-badge {
  display: inline-block;
  padding: 4px 14px;
  border-radius: var(--pc-radius-pill);
  background: var(--type-soft);
  color: var(--type-primary);
  font-size: var(--pc-fs-sm);
  font-weight: 700;
  letter-spacing: 0.04em;
}

/* Character avatar frame */
.pc-avatar {
  width: 160px;
  height: 160px;
  border-radius: 50%;
  background: var(--type-soft);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.pc-avatar img {
  width: 100%;
  height: 100%;
  display: block;
}
.pc-avatar--sm {
  width: 96px;
  height: 96px;
}

/* Footer */
.pc-footer {
  margin-top: var(--pc-sp-15);
  padding: var(--pc-sp-8) var(--pc-sp-5);
  border-top: 1px solid var(--pc-border);
  font-size: var(--pc-fs-sm);
  color: var(--pc-text-muted);
  text-align: center;
}
.pc-footer a {
  color: var(--pc-brand);
  text-decoration: none;
  margin: 0 var(--pc-sp-3);
}
.pc-footer a:hover {
  text-decoration: underline;
}

@media (max-width: 768px) {
  .pc-card {
    padding: var(--pc-sp-5);
    border-radius: var(--pc-radius-md);
  }
  .pc-hero {
    padding: var(--pc-sp-10) var(--pc-sp-4);
  }
  .pc-btn {
    width: 100%;
  }
  .pc-avatar {
    width: 120px;
    height: 120px;
  }
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid var(--pc-accent-2);
  outline-offset: 2px;
  border-radius: var(--pc-radius-sm);
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  .pc-btn:hover,
  a.pc-card:hover,
  .pc-card--link:hover {
    transform: none !important;
  }
}
