/* ==========================================================================
   FINARY CANDIDATE DOSSIER - STYLESHEET
   Authentic High-Craft Fintech UI inspired by Finary's Portfolio Suite
   ========================================================================== */

/* Typography Imports: Satoshi (Geometric Brand Sans) & Newsreader (Editorial Quote Italic) */
@import url('https://api.fontshare.com/v2/css?f[]=satoshi@300,400,500,600,700,900&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Newsreader:ital,opsz,wght@1,6..72,400;1,6..72,500&display=swap');

:root {
  /* Color Palette - Authentic Finary Dark Theme */
  --bg-canvas: #090a0d;
  --bg-surface: #14161b;
  --bg-card: #15171c;
  --bg-card-back: #13151a;
  --bg-modal: #121418;
  
  /* Borders & Dividers */
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-medium: rgba(255, 255, 255, 0.16);
  --border-focus: rgba(245, 200, 115, 0.6);

  /* Accents & Brand Signals */
  --gold-primary: #f5c873;
  --gold-hover: #ffd98a;
  --gold-subtle: rgba(245, 200, 115, 0.12);
  
  --blue-tag: #2a4374;
  --blue-tag-text: #8ab4f8;
  --blue-tag-bg: rgba(66, 133, 244, 0.18);
  
  /* Treemap Category Hues (Authentic Finary Allocation) */
  --treemap-finance: #c03875;
  --treemap-frontend: #389456;
  --treemap-backend: #335fc9;
  --treemap-data: #a65e2e;
  --treemap-architecture: #28808d;

  /* Typography */
  --text-primary: #ffffff;
  --text-secondary: #9da4b0;
  --text-muted: #626978;
  --text-accent: #f5c873;
  
  /* Geometry & Neutral Elevation Shadows */
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;
  
  --shadow-card: 0 12px 32px rgba(0, 0, 0, 0.55);
  --shadow-elevated: 0 20px 48px rgba(0, 0, 0, 0.75), 0 0 0 1px rgba(255, 255, 255, 0.08);
  --shadow-modal: 0 36px 90px rgba(0, 0, 0, 0.9), 0 0 0 1px rgba(255, 255, 255, 0.12);
  
  /* Transitions */
  --transition-fast: 160ms cubic-bezier(0.16, 1, 0.3, 1);
  --transition-normal: 260ms cubic-bezier(0.16, 1, 0.3, 1);
  --transition-flip: 550ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* Base Reset & Typography */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  width: 100%;
  min-height: 100vh;
  background-color: var(--bg-canvas);
  color: var(--text-primary);
  font-family: 'Satoshi', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* Custom Themed Browser Surfaces */
::selection {
  background-color: var(--gold-primary);
  color: #0c0d10;
}

::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-canvas);
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.16);
  border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.28);
}

:focus-visible {
  outline: 2px solid var(--border-focus);
  outline-offset: 3px;
}

/* Layout Canvas */
.app-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  min-height: 100vh;
  padding: 56px 24px 130px;
  position: relative;
}

/* Background Subtle Ambience */
.app-container::before {
  content: '';
  position: fixed;
  top: -12%;
  left: 50%;
  transform: translateX(-50%);
  width: 85vw;
  max-width: 1200px;
  height: 540px;
  background: radial-gradient(circle, rgba(42, 67, 116, 0.12) 0%, rgba(9, 10, 13, 0) 70%);
  pointer-events: none;
  z-index: 0;
}

/* Header Section */
.header {
  position: relative;
  z-index: 1;
  text-align: center;
  max-width: 860px;
  margin-bottom: 46px;
}

.header-title {
  font-size: 2.35rem;
  font-weight: 400;
  letter-spacing: -0.025em;
  color: var(--text-primary);
  margin-bottom: 14px;
  line-height: 1.25;
}

.header-title sup {
  font-size: 0.55em;
  top: -0.5em;
}

.header-subtitle {
  font-family: 'Newsreader', Georgia, serif;
  font-size: 1.18rem;
  font-style: italic;
  font-weight: 400;
  color: var(--text-secondary);
  line-height: 1.6;
  max-width: 740px;
  margin: 0 auto;
}

/* Main 6-Cards Grid */
.cards-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
  width: 100%;
  max-width: 980px;
}

