/* Kavach Pragya — public Directional Penalty Exposure scan
   Shell/form styles + report layout mirrored from Kavach_Pragya_Report_Template_preview.html
   (class prefix rp- / report- as used in index.html). */

:root {
  --ink: #14213d;
  --ink-soft: #2a2a28;
  --muted: #5b6472;
  --paper: #fafaf8;
  --panel: rgba(255, 255, 255, 0.92);
  --line: #d8dce3;
  --accent: #14213d;
  --accent-bright: #5aa9fa;
  --gold: #a9843f;
  --gold-rule: #d8be8a;
  --tan: #f4eee0;
  --danger: #8b1e2d;
  --badge-ok-bg: #e7f1ec;
  --badge-ok-fg: #2a6b4c;
  --badge-warn-bg: #fbeee1;
  --badge-warn-fg: #b8590a;
  --shadow: 0 12px 36px rgba(20, 33, 61, 0.12);
  --radius: 12px;
  --font-ui: "IBM Plex Sans", "Helvetica Neue", Arial, sans-serif;
  --font-serif: "Source Serif 4", Georgia, "Times New Roman", serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: var(--font-ui);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.55;
}

.page-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(ellipse 80% 55% at 12% -10%, rgba(90, 169, 250, 0.14), transparent 55%),
    radial-gradient(ellipse 70% 50% at 100% 0%, rgba(20, 33, 61, 0.12), transparent 50%),
    linear-gradient(165deg, #dde1e6 0%, #fafaf8 42%, #eef1f4 100%);
}

.page-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.35;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cpath d='M0 60h120M60 0v120' stroke='%2314213D' stroke-opacity='0.04'/%3E%3C/svg%3E");
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.site-header,
.shell,
.site-footer {
  width: min(920px, calc(100% - 2rem));
  margin-inline: auto;
}

.site-header {
  padding: 2.25rem 0 0.5rem;
}

.brand-name {
  margin: 0;
  font-family: var(--font-ui);
  font-size: clamp(1.75rem, 4.5vw, 2.35rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink);
  line-height: 1.1;
}

.brand-sub {
  margin: 0.35rem 0 0;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--accent-bright);
  letter-spacing: 0.01em;
}

.hero {
  padding: 1.75rem 0 1.25rem;
}

.hero-title {
  margin: 0 0 0.75rem;
  font-family: var(--font-serif);
  font-size: clamp(1.4rem, 3.2vw, 1.75rem);
  font-weight: 700;
  line-height: 1.25;
  color: var(--ink);
}

.hero-lead {
  margin: 0;
  max-width: 40rem;
  color: var(--muted);
  font-size: 1.02rem;
}

.form-panel,
.state-panel {
  background: var(--panel);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(20, 33, 61, 0.1);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.35rem 1.4rem 1.5rem;
}

.field {
  margin-bottom: 1.05rem;
}

label {
  display: block;
  font-weight: 600;
  font-size: 0.92rem;
  margin-bottom: 0.4rem;
  text-align: left;
}

.req,
.opt {
  font-weight: 500;
  font-size: 0.78rem;
  margin-left: 0.35rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.req {
  color: var(--gold);
}

.opt {
  color: var(--muted);
}

input,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.75rem 0.9rem;
  font: inherit;
  color: var(--ink);
  background: #fff;
}

input:focus,
textarea:focus {
  outline: 2px solid rgba(90, 169, 250, 0.4);
  border-color: var(--accent-bright);
}

.field-hint {
  margin: 0.4rem 0 0;
  font-size: 0.85rem;
  color: var(--muted);
  text-align: left;
}

.cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  margin-top: 0.35rem;
  padding: 0.85rem 1.1rem;
  border: 0;
  border-radius: 8px;
  background: linear-gradient(135deg, #1a2d52 0%, #14213d 100%);
  color: #fff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s ease, filter 0.15s ease;
}

.cta:hover:not(:disabled) {
  transform: translateY(-1px);
  filter: brightness(1.06);
}

.cta:disabled {
  opacity: 0.65;
  cursor: wait;
}

.form-error {
  margin: 0.85rem 0 0;
  color: var(--danger);
  font-weight: 600;
  font-size: 0.95rem;
  text-align: left;
}

