/* ===================================================================
   Product PPWR Impact Assessment – Page Theme + Dashboard Styles
   =================================================================== */

/* ===== Product Page Dark Theme ===== */
body.product-page {
  background: #040E2F;
  color: #f5f8ff;
}

body.product-page .main-layout {
  min-height: 0;
  grid-template-columns: 340px minmax(0, 1fr);
  gap: 0;
  padding: 0 1.25rem 1.25rem;
  background: transparent;
}

body.product-page .input-panel {
  background: #040E2F;
  border-right: none;
  padding: 1.2rem 1.15rem 1.4rem;
  max-height: none;
  overflow-y: visible;
  position: static;
}

body.product-page .panel-title {
  color: #ffffff;
  border-bottom: none;
  margin-bottom: 0.95rem;
  padding-bottom: 0;
  font-size: 20px;
}

body.product-page .form-group {
  margin-bottom: 0.95rem;
}

body.product-page .form-group > label {
  color: rgba(255, 255, 255, 0.88);
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 0.38rem;
}

body.product-page select,
body.product-page input[type="text"],
body.product-page input[type="email"] {
  border: 1px solid rgba(196, 214, 255, 0.7);
  border-radius: 6px;
  background: rgba(9, 20, 47, 0.96);
  color: #eef3ff;
  min-height: 40px;
  padding: 0.55rem 0.65rem;
  font-size: 18px;
  font-weight: 400;
}

body.product-page select:focus,
body.product-page input[type="text"]:focus,
body.product-page input[type="email"]:focus {
  outline: none;
  border-color: #58a1ff;
  box-shadow: 0 0 0 2px rgba(88, 161, 255, 0.12);
}

body.product-page .response-language-picker {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(196, 214, 255, 0.2);
}
body.product-page .rlp-label {
  color: rgba(255, 255, 255, 0.5);
  font-size: 15px;
}
body.product-page .rlp-label svg {
  stroke: rgba(255, 255, 255, 0.45);
}
body.product-page .rlp-select {
  width: auto;
  min-height: unset;
  background: rgba(9, 20, 47, 0.96);
  color: #eef3ff;
  border-color: rgba(196, 214, 255, 0.35);
  font-size: 15px;
  padding: 0.22rem 0.45rem;
}
body.product-page .rlp-select option {
  background: #0b1531;
  color: #eef3ff;
}

body.product-page input::placeholder,
body.product-page textarea::placeholder {
  color: rgba(220, 230, 255, 0.38);
}

body.product-page .prompt-textarea {
  border: 1px solid rgba(196, 214, 255, 0.7);
  background: rgba(9, 20, 47, 0.96);
  color: #eef3ff;
  font-size: 18px;
}

@media (max-width: 900px) {
  body.product-page .prompt-textarea {
    height: 130px;
  }
}

body.product-page .prompt-textarea:focus {
  outline: none;
  border-color: #58a1ff;
  box-shadow: 0 0 0 2px rgba(88, 161, 255, 0.12);
}

body.product-page #submit-btn {
  display: inline-flex;
  width: 100%;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 999px;
  padding: 0.62rem 0.95rem;
  font-size: 18px;
  font-weight: 400;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
  margin-top: 0.35rem;
  background: #ff6458;
  color: #fff;
  box-shadow: 0 14px 30px rgba(255, 100, 88, 0.22);
}

body.product-page #submit-btn:hover {
  transform: translateY(-1px);
}

body.product-page #submit-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

body.product-page .output-panel {
  background: #040E2F;
  padding: 1rem 0 0 1rem;
  overflow-y: auto;
}

body.product-page .loading-inline {
  min-height: 260px;
  background: none;
  border: none;
  color: rgba(226, 234, 255, 0.7);
}

body.product-page .spinner {
  border-color: rgba(255, 255, 255, 0.12);
  border-top-color: #ff6458;
}

