/* ============================================
   Simulateur SCPI Cash - Cabinet Premium
   Excellence en gestion de patrimoine
   Design sobre, precis, professionnel
   ============================================ */

/* ==================
   VARIABLES PREMIUM
   ================== */

:root {
  /* Couleurs Rivaria */
  --premium-navy: #023A68;
  --premium-blue: #1870EF;
  --premium-gold: #1870EF;
  --premium-silver: #8B9DC3;
  --premium-success: #2D7A4F;
  --premium-warning: #D97706;
  --premium-error: #B91C1C;

  /* Backgrounds */
  --bg-primary: #FFFFFF;
  --bg-secondary: #F7F7F7;
  --bg-elevated: #FCFCFD;
  --bg-overlay: rgba(2, 58, 104, 0.95);

  /* Textes */
  --text-primary: #0A1628;
  --text-secondary: #4B5563;
  --text-tertiary: #9CA3AF;
  --text-inverse: #FFFFFF;

  /* Bordures */
  --border-light: #E5E7EB;
  --border-medium: #D1D5DB;
  --border-dark: #9CA3AF;

  /* Ombres Premium */
  --shadow-xs: 0 1px 2px 0 rgba(10, 22, 40, 0.05);
  --shadow-sm: 0 2px 4px -1px rgba(10, 22, 40, 0.06), 0 2px 2px -1px rgba(10, 22, 40, 0.04);
  --shadow-md: 0 4px 6px -1px rgba(10, 22, 40, 0.08), 0 2px 4px -2px rgba(10, 22, 40, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(10, 22, 40, 0.10), 0 4px 6px -4px rgba(10, 22, 40, 0.06);
  --shadow-xl: 0 20px 25px -5px rgba(10, 22, 40, 0.12), 0 8px 10px -6px rgba(10, 22, 40, 0.08);

  /* Espacements Premium */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 2.5rem;
  --space-3xl: 3rem;

  /* Radius Premium */
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;

  /* Transitions */
  --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.3s cubic-bezier(0.4, 0, 0.2, 1);

  /* Typographie Rivaria */
  --font-sans: 'Instrument Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-serif: 'Instrument Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  /* Poids */
  --font-normal: 400;
  --font-medium: 500;
  --font-semibold: 600;
  --font-bold: 700;
  --font-extrabold: 800;

  /* Tailles */
  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.25rem;
  --text-2xl: 1.5rem;
  --text-3xl: 1.875rem;
  --text-4xl: 2.25rem;
}

/* ==================
   RESET & BASE
   ================== */

body[data-sim="scpi-cash"] {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: 1.5;
  color: var(--text-primary);
  background: var(--bg-secondary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body[data-sim="scpi-cash"] .page {
  max-width: 1680px;
  margin: 0 auto;
  padding: var(--space-lg) var(--space-xl) var(--space-3xl);
  background: var(--bg-secondary);
}

/* ==================
   TOPBAR PREMIUM
   ================== */

.topbar {
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
}

.topbar-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-md) var(--space-xl);
  max-width: 1680px;
  margin: 0 auto;
  gap: var(--space-lg);
}

.topbar-back-link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  background: transparent;
  border: 1.5px solid var(--border-medium);
  border-radius: var(--radius-lg);
  text-decoration: none;
  color: var(--text-secondary);
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
  transition: all var(--transition-base);
}

.topbar-back-link:hover {
  background: var(--bg-secondary);
  border-color: var(--premium-gold);
  color: var(--premium-navy);
}

.topbar-back-link .back-arrow {
  font-size: var(--text-lg);
  color: var(--premium-gold);
  transition: transform var(--transition-base);
}

.topbar-back-link:hover .back-arrow {
  transform: translateX(-3px);
}

.topbar-pill {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-lg);
  background: linear-gradient(135deg, var(--premium-navy) 0%, var(--premium-blue) 100%);
  color: var(--text-inverse);
  border-radius: 100px;
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
  letter-spacing: 0.025em;
}

.topbar-pill .dot {
  width: 6px;
  height: 6px;
  background: var(--premium-gold);
  border-radius: 50%;
  animation: pulse-dot 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* Responsive topbar */
@media (max-width: 768px) {
  .topbar-inner {
    flex-wrap: wrap;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
  }
  .topbar-back-link {
    padding: var(--space-xs) var(--space-sm);
    font-size: var(--text-xs);
  }
  .topbar-pill {
    padding: var(--space-xs) var(--space-md);
    font-size: var(--text-xs);
  }
}

/* ==================
   HERO PREMIUM
   ================== */

.hero {
  background: linear-gradient(135deg, var(--premium-navy) 0%, var(--premium-blue) 100%);
  color: var(--text-inverse);
  border-radius: var(--radius-xl);
  margin-bottom: var(--space-2xl);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  position: relative;
}

.hero::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 50%;
  height: 100%;
  background: linear-gradient(90deg, transparent 0%, rgba(184, 134, 11, 0.05) 100%);
  pointer-events: none;
}