.state-panel {
  margin-top: 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.spinner {
  width: 1.25rem;
  height: 1.25rem;
  border: 3px solid rgba(20, 33, 61, 0.15);
  border-top-color: var(--accent-bright);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ——— Report wrap (on-page result) ——— */

.report-wrap {
  margin-top: 1.35rem;
}

/* Document-wide defaults for report body copy; labels override below. */
.report-wrap p,
.rp-exec p,
.rp-details .detail-note,
.rp-upsell p,
.rp-upsell li,
.rp-validity,
.rp-tier-cta,
.rp-tier-board-note,
.rp-penalty-note,
.rp-chart-caption {
  text-align: justify;
}

.rp-brand-text,
.rp-brand-text span,
.rp-type-strip,
.rp-eyebrow,
.rp-section-title,
.rp-stat-label,
.rp-penalty-figure,
.rp-findings th,
.rp-findings td,
.detail-head .name,
.badge,
.rp-upsell h3,
.rp-idline,
.rp-prepared,
.rp-tier-list li span,
.rp-tier-list li strong {
  text-align: left;
}

.rp-meta-block {
  text-align: right;
}

.report-page {
  background: #fafaf8;
  border: 1px solid rgba(20, 33, 61, 0.08);
  box-shadow: 0 8px 30px rgba(20, 33, 61, 0.14);
  margin-bottom: 1.25rem;
  overflow: hidden;
}

.rp-header {
  background: #14213d;
  color: #fff;
  display: flex;
  justify-content: space-between;
  align-items: stretch;
  min-height: 4.75rem;
}

.rp-header-compact {
  min-height: 3.5rem;
}

.rp-brand-row {
  display: flex;
  align-items: stretch;
  padding-right: 0.65rem;
  min-width: 0;
}

.rp-logo-cell {
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 1.1rem;
  flex-shrink: 0;
}

.rp-logo-cell img {
  height: 2.35rem;
  width: auto;
  display: block;
}

.rp-header-compact .rp-logo-cell img {
  height: 1.9rem;
}

.rp-brand-text-cell {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-left: 1rem;
  min-width: 0;
}

.rp-brand-text {
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: 1.1rem;
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rp-header-compact .rp-brand-text {
  font-size: 0.95rem;
}

.rp-brand-text span {
  display: block;
  font-weight: 500;
  font-size: 0.72rem;
  letter-spacing: 0.2px;
  color: #5aa9fa;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rp-meta-block {
  flex-shrink: 0;
  align-self: center;
  padding-right: 1.15rem;
  font-family: "Courier New", monospace;
  font-size: 0.72rem;
  line-height: 1.7;
  color: #cbd3e1;
}

.rp-confidential {
  display: inline-block;
  margin-top: 5px;
  padding: 3px 9px;
  border: 1px solid #7c88a3;
  border-radius: 2px;
  color: #fff;
  letter-spacing: 1px;
  font-size: 0.72rem;
}

.rp-type-strip {
  background: #a9843f;
  color: #fff;
  padding: 0.4rem 1.5rem;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.4px;
}

.rp-gold-rule {
  height: 3px;
  background: #d8be8a;
}

.rp-body {
  padding: 1.15rem 1.5rem 1.35rem;
  text-align: justify;
}

.rp-prepared {
  font-size: 0.9rem;
  color: #5b6472;
  margin: 0 0 1.1rem;
}

.rp-prepared strong {
  color: #14213d;
}

.rp-exec {
  background: #f4eee0;
  border-left: 4px solid #a9843f;
  padding: 0.95rem 1.05rem;
  margin-bottom: 1.25rem;
}

.rp-eyebrow {
  font-family: "Courier New", monospace;
  font-size: 0.68rem;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: #a9843f;
  margin-bottom: 6px;
  font-weight: 700;
}

.rp-exec p {
  font-family: var(--font-serif);
  font-size: 0.98rem;
  line-height: 1.55;
  margin: 0;
  color: #2a2a28;
}

.rp-section-title {
  font-family: var(--font-serif);
  font-size: 0.98rem;
  font-weight: 700;
  margin: 0 0 0.75rem;
  padding-bottom: 6px;
  border-bottom: 1px solid #d8dce3;
  color: #14213d;
}

.rp-stat-row {
  display: flex;
  gap: 1.15rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}

.rp-stat-box {
  flex: 1 1 240px;
  border: 1px solid #d8dce3;
  border-radius: 3px;
  padding: 0.9rem 1rem;
  background: #fff;
}

.rp-stat-label {
  font-size: 0.68rem;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: #5b6472;
  font-weight: 600;
  margin-bottom: 6px;
}

.rp-chart-host {
  width: 100%;
  overflow: hidden;
  min-height: 2.5rem;
}

.rp-chart-host svg {
  display: block;
  width: 100%;
  height: auto;
}

.rp-chart-caption {
  margin: 0.45rem 0 0;
  font-size: 0.78rem;
  color: #5b6472;
  text-align: left;
  line-height: 1.45;
}

.rp-penalty-figure {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 1.35rem;
  color: #b8590a;
  line-height: 1.25;
  margin: 0.15rem 0;
}

.rp-penalty-note {
  font-size: 0.72rem;
  color: #5b6472;
  margin: 0.4rem 0 0;
  line-height: 1.5;
}

table.rp-findings {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 0.35rem;
}

table.rp-findings th {
  text-align: left;
  font-size: 0.68rem;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: #5b6472;
  font-weight: 600;
  padding: 0 0 7px;
  border-bottom: 1px solid #d8dce3;
}

table.rp-findings td {
  padding: 9px 0;
  border-bottom: 1px solid #d8dce3;
  font-size: 0.9rem;
  text-align: left;
  vertical-align: middle;
}

table.rp-findings tr:last-child td {
  border-bottom: none;
}

.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
}

.badge.ok {
  background: #e7f1ec;
  color: #2a6b4c;
}

.badge.warn {
  background: #fbeee1;
  color: #b8590a;
}

.rp-details {
  margin-bottom: 1.1rem;
}

.detail-item {
  padding: 0.7rem 0;
  border-bottom: 1px solid #d8dce3;
}

.detail-item:last-child {
  border-bottom: none;
}

.detail-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.75rem;
  margin-bottom: 3px;
  flex-wrap: wrap;
}

.detail-head .name {
  font-weight: 600;
  font-size: 0.9rem;
  color: #14213d;
}

.detail-note {
  font-size: 0.82rem;
  color: #5b6472;
  line-height: 1.5;
  margin: 0;
}

.rp-upsell {
  background: #14213d;
  color: #fff;
  padding: 1.05rem 1.15rem;
  margin: 0.5rem 0 1.15rem;
  border-radius: 3px;
}

.rp-upsell .rp-eyebrow {
  color: #d8be8a;
}

.rp-upsell h3 {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  margin: 0 0 8px;
  color: #fff;
}

.rp-upsell p {
  font-size: 0.82rem;
  line-height: 1.6;
  color: #dde3ee;
  margin: 0 0 8px;
}

.rp-upsell ul {
  margin: 0;
  padding: 0 0 0 1.1rem;
  font-size: 0.82rem;
  line-height: 1.7;
  color: #dde3ee;
  text-align: left;
}

.rp-tiers {
  background: #f4eee0;
  border-left: 4px solid #a9843f;
  padding: 0.95rem 1.05rem;
  margin-bottom: 1.15rem;
}

.rp-tiers .rp-eyebrow {
  margin-bottom: 0.65rem;
}

.rp-tier-list {
  list-style: none;
  margin: 0 0 0.75rem;
  padding: 0;
}

.rp-tier-list li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding: 0.4rem 0;
  border-bottom: 1px solid rgba(169, 132, 63, 0.25);
  font-size: 0.88rem;
}