/* Hero section */
body.product-page .product-hero {
  position: relative;
  min-height: 330px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 3.5rem 1.5rem 4rem;
  background:
    radial-gradient(circle at 50% 35%, rgba(116, 89, 255, 0.24), transparent 18%),
    linear-gradient(180deg, rgba(4, 14, 47, 1) 0%, rgba(4, 14, 47, 1) 100%);
  margin-bottom: 0;
}

body.product-page .product-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.02), transparent 40%),
    radial-gradient(circle at 50% 40%, rgba(255, 255, 255, 0.06), transparent 32%);
  pointer-events: none;
}

body.product-page .product-hero-kicker,
body.product-page .product-hero h1 {
  position: relative;
  z-index: 1;
}

body.product-page .product-hero-kicker {
  color: #806cff;
  font-size: 0.9rem;
  margin-bottom: 0.9rem;
}

body.product-page .product-hero h1 {
  max-width: 100%;
  color: #fffaf2;
  font-size: clamp(2.2rem, 4vw, 4.1rem);
  line-height: 1.08;
  font-weight: 800;
  letter-spacing: -0.03em;
  white-space: normal;
}

@media (max-width: 900px) {
  body.product-page .product-hero {
    min-height: 240px;
    padding: 2.8rem 1rem 3rem;
  }
}

@media (max-width: 900px) {
  body.product-page .main-layout {
    grid-template-columns: 1fr;
    padding: 0 0.9rem 0.9rem;
  }

  body.product-page .input-panel {
    position: static;
    max-height: none;
    border-right: none;
    border-bottom: none;
    margin-top: 0.9rem;
  }

  body.product-page .output-panel {
    padding: 0.9rem 0 0;
  }
}

/* ===== Product Intro Card (empty state) ===== */
.product-intro-card {
  background: linear-gradient(135deg, #2e2680 0%, #3d35c0 20%, #4f46e5 45%, #6d3fd6 70%, #5b21b6 100%);
  border-radius: 20px;
  padding: 2rem 2rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin: 0.25rem 0;
}

.pic-top {}

.pic-heading {
  font-size: clamp(1.25rem, 2.5vw, 1.6rem);
  font-weight: 800;
  color: #ffffff;
  line-height: 1.2;
  margin-bottom: 0.75rem;
  letter-spacing: -0.01em;
}

.pic-subtitle {
  font-size: 1rem;
  color: rgba(255, 255, 255, 0.88);
  line-height: 1.6;
  margin: 0;
}

/* Inner dark contact form card */
.pic-contact-panel {
  background: rgba(10, 8, 45, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  padding: 1.25rem 1.5rem;
}

.pic-fields-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem 1.25rem;
}

@media (max-width: 700px) {
  .pic-fields-grid { grid-template-columns: 1fr; }
}

.pic-field-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.pic-field-group label {
  font-size: 0.88rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.9);
}

.pic-field-group input {
  background: rgba(15, 12, 60, 0.75) !important;
  border: 1px solid rgba(130, 150, 230, 0.45) !important;
  border-radius: 8px !important;
  color: #eef3ff !important;
  padding: 0.6rem 0.85rem !important;
  font-size: 0.9rem !important;
  min-height: 44px;
  transition: border-color 0.15s;
}

.pic-field-group input:focus {
  outline: none;
  border-color: rgba(180, 200, 255, 0.7) !important;
  box-shadow: 0 0 0 2px rgba(100, 130, 255, 0.15) !important;
}

.pic-field-group input::placeholder {
  color: rgba(180, 200, 255, 0.35) !important;
}

/* Inline field validation errors (base styles in style.css) */
body.product-page input.field-invalid,
body.product-page textarea.field-invalid,
.pic-field-group input.field-invalid {
  border-color: #e74c3c !important;
}

/* ToS checkbox row */
.pic-tos {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
}

.pic-tos input[type="checkbox"] {
  flex-shrink: 0;
  margin-top: 0.18rem;
  width: 16px;
  height: 16px;
  accent-color: #ff6458;
  cursor: pointer;
}