.hero-inner {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: var(--space-3xl);
  padding: var(--space-3xl);
  align-items: center;
  position: relative;
  z-index: 1;
}

.hero-left h1 {
  font-family: var(--font-serif);
  font-size: var(--text-4xl);
  font-weight: var(--font-bold);
  margin: 0 0 var(--space-md) 0;
  line-height: 1.2;
  letter-spacing: -0.025em;
}

.hero-left p {
  font-size: var(--text-lg);
  color: rgba(255, 255, 255, 0.9);
  margin: 0 0 var(--space-xl) 0;
  line-height: 1.6;
  max-width: 42rem;
}

.hero-actions {
  display: flex;
  gap: var(--space-md);
  flex-wrap: wrap;
}

.hero-actions button {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-md) var(--space-xl);
  border-radius: var(--radius-md);
  font-weight: var(--font-semibold);
  font-size: var(--text-base);
  cursor: pointer;
  transition: all var(--transition-base);
  border: 2px solid transparent;
  min-height: 48px;
}

.hero-actions .btn-calculate {
  background: var(--bg-primary);
  color: var(--premium-navy);
  border-color: var(--bg-primary);
}

.hero-actions .btn-calculate:hover {
  background: var(--bg-secondary);
  border-color: var(--bg-secondary);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.hero-actions .btn-help {
  background: transparent;
  color: var(--text-inverse);
  border-color: rgba(255, 255, 255, 0.3);
}

.hero-actions .btn-help:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.5);
}

.hero-actions .btn-pdf {
  background: rgba(255, 255, 255, 0.15);
  color: var(--text-inverse);
  border-color: rgba(255, 255, 255, 0.3);
  backdrop-filter: blur(10px);
}

.hero-actions .btn-pdf:hover {
  background: rgba(255, 255, 255, 0.25);
  border-color: rgba(255, 255, 255, 0.5);
}

.hero-logo {
  width: 180px;
  height: auto;
}

.hero-logo-img {
  width: 100%;
  height: auto;
  opacity: 0.95;
  filter: brightness(0) invert(1);
}

/* Responsive hero */
@media (max-width: 1024px) {
  .hero-inner {
    grid-template-columns: 1fr;
    text-align: center;
    gap: var(--space-xl);
  }
  .hero-left p {
    margin-left: auto;
    margin-right: auto;
  }
  .hero-actions {
    justify-content: center;
  }
  .hero-right {
    display: none;
  }
}

@media (max-width: 640px) {
  .hero-inner {
    padding: var(--space-xl);
  }
  .hero-left h1 {
    font-size: var(--text-2xl);
  }
  .hero-left p {
    font-size: var(--text-base);
  }
  .hero-actions {
    flex-direction: column;
  }
  .hero-actions button {
    width: 100%;
    justify-content: center;
  }
}

/* ==================
   LAYOUT PRINCIPAL - PLEINE LARGEUR
   ================== */

.sim-wrap {
  background: transparent;
}

.sim-shell {
  background: transparent;
}

.sim-shell .content-centered {
  display: flex;
  flex-direction: column;
  gap: var(--space-2xl);
}

/* ==================
   SECTION HYPOTHESES
   ================== */

.hypotheses-section {
  width: 100%;
}

.hypotheses-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-xl);
}

.hypotheses-grid .section {
  width: 100%;
}

/* Section pleine largeur pour parametres investissement */
.hypotheses-grid .section:nth-child(3),
.hypotheses-grid .section:nth-child(5) {
  grid-column: 1 / -1;
}

/* Form rows for multi-columns layout */
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-lg);
  margin-bottom: var(--space-lg);
}

.form-row:last-child {
  margin-bottom: 0;
}

.form-row .form-group {
  margin-bottom: 0;
}

/* 4 colonnes pour les sections pleine largeur */
.hypotheses-grid .section:nth-child(3) .form-row,
.hypotheses-grid .section:nth-child(5) .form-row {
  grid-template-columns: repeat(4, 1fr);
}

@media (max-width: 1200px) {
  .hypotheses-grid .section:nth-child(3) .form-row,
  .hypotheses-grid .section:nth-child(5) .form-row {
    grid-template-columns: repeat(2, 1fr);
  }
}

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

  .hypotheses-grid .section:nth-child(3),
  .hypotheses-grid .section:nth-child(5) {
    grid-column: 1;
  }
}

@media (max-width: 768px) {
  .form-row,
  .hypotheses-grid .section:nth-child(3) .form-row,
  .hypotheses-grid .section:nth-child(5) .form-row {
    grid-template-columns: 1fr;
  }
}

/* ==================
   SECTION RESULTATS
   ================== */

.results-section {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: var(--space-2xl);
}

/* ==================
   SECTIONS PREMIUM
   ================== */

.section {
  background: var(--bg-primary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: var(--space-2xl);
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition-base);
}

.section:hover {
  box-shadow: var(--shadow-md);
}