/* ==========================================================================
   CARD CONTAINER & 3D FLIP ARCHITECTURE
   ========================================================================== */
.card-container {
  perspective: 1200px;
  position: relative;
  min-height: 330px;
  height: 100%;
}

.card-flipper {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform var(--transition-flip);
  transform: rotateX(var(--rotate-x, 0deg)) rotateY(var(--rotate-y, 0deg));
  will-change: transform;
}

.card-container.is-tracking .card-flipper {
  transition: transform 0.08s ease-out;
}

.card-container.is-flipped .card-flipper {
  transform: rotateX(calc(-1 * var(--rotate-x, 0deg))) rotateY(calc(180deg - var(--rotate-y, 0deg)));
}

/* Card Faces */
.card-face {
  position: absolute;
  inset: 0;
  border-radius: var(--radius-lg);
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-card);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: border-color 0.3s ease, box-shadow 0.35s ease;
}

.card-face > * {
  position: relative;
  z-index: 3;
}

.card-container.is-flipped .card-face-front {
  pointer-events: none;
}

.card-container:not(.is-flipped) .card-face-back {
  pointer-events: none;
}

/* Hover Glow & Gradient Contour (Bleu Saphir / Or / Transparent) */
.card-container:hover .card-face {
  border-color: rgba(47, 110, 232, 0.35);
  box-shadow: 0 16px 42px rgba(0, 0, 0, 0.7),
              0 0 28px -4px rgba(47, 110, 232, 0.32),
              0 0 36px -6px rgba(245, 200, 115, 0.22);
}

/* Dynamic Luminous Gradient Contour on Border matching 3D Icon Colors */
.card-face::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  padding: 1.5px;
  background:
    radial-gradient(
      340px circle at var(--mouse-x, 50%) var(--mouse-y, 50%),
      rgba(255, 255, 255, 0.6) 0%,
      rgba(245, 200, 115, 0.9) 30%,
      rgba(47, 110, 232, 0.85) 60%,
      transparent 90%
    ),
    linear-gradient(
      135deg,
      rgba(47, 110, 232, 0.8) 0%,
      rgba(245, 200, 115, 0.75) 45%,
      rgba(47, 110, 232, 0.3) 75%,
      transparent 100%
    );
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 2;
}

/* Surface Ambient Sheen */
.card-face::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(
    360px circle at var(--mouse-x, 50%) var(--mouse-y, 50%),
    rgba(245, 200, 115, 0.1) 0%,
    rgba(47, 110, 232, 0.08) 45%,
    transparent 80%
  );
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 1;
}

.card-container:hover .card-face::before,
.card-container:hover .card-face::after {
  opacity: 1;
}

/* FACE AVANT (FRONT) */
.card-face-front {
  align-items: center;
  justify-content: center;
  padding: 38px 24px 30px;
  cursor: pointer;
  user-select: none;
}

.card-icon-wrapper {
  position: relative;
  width: 110px;
  height: 110px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 22px;
  transition: transform var(--transition-normal);
}

.card-container:hover .card-face-front .card-icon-wrapper {
  transform: scale(1.05) translateY(-3px);
}

.card-icon {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.6));
}

/* Card Front Label - Animated Gold Fill Left-to-Right on Hover & Reverse on Leave */
.card-label {
  font-size: 1.08rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  margin-top: 4px;
  display: inline-block;
  background: linear-gradient(
    90deg,
    var(--gold-primary) 0%,
    var(--gold-primary) 50%,
    #ffffff 50%,
    #ffffff 100%
  );
  background-size: 200% 100%;
  background-position: 100% 0;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  transition: background-position 0.42s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: background-position;
}

.card-container:hover .card-label {
  background-position: 0% 0;
}

/* ==========================================================================
   FACE ARRIÈRE (BACK) - Minimaliste & Subtilement Dorée
   ========================================================================== */