.pic-tos label {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.82);
  line-height: 1.5;
  cursor: pointer;
}

.pic-tos a {
  color: rgba(255, 255, 255, 0.95);
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: color 0.15s;
}

.pic-tos a:hover {
  color: #fff;
}

/* Disclaimer row */
.pic-disclaimer {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  color: rgba(255, 255, 255, 0.65);
}

.pic-disclaimer svg {
  flex-shrink: 0;
  margin-top: 0.1rem;
  opacity: 0.75;
}

.pic-disclaimer p {
  font-size: 0.82rem;
  line-height: 1.5;
  margin: 0;
}

/* ===================================================================
   Assessment Overlay
   =================================================================== */

.assessment-overlay {
  position: fixed;
  inset: 0;
  z-index: 600;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ao-bg {
  position: absolute;
  inset: 0;
  background: url('/product/product_assessment_background.png') center / cover no-repeat;
  filter: blur(6px) brightness(0.35);
  transform: scale(1.04); /* prevent blur edge bleed */
}

.ao-card {
  position: relative;
  z-index: 1;
  background: linear-gradient(135deg, #2e2680 0%, #3d35c0 20%, #4f46e5 50%, #6d28d9 85%, #5b21b6 100%);
  border-radius: 18px;
  padding: 2.25rem 2.5rem 2rem;
  max-width: 660px;
  width: calc(100% - 3rem);
  color: #fff;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.55);
}

/* Loading state inside card */
.ao-loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
  padding: 1rem 0;
}

.ao-spinner {
  border-color: rgba(255, 255, 255, 0.2) !important;
  border-top-color: #ff6458 !important;
  width: 44px !important;
  height: 44px !important;
}

.ao-loading-text {
  font-size: 1rem;
  color: rgba(255, 255, 255, 0.85);
}

.ao-cancel-btn {
  font-size: 0.85rem;
  padding: 0.4rem 1.1rem;
}

/* Success / error content */
.ao-heading {
  font-size: 1.25rem;
  font-weight: 800;
  color: #fff;
  margin-bottom: 0.9rem;
  line-height: 1.3;
}

.ao-body {
  font-size: 0.97rem;
  color: rgba(255, 255, 255, 0.88);
  line-height: 1.65;
  margin-bottom: 1.5rem;
}

.ao-body a {
  color: #fff;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.ao-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.ao-btn-coral,
.ao-btn-outline {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border-radius: 999px;
  padding: 0.55rem 1.4rem;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s, background 0.15s;
  border: none;
}

.ao-btn-coral {
  background: #ff6458;
  color: #fff;
  box-shadow: 0 8px 20px rgba(255, 100, 88, 0.3);
}

.ao-btn-coral:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgba(255, 100, 88, 0.4);
}

.ao-btn-outline {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.ao-btn-outline:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* ===================================================================
   Dashboard Styles (unchanged below)
   =================================================================== */

/* ===== Dashboard Container ===== */
.product-dashboard {
  background: #0a1628;
  color: #e0e8f0;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 4px 24px rgba(0,0,0,.4);
}

/* ===== Dashboard Header ===== */
.pd-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.pd-header h2 {
  font-size: 1.05rem;
  font-weight: 700;
  color: #fff;
  margin: 0;
}
.pd-header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.pd-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.15);
  color: rgba(255,255,255,.8);
  padding: 0.3rem 0.7rem;
  border-radius: 5px;
  cursor: pointer;
  font-size: 0.75rem;
  font-weight: 500;
  transition: background .15s;
}
.pd-action-btn:hover { background: rgba(255,255,255,.15); }
.pd-timestamp {
  font-size: 0.72rem;
  color: rgba(255,255,255,.45);
}

/* ===== Main Body Grid ===== */
.pd-body {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 1px;
  background: rgba(255,255,255,.06);
}
@media (max-width: 900px) {
  .pd-body { grid-template-columns: 1fr; }
}