.section h3 {
  font-family: var(--font-serif);
  font-size: var(--text-xl);
  font-weight: var(--font-bold);
  color: var(--premium-navy);
  margin: 0 0 var(--space-xl) 0;
  padding-bottom: var(--space-md);
  border-bottom: 2px solid var(--border-light);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.results-section .section h3 {
  font-size: var(--text-2xl);
  border-bottom-color: var(--premium-blue);
}

/* ==================
   FORMULAIRES PREMIUM
   ================== */

.form-group {
  margin-bottom: var(--space-lg);
}

.form-group:last-child {
  margin-bottom: 0;
}

.form-group label {
  display: block;
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
  color: var(--text-primary);
  margin-bottom: var(--space-sm);
}

.form-group input[type="text"],
.form-group input[type="number"],
.form-group select {
  width: 100%;
  padding: var(--space-md);
  font-size: var(--text-base);
  font-family: var(--font-sans);
  color: var(--text-primary);
  background: var(--bg-secondary);
  border: 1.5px solid var(--border-medium);
  border-radius: var(--radius-md);
  transition: all var(--transition-base);
  box-sizing: border-box;
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--premium-blue);
  background: var(--bg-primary);
  box-shadow: 0 0 0 3px rgba(28, 61, 90, 0.1);
}

.form-group input::placeholder {
  color: var(--text-tertiary);
}

/* Info badge */
.info-badge {
  display: block;
  font-size: var(--text-xs);
  color: var(--text-tertiary);
  margin-top: var(--space-xs);
  line-height: 1.4;
}

/* Info tip */
.info-tip {
  position: relative;
  display: inline-block;
}

.info-tip .tip-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  font-size: var(--text-xs);
  font-weight: var(--font-bold);
  color: var(--premium-blue);
  background: rgba(28, 61, 90, 0.1);
  border-radius: 50%;
  cursor: help;
  transition: all var(--transition-base);
}

.info-tip .tip-icon:hover {
  background: var(--premium-blue);
  color: var(--text-inverse);
}

.info-tip .tip-content {
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(-8px);
  width: 280px;
  padding: var(--space-md);
  background: var(--premium-navy);
  color: var(--text-inverse);
  font-size: var(--text-sm);
  font-weight: var(--font-normal);
  line-height: 1.5;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-base);
  z-index: 100;
}

.info-tip:hover .tip-content,
.info-tip .tip-icon:focus + .tip-content {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(-12px);
}

/* ==================
   RESULTS SUMMARY CARDS
   ================== */

.results-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-lg);
  margin-bottom: var(--space-2xl);
}

@media (max-width: 900px) {
  .results-summary {
    grid-template-columns: 1fr;
  }
}

.summary-card {
  background: var(--bg-primary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-base);
  border-left: 4px solid var(--premium-blue);
}

.summary-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.summary-card.secondary {
  border-left-color: var(--premium-success);
}

.summary-card.tertiary {
  border-left-color: var(--premium-gold);
}

.summary-card h4 {
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
  color: var(--text-secondary);
  margin: 0 0 var(--space-sm) 0;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.summary-card .value {
  font-size: var(--text-2xl);
  font-weight: var(--font-bold);
  color: var(--premium-navy);
  font-family: var(--font-sans);
}

.summary-card .label {
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
  color: var(--text-secondary);
  margin-bottom: var(--space-sm);
}

/* ==================
   MAIN CONTENT
   ================== */

.main-content {
  display: flex;
  flex-direction: column;
  gap: var(--space-2xl);
}

/* ==================
   TABLES
   ================== */

table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
}

table thead {
  background: linear-gradient(135deg, var(--premium-navy) 0%, var(--premium-blue) 100%);
  color: var(--text-inverse);
}

table th {
  padding: var(--space-md);
  text-align: left;
  font-weight: var(--font-semibold);
  font-size: var(--text-sm);
  letter-spacing: 0.02em;
}

table th:not(:first-child) {
  text-align: right;
}

table tbody tr {
  border-bottom: 1px solid var(--border-light);
  transition: background var(--transition-fast);
}

table tbody tr:hover {
  background: var(--bg-secondary);
}

table td {
  padding: var(--space-md);
}

table td:not(:first-child) {
  text-align: right;
}

/* ==================
   GLOSSAIRE
   ================== */

#glossaire {
  margin-top: var(--space-2xl);
}

#glossaire .section {
  background: var(--bg-primary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: var(--space-2xl);
  box-shadow: var(--shadow-sm);
}

.flex-between {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.btn-icon-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 32px;
  background: var(--premium-navy);
  color: var(--text-inverse);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: var(--text-base);
  transition: all var(--transition-base);
}

.btn-icon-toggle:hover {
  background: var(--premium-blue);
}

.glossary-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-md);
  margin-top: var(--space-lg);
}

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

.glossary-grid .info-badge {
  background: var(--bg-secondary);
  padding: var(--space-md);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  color: var(--text-primary);
}

.hidden {
  display: none !important;
}

/* ==================
   UTILITIES
   ================== */

.text-tertiary {
  color: var(--text-tertiary);
}

/* ==================
   PDF REPORT (hidden)
   ================== */

#pdfReport {
  display: none;
}