.card-face-back {
  transform: rotateY(180deg);
  background: radial-gradient(circle at center, rgba(245, 200, 115, 0.09) 0%, var(--bg-card-back) 70%);
  border: 1px solid rgba(245, 200, 115, 0.24);
  box-shadow: var(--shadow-card), inset 0 0 28px rgba(245, 200, 115, 0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.card-back-minimal {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  pointer-events: none;
}

.card-back-emblem {
  width: 76px;
  height: 76px;
  display: flex;
  align-items: center;
  justify-content: center;
  filter: drop-shadow(0 6px 18px rgba(245, 200, 115, 0.2));
  opacity: 0.85;
}

.card-back-emblem-icon {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* ==========================================================================
   CONTACT POPOVERS (PHONE & EMAIL)
   ========================================================================== */
.action-bar-item {
  position: relative;
  display: inline-flex;
}

.contact-popover {
  position: absolute;
  bottom: calc(100% + 14px);
  left: 50%;
  transform: translateX(-50%) translateY(8px) scale(0.96);
  background: rgba(18, 20, 26, 0.96);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--border-medium);
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.85), 0 0 0 1px rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-full);
  padding: 6px 8px 6px 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.22s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.22s cubic-bezier(0.16, 1, 0.3, 1),
              visibility 0.22s;
  z-index: 60;
}

/* Little bottom arrow */
.contact-popover::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: rgba(18, 20, 26, 0.96);
}

.contact-popover.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0) scale(1);
}

.contact-popover-send {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-full);
  background: var(--gold-subtle);
  border: 1px solid rgba(245, 200, 115, 0.35);
  color: var(--gold-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  transition: all var(--transition-fast);
  cursor: pointer;
  flex-shrink: 0;
}

.contact-popover-send:hover {
  background: var(--gold-primary);
  color: #0c0d10;
  transform: scale(1.06);
}

.contact-popover-text {
  font-family: 'Satoshi', -apple-system, sans-serif;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-primary);
  user-select: all;
  letter-spacing: 0.01em;
  padding: 0 4px;
}

.contact-popover-copy {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
  flex-shrink: 0;
}

.contact-popover-copy:hover {
  background: rgba(255, 255, 255, 0.16);
  color: var(--text-primary);
}

.contact-popover-copy.copied {
  background: rgba(74, 222, 128, 0.16);
  border-color: rgba(74, 222, 128, 0.45);
  color: #4ade80;
}

/* ==========================================================================
   BOTTOM ACTION BAR
   ========================================================================== */
.action-bar {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: rgba(18, 20, 25, 0.88);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-full);
  box-shadow: var(--shadow-elevated);
}

.pill-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 10px 18px;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-secondary);
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-full);
  cursor: pointer;
  text-decoration: none;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.pill-btn:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.07);
  border-color: var(--border-subtle);
}

.pill-btn-primary {
  background: var(--gold-primary);
  color: #0c0d10;
  font-weight: 600;
  border-color: var(--gold-primary);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
}

.pill-btn-primary:hover {
  background: var(--gold-hover);
  color: #0c0d10;
  border-color: var(--gold-hover);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.5);
}

/* ==========================================================================
   MODAL OVERLAY (EXPANDED DETAILED CARDS)
   ========================================================================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(5, 6, 9, 0.82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--transition-normal), visibility var(--transition-normal);
}

.modal-backdrop.active {
  opacity: 1;
  visibility: visible;
}

.modal-content {
  position: relative;
  background: var(--bg-modal);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 680px;
  max-height: 88vh;
  overflow-y: auto;
  box-shadow: var(--shadow-modal);
  padding: 42px 38px 36px;
  transform: perspective(1000px) rotateY(-12deg) scale(0.94);
  transition: transform var(--transition-flip), opacity var(--transition-normal);
}

.modal-backdrop.active .modal-content {
  transform: perspective(1000px) rotateY(0deg) scale(1);
}

.modal-close-btn {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 34px;
  height: 34px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.modal-close-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: var(--text-primary);
}

.modal-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-bottom: 30px;
}

.modal-header-icon {
  width: 72px;
  height: 72px;
  object-fit: contain;
  margin-bottom: 14px;
  filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.6));
}

.modal-header-label {
  font-size: 0.88rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-primary);
}

.modal-header-rule {
  width: 50px;
  height: 2px;
  background: var(--gold-primary);
  margin-top: 14px;
  border-radius: 2px;
}

/* Modal Content Modules */
.profil-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.profil-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.profil-row:last-child {
  border-bottom: none;
}