.pd-left {
  background: #0d1b30;
  padding: 1.25rem;
}
.pd-right {
  background: #0a1628;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

/* ===== Section Title ===== */
.pd-section-title {
  font-size: 0.78rem;
  font-weight: 700;
  color: rgba(255,255,255,.6);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 0.75rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid rgba(255,255,255,.08);
}

/* ===== Product Card ===== */
.pd-product-card {
  margin-bottom: 1.25rem;
}
.pd-product-label {
  font-size: 0.72rem;
  font-weight: 600;
  color: rgba(255,255,255,.45);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.35rem;
}
.pd-product-name {
  font-size: 1.25rem;
  font-weight: 800;
  color: #fff;
  line-height: 1.3;
}

/* ===== Product Description ===== */
.pd-product-description {
  font-size: 0.82rem;
  color: rgba(255,255,255,.55);
  line-height: 1.4;
  margin-top: 0.35rem;
}

/* ===== Score + Insight Row ===== */
.pd-score-insight-row {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1.25rem;
  align-items: stretch;
}
@media (max-width: 900px) {
  .pd-score-insight-row { grid-template-columns: 1fr; }
}

/* ===== LLM Insight ===== */
.pd-insight-section {
  background: rgba(52,152,219,.08);
  border: 1px solid rgba(52,152,219,.25);
  border-radius: 8px;
  padding: 1rem;
  display: flex;
  flex-direction: column;
}
.pd-insight-text {
  font-size: 0.85rem;
  color: rgba(255,255,255,.75);
  line-height: 1.55;
  margin: 0;
}

/* ===== Radar + Alerts Row ===== */
.pd-radar-alerts-row {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 1.25rem;
}
@media (max-width: 900px) {
  .pd-radar-alerts-row { grid-template-columns: 1fr; }
}

/* ===== EPR Section (standalone row) ===== */
.pd-epr-section {
  background: rgba(255,255,255,.03);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 8px;
  padding: 1rem;
}

/* ===== Packaging Overview ===== */
.pd-pkg-card {
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 8px;
  padding: 0.85rem;
  margin-bottom: 0.75rem;
}
.pd-pkg-header {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  margin-bottom: 0.5rem;
}
.pd-pkg-icon {
  flex-shrink: 0;
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.pd-pkg-icon img {
  max-width: 52px;
  max-height: 52px;
  width: auto;
  height: auto;
}
.pd-pkg-tier {
  font-size: 0.78rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.35;
}
.pd-pkg-details {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.pd-pkg-field {
  font-size: 0.75rem;
  color: rgba(255,255,255,.65);
  line-height: 1.4;
}
.pd-pkg-label {
  font-weight: 600;
  color: rgba(255,255,255,.8);
}
.pd-packaging-empty {
  color: rgba(255,255,255,.35);
  font-size: 0.82rem;
  text-align: center;
  padding: 1rem 0;
}

/* ===== Scoring Row ===== */
.pd-scoring-card {
  background: rgba(255,255,255,.03);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 8px;
  padding: 1rem;
}
.pd-compliance-label {
  font-size: 0.8rem;
  font-weight: 700;
  color: rgba(255,255,255,.7);
  margin-bottom: 0.75rem;
  text-align: center;
}
.pd-score-highlight {
  font-weight: 800;
}

/* Donut */
.pd-donut-area {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.pd-donut-wrap {
  position: relative;
  width: 180px;
  height: 180px;
}
.pd-donut-wrap canvas {
  width: 180px !important;
  height: 180px !important;
}
.pd-donut-center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 2.4rem;
  font-weight: 900;
  color: #fff;
}

/* EPR body: chart + context side by side */
.pd-epr-body {
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
}

/* EPR Chart */
.pd-epr-chart-wrap {
  flex: 1 1 0;
  min-width: 0;
  height: 100px;
}

/* EPR Context panel */
.pd-epr-context {
  width: 320px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.pd-epr-context-block {
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 6px;
  padding: 0.75rem 0.9rem;
}
.pd-epr-context-heading {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: rgba(255,255,255,.45);
  margin-bottom: 0.6rem;
}
.pd-epr-scenario {
  margin-bottom: 0.55rem;
}
.pd-epr-scenario:last-child {
  margin-bottom: 0;
}
.pd-epr-scenario-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  color: rgba(255,255,255,.85);
  margin-bottom: 0.15rem;
}
.pd-epr-scenario-desc {
  font-size: 0.68rem;
  color: rgba(255,255,255,.5);
  line-height: 1.45;
}
.pd-epr-assumption {
  font-size: 0.68rem;
  color: rgba(255,255,255,.55);
  line-height: 1.5;
  margin-bottom: 0.25rem;
}
.pd-epr-assumption:last-child {
  margin-bottom: 0;
}

/* ===== Radar Section ===== */
.pd-radar-section {
  background: rgba(255,255,255,.03);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 8px;
  padding: 1rem;
}
.pd-radar-subtitle {
  font-weight: 400;
  font-size: 0.7rem;
  color: rgba(255,255,255,.4);
  text-transform: none;
}
.pd-radar-wrap {
  max-width: 420px;
  margin: 0 auto;
}
.pd-radar-legend {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 0.75rem;
}
.pd-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.72rem;
  font-weight: 600;
  color: rgba(255,255,255,.7);
}
.pd-legend-swatch {
  display: inline-block;
  width: 12px;
  height: 3px;
  border-radius: 2px;
}

/* ===== Alerts Section ===== */
.pd-alerts-section {
  background: rgba(255,255,255,.03);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 8px;
  padding: 1rem;
}
.pd-alert-card {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  padding: 0.65rem 0;
  border-bottom: 1px solid rgba(255,255,255,.06);
}
.pd-alert-card:last-child { border-bottom: none; }
.pd-alert-number {
  font-size: 0.82rem;
  font-weight: 700;
  color: rgba(255,255,255,.5);
  flex-shrink: 0;
  width: 1.2rem;
}
.pd-alert-body {
  flex: 1;
}
.pd-alert-title {
  font-size: 0.78rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 0.2rem;
  text-transform: uppercase;
}
.pd-alert-due {
  font-weight: 400;
  color: rgba(255,255,255,.5);
  font-size: 0.78rem;
}
.pd-alert-severity {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  font-size: 0.6rem;
  font-weight: 800;
  margin-right: 0.3rem;
  vertical-align: middle;
  text-transform: uppercase;
}
.pd-alert-info {
  background: #3498db;
  color: #fff;
}
.pd-alert-warning {
  background: #f1c40f;
  color: #1a1a2e;
}
.pd-alert-critical {
  background: #e74c3c;
  color: #fff;
}
.pd-alert-article {
  display: inline-block;
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  font-size: 0.68rem;
  font-weight: 600;
  background: rgba(255,255,255,.08);
  color: rgba(255,255,255,.6);
  margin-right: 0.3rem;
}
.pd-alert-category {
  font-size: 0.72rem;
  font-weight: 600;
  color: rgba(255,255,255,.5);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 0.15rem;
}
.pd-alert-deadline {
  font-size: 0.78rem;
  color: rgba(255,255,255,.55);
  margin-bottom: 0.25rem;
}
.pd-alert-desc {
  font-size: 0.75rem;
  color: rgba(255,255,255,.55);
  line-height: 1.4;
  vertical-align: middle;
}
.pd-alert-empty {
  color: rgba(255,255,255,.35);
  font-size: 0.82rem;
  text-align: center;
  padding: 0.75rem 0;
}

/* ===== Override usage footer for dark theme ===== */
.product-dashboard .usage-footer {
  color: rgba(255,255,255,.3);
  padding: 0.75rem 1.25rem;
  border-top: 1px solid rgba(255,255,255,.06);
}