.rp-tier-list li:last-child {
  border-bottom: none;
}

.rp-tier-list li span {
  color: #2a2a28;
  flex: 1;
}

.rp-tier-list li strong {
  color: #14213d;
  font-family: var(--font-serif);
  font-weight: 700;
  white-space: nowrap;
  text-align: right;
}

.rp-tier-board-note {
  margin: 0.65rem 0 0.75rem;
  font-size: 0.82rem;
  color: #5b6472;
  line-height: 1.5;
  text-align: justify;
}

.rp-tier-cta {
  margin: 0;
  font-size: 0.82rem;
  color: #5b6472;
  line-height: 1.5;
}

.rp-footer {
  padding-top: 0.9rem;
  border-top: 1px solid #d8dce3;
  margin-top: 0.35rem;
}

.rp-validity {
  font-size: 0.72rem;
  color: #5b6472;
  line-height: 1.6;
  margin: 0;
}

.rp-idline {
  font-family: "Courier New", monospace;
  font-size: 0.7rem;
  color: #9aa3b2;
  margin-top: 8px;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.export-actions {
  margin: 1rem 0 0.35rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.cta-secondary {
  background: #fff;
  color: #14213d;
  border: 1px solid rgba(20, 33, 61, 0.28);
  box-shadow: none;
}

.cta-secondary:hover:not(:disabled) {
  background: rgba(20, 33, 61, 0.05);
  filter: none;
}

.email-panel {
  margin-top: 1.15rem;
  padding: 1.2rem 1.25rem 1.35rem;
  background: var(--panel);
  border: 1px solid rgba(20, 33, 61, 0.1);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.email-panel h3 {
  margin: 0 0 0.35rem;
  font-family: var(--font-serif);
  font-size: 1.15rem;
  text-align: left;
}

.email-help {
  margin: 0 0 1rem;
  color: var(--muted);
  font-size: 0.92rem;
  text-align: left;
}

textarea {
  resize: vertical;
  min-height: 14rem;
  line-height: 1.45;
}

.email-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.25rem;
}

.copy-status {
  font-size: 0.9rem;
  font-weight: 600;
  color: #14213d;
}

.site-footer {
  padding: 2rem 0 2.5rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.site-footer p {
  margin: 0.2rem 0;
  text-align: left;
}

.footer-note {
  font-size: 0.82rem;
}

@media (min-width: 720px) {
  .cta {
    width: auto;
    min-width: 12rem;
    padding-inline: 1.6rem;
  }
}

@media (max-width: 640px) {
  .rp-header {
    flex-direction: column;
  }

  .rp-meta-block {
    text-align: left;
    padding: 0.55rem 1rem 0.75rem;
    border-top: 1px solid rgba(124, 136, 163, 0.35);
  }

  .rp-brand-text,
  .rp-brand-text span {
    white-space: normal;
  }
}