.profil-key {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.profil-val {
  color: var(--text-primary);
  font-weight: 500;
  font-size: 0.95rem;
  text-align: right;
}

/* Treemap Full */
.patrimoine-stats-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  font-size: 0.92rem;
  flex-wrap: wrap;
  gap: 12px;
}

.stat-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

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

.stat-item-value {
  color: var(--text-primary);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.stat-highlight {
  background: rgba(66, 133, 244, 0.22);
  color: #9cbdf8;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(100, 160, 255, 0.3);
}

.treemap-container {
  width: 100%;
  height: 220px;
  display: grid;
  grid-template-columns: 65% 35%;
  gap: 5px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  margin-bottom: 22px;
}

.treemap-primary-col {
  background: var(--treemap-finance);
  border-radius: var(--radius-sm);
  padding: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: #ffffff;
  cursor: pointer;
  transition: filter var(--transition-fast);
}

.treemap-primary-col:hover {
  filter: brightness(1.12);
}

.treemap-primary-val {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.treemap-primary-desc {
  font-size: 0.88rem;
  opacity: 0.92;
}

.treemap-secondary-col {
  display: grid;
  grid-template-rows: 55% 45%;
  gap: 5px;
}

.treemap-sub-top {
  background: var(--treemap-frontend);
  border-radius: var(--radius-sm);
  padding: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  font-weight: 600;
  color: #ffffff;
  cursor: pointer;
  transition: filter var(--transition-fast);
}

.treemap-sub-top:hover {
  filter: brightness(1.12);
}

.treemap-sub-bottom-grid {
  display: grid;
  grid-template-columns: 45% 30% 25%;
  gap: 5px;
}

.treemap-mini-block {
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.82rem;
  font-weight: 600;
  color: #ffffff;
  cursor: pointer;
  transition: filter var(--transition-fast);
}

.treemap-mini-block:hover {
  filter: brightness(1.12);
}

.treemap-mini-backend { background: var(--treemap-backend); }
.treemap-mini-data { background: var(--treemap-data); }
.treemap-mini-crypto { background: var(--treemap-architecture); }

.treemap-legend {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 24px;
  font-size: 0.88rem;
}

.legend-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 0;
  cursor: pointer;
  transition: opacity var(--transition-fast);
}

.legend-left {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-secondary);
}

.legend-dot {
  width: 9px;
  height: 9px;
  border-radius: var(--radius-full);
}

.legend-pct {
  color: var(--text-primary);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* Objectifs List */
.objectifs-list {
  display: flex;
  flex-direction: column;
  gap: 22px;
  list-style: none;
}

.objectif-item {
  position: relative;
  padding-left: 24px;
  line-height: 1.6;
}

.objectif-item::before {
  content: '';
  position: absolute;
  left: 2px;
  top: 10px;
  width: 7px;
  height: 7px;
  border-radius: var(--radius-full);
  background: var(--gold-primary);
}

.objectif-title {
  font-weight: 600;
  color: var(--text-primary);
}

.objectif-quote {
  font-family: 'Newsreader', Georgia, serif;
  font-weight: 400;
  color: var(--text-secondary);
  font-style: italic;
  margin-top: 4px;
  display: block;
}

/* Strategy Grid */
.strategy-grid {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.strategy-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 18px 20px;
}

.strategy-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.strategy-card-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.strategy-tag {
  font-size: 0.78rem;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  background: rgba(245, 200, 115, 0.12);
  color: var(--gold-primary);
  font-weight: 500;
}

.strategy-card-desc {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* Why Items */
.why-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.why-item {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 18px 20px;
}

.why-item-title {
  font-size: 0.98rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.why-item-desc {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.55;
}

/* Scorecard */
.scorecard-summary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-bottom: 28px;
  background: rgba(245, 200, 115, 0.06);
  border: 1px solid rgba(245, 200, 115, 0.2);
  border-radius: var(--radius-md);
  padding: 20px;
}

.scorecard-number {
  font-size: 2.8rem;
  font-weight: 700;
  color: var(--gold-primary);
  line-height: 1;
}

.scorecard-badge {
  display: flex;
  flex-direction: column;
}

.scorecard-badge-label {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-muted);
}

.scorecard-badge-status {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text-primary);
}

.criteria-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 32px;
}

.criteria-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.criteria-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.9rem;
}

.criteria-name {
  color: var(--text-secondary);
}

.criteria-score {
  color: var(--text-primary);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.criteria-bar {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.07);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.criteria-progress {
  width: 100%;
  height: 100%;
  background: var(--gold-primary);
  border-radius: var(--radius-full);
  transform-origin: left center;
  transition: transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ==========================================================================
   RH EVALUATION FORM & INTERACTIVE SLIDERS
   ========================================================================== */
.eval-intro-text {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.55;
  margin-bottom: 22px;
}

.rh-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Custom Gold Range Sliders */
.rh-range {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-full);
  outline: none;
  cursor: pointer;
  transition: background 0.2s ease;
}

.rh-range:hover {
  background: rgba(255, 255, 255, 0.16);
}

.rh-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--gold-primary);
  border: 2px solid #0c0d10;
  box-shadow: 0 0 10px rgba(245, 200, 115, 0.45);
  cursor: grab;
  transition: transform 0.15s ease, background 0.15s ease;
}

.rh-range::-webkit-slider-thumb:hover {
  transform: scale(1.15);
  background: var(--gold-hover);
}

.rh-range::-moz-range-thumb {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--gold-primary);
  border: 2px solid #0c0d10;
  box-shadow: 0 0 10px rgba(245, 200, 115, 0.45);
  cursor: grab;
  transition: transform 0.15s ease, background 0.15s ease;
}

/* RH Form Inputs & Fields */
.rh-field-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.rh-field-row {
  display: flex;
  gap: 14px;
}

.rh-label {
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.rh-select,
.rh-input,
.rh-textarea {
  width: 100%;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-medium);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.9rem;
  transition: border-color var(--transition-fast), background var(--transition-fast);
  outline: none;
}

.rh-select:focus,
.rh-input:focus,
.rh-textarea:focus {
  border-color: var(--gold-primary);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 0 2px rgba(245, 200, 115, 0.2);
}

.rh-select option {
  background: #14171f;
  color: #f1f5f9;
}

.rh-textarea {
  resize: vertical;
  min-height: 80px;
}

.eval-success-toast {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border-radius: var(--radius-md);
  background: rgba(74, 222, 128, 0.12);
  border: 1px solid rgba(74, 222, 128, 0.35);
  color: #4ade80;
  font-size: 0.92rem;
  font-weight: 500;
  margin-top: 6px;
  animation: fadeIn 0.3s ease;
}

.spin-icon {
  animation: spin 1s linear infinite;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.cta-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 14px;
}

.cta-large-btn {
  width: 100%;
  padding: 14px 24px;
  font-size: 1rem;
  font-weight: 600;
  background: var(--gold-primary);
  color: #0c0d10;
  border-radius: var(--radius-full);
  border: none;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: all var(--transition-fast);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

.cta-large-btn:hover {
  background: var(--gold-hover);
  transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.55);
}

/* ==========================================================================
   RESPONSIVE DESIGN (Breakpoints)
   ========================================================================== */
@media (max-width: 992px) {
  .cards-grid {
    grid-template-columns: repeat(2, 1fr);
    max-width: 680px;
  }
  
  .header-title {
    font-size: 1.9rem;
  }
}

@media (max-width: 680px) {
  .app-container {
    padding: 36px 16px 130px;
  }

  .header-title {
    font-size: 1.55rem;
  }

  .header-subtitle {
    font-size: 1rem;
  }

  .cards-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .card-container {
    min-height: 310px;
  }

  .action-bar {
    width: auto;
    max-width: calc(100% - 24px);
    overflow: visible;
    justify-content: center;
    padding: 6px 8px;
    gap: 6px;
  }

  .pill-btn {
    padding: 8px 13px;
    font-size: 0.82rem;
  }

  .modal-content {
    padding: 32px 20px 28px;
  }

  .treemap-legend {
    grid-template-columns: 1fr;
  }
  
  .patrimoine-stats-row {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 520px) {
  .action-bar {
    max-width: calc(100vw - 20px);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    justify-content: flex-start;
    padding: 6px 10px;
  }
  .action-bar::-webkit-scrollbar {
    display: none;
  }
  .action-bar-item, .pill-btn {
    flex-shrink: 0;
  }
}
