/* ENPC Simulateur de Bourses - Design Epuré */

/* Reset and Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: Arial, sans-serif;
  color: #333333;
  background-color: #FFFFFF;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 15px;
}

/* Main Content - Mobile First */
.main {
  background: #FFFFFF;
  min-height: 100vh;
  padding: 20px 0;
}

.page-header {
  text-align: center;
  margin-bottom: 30px;
  padding: 0 10px;
}

.page-header h1 {
  font-size: 24px;
  color: #07A6AE;
  font-weight: 600;
  margin-bottom: 12px;
  letter-spacing: -0.5px;
  line-height: 1.3;
}

.page-description {
  font-size: 15px;
  color: #666;
  max-width: 600px;
  margin: 0 auto;
  line-height: 1.5;
}

.disclaimer-section {
  margin-bottom: 25px;
  padding: 0 5px;
}

.disclaimer1 {
  background: #f8f9fa;
  border: 1px solid #dee2e6;
  border-left: 4px solid #07A6AE;
  padding: 15px;
  border-radius: 6px;
  font-size: 14px;
  line-height: 1.5;
}

.disclaimer1 strong {
  color: #07A6AE;
}

.disclaimer2 {
  background: #f8f9fa;
  border: 1px solid #dee2e6;
  border-left: 4px solid #e65100;
  padding: 15px;
  border-radius: 6px;
  font-size: 14px;
  line-height: 1.5;
}

.disclaimer2 strong {
  color: #e65100;
}

/* Simulator Content Layout - Mobile First */
.simulator-content {
  display: flex;
  flex-direction: column;
  gap: 25px;
}

/* Form Section */
.form-card,
.results-card,
.info-card {
  background: #FFFFFF;
  border: 1px solid #e0e0e0;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  overflow: hidden;
}

.form-card h2,
.results-card h2,
.info-card h3 {
  background: #f8f9fa;
  padding: 18px;
  margin: 0;
  font-size: 18px;
  color: #333;
  border-bottom: 1px solid #e0e0e0;
  font-weight: 600;
  text-align: center;
}

.form-content {
  padding: 0;
}

/* Form Section Blocks - Replaces Accordion */
.form-section-block {
  border-bottom: 1px solid #e0e0e0;
  padding: 20px 18px;
}

.form-section-block:last-child {
  border-bottom: none;
}

.section-title {
  font-size: 16px;
  font-weight: 600;
  color: #07A6AE;
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 2px solid #07A6AE;
}

/* Form Groups - Optimisé Mobile */
.form-group {
  margin-bottom: 20px;
}

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

.form-label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  color: #333;
  font-size: 15px;
  line-height: 1.4;
}

.form-control {
  width: 100%;
  padding: 14px 16px;
  border: 2px solid #ddd;
  border-radius: 8px;
  font-size: 16px; /* Prevent zoom on iOS */
  color: #333;
  background: #FFFFFF;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
  min-height: 48px; /* Touch-friendly */
  font-family: Arial, sans-serif;
}

.form-control:focus {
  outline: none;
  border-color: #07A6AE;
  box-shadow: 0 0 0 3px rgba(7, 166, 174, 0.2);
}

.form-control::placeholder {
  color: #999;
}

/* Select specific styling */
select.form-control {
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
  background-position: right 12px center;
  background-repeat: no-repeat;
  background-size: 16px;
  padding-right: 40px;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
}

/* Checkboxes - Optimisé Tactile */
.checkbox-group {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 12px;
}

.form-check {
  display: flex;
  align-items: center;
  gap: 12px;
}

.form-check-input {
  width: 20px;
  height: 20px;
  accent-color: #07A6AE;
  cursor: pointer;
  flex-shrink: 0;
}

.form-check-label {
  font-size: 15px;
  cursor: pointer;
  margin-bottom: 0;
  line-height: 1.4;
}

/* Tooltips - Tactile */
.tooltip {
  display: inline-block;
  background: #07A6AE;
  color: white;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  text-align: center;
  line-height: 20px;
  font-size: 12px;
  cursor: help;
  margin-left: 8px;
  font-weight: bold;
  flex-shrink: 0;
}

/* Results Section */
.results-section {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.no-result {
  padding: 30px 20px;
  text-align: center;
  color: #666;
  font-style: italic;
  font-size: 15px;
}

/* Result Summary */
.result-summary {
  background: linear-gradient(135deg, #07A6AE 0%, #06959c 100%);
  color: white;
  padding: 25px 20px;
  text-align: center;
  border-radius: 10px;
  margin: 18px;
}

.result-summary .echelon {
  font-size: 32px;
  font-weight: bold;
  margin-bottom: 8px;
}

.result-summary .montant {
  font-size: 22px;
  font-weight: 600;
  margin-bottom: 6px;
}

.result-summary .annual-note {
  font-size: 13px;
  opacity: 0.9;
  font-weight: 600;
}

/* Styles spéciaux pour les étudiants 3A */
.result-summary.student-3a {
  background: linear-gradient(135deg, #07A6AE 0%, #06959c 100%);;
}

.result-summary.student-3a .annual-note {
  font-weight: 600;
  color: #ffffff;
}

/* Result Details */
.result-details {
  background: #f8f9fa;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  padding: 18px;
  margin: 18px;
}

.result-details h4 {
  color: #07A6AE;
  margin-bottom: 15px;
  font-size: 16px;
  font-weight: 600;
}

.detail-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 10px 0;
  border-bottom: 1px solid #e0e0e0;
  gap: 15px;
}

.detail-row:last-child {
  border-bottom: none;
  font-weight: 600;
  padding-top: 15px;
  margin-top: 10px;
  border-top: 2px solid #07A6AE;
}

.detail-label {
  color: #555;
  font-size: 14px;
  flex: 1;
}

.detail-value {
  font-weight: 600;
  color: #07A6AE;
  font-size: 14px;
  text-align: right;
  flex-shrink: 0;
}

/* Not Eligible */
.not-eligible {
  background: #fff5f5;
  border: 2px solid #fed7d7;
  color: #c53030;
  padding: 25px 20px;
  text-align: center;
  border-radius: 10px;
  margin: 18px;
}

.not-eligible h4 {
  margin-bottom: 15px;
  font-size: 18px;
}

/* Versement Info */
.versement-info {
  background: #f0fffe;
  border: 1px solid #b3f0ef;
  border-radius: 8px;
  padding: 18px;
  margin: 18px;
}

.versement-info h5 {
  color: #07A6AE;
  margin-bottom: 12px;
  font-size: 16px;
  font-weight: 600;
}

.versement-details {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 15px;
}

.versement-item {
  background: white;
  padding: 16px;
  text-align: center;
  border-radius: 8px;
  border: 1px solid #e0e0e0;
}

.versement-item .amount {
  font-weight: bold;
  color: #07A6AE;
  font-size: 18px;
  display: block;
}

.versement-item .period {
  font-size: 13px;
  color: #666;
  margin-top: 4px;
}

/* Versement spécial 3A */
.versement-info.student-3a {
  background: #fff8e1;
  border-color: #ffcc02;
  border: 1px solid #d7a50f;
  border-radius: 8px;
  padding: 18px;
  margin: 18px;
}

.versement-info.student-3a h5 {
  color: #e65100;
}

.versement-info.student-3a .versement-details {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 15px;
}

.versement-info.student-3a .versement-item {
  background: #fffbf0;
  border-color: #ffcc02;
}

.versement-info.student-3a .versement-item .amount {
  color: #e65100;
}

/* Info Card */
.info-section {
  padding: 18px;
  border-bottom: 1px solid #e0e0e0;
}

.info-section:last-child {
  border-bottom: none;
}

.info-section h4 {
  color: #07A6AE;
  margin-bottom: 12px;
  font-size: 16px;
  font-weight: 600;
}

.info-section ul {
  margin: 8px 0;
  padding-left: 20px;
}

.info-section li {
  margin-bottom: 6px;
  font-size: 14px;
  line-height: 1.5;
}

.status-info {
  display: flex;
  flex-direction: column;
  gap: 15px;
  margin-top: 15px;
}

.status-item {
  padding: 16px;
  border-radius: 8px;
  border: 1px solid #e0e0e0;
}

.status-ue {
  background: #f0fffe;
  border-color: #b3f0ef;
}

.status-non-ue {
  background: #fff5f5;
  border-color: #fed7d7;
}

.status-item strong {
  display: block;
  margin-bottom: 10px;
  color: #333;
  font-size: 14px;
}

.status-item ul {
  margin: 0;
  padding-left: 16px;
}

.status-item li {
  font-size: 13px;
  margin-bottom: 4px;
}

/* Tooltip Popup */
.tooltip-popup {
  position: fixed;
  background: #333;
  color: white;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 13px;
  max-width: 250px;
  z-index: 1000;
  pointer-events: none;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  line-height: 1.4;
}

/* Animations */
.result-summary {
  animation: slideInUp 0.5s ease-out;
}

@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Loading state */
.form-control:disabled {
  background-color: #f5f5f5;
  cursor: not-allowed;
  opacity: 0.6;
}

/* Focus states for accessibility */
.form-control:focus-visible,
.form-check-input:focus-visible {
  outline: 2px solid #07A6AE;
  outline-offset: 2px;
}

/* Tablet Responsive - 768px+ */
@media (min-width: 768px) {
  .container {
    padding: 0 20px;
  }

  .main {
    padding: 30px 0;
  }

  .page-header h1 {
    font-size: 28px;
    margin-bottom: 15px;
  }

  .page-description {
    font-size: 16px;
  }

  .simulator-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    align-items: start;
  }

  .versement-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
  }

  .status-info {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
  }

  .disclaimer1 {
    padding: 20px;
  }

  .disclaimer2 {
    padding: 20px;
  }

  .form-section-block {
    padding: 24px 20px;
  }
}

/* Desktop Responsive - 1024px+ */
@media (min-width: 1024px) {
  .main {
    padding: 40px 0;
  }

  .page-header h1 {
    font-size: 32px;
    margin-bottom: 20px;
  }

  .page-description {
    font-size: 16px;
  }

  .simulator-content {
    max-width: 1400px;
    margin: 0 auto;
    gap: 40px;
  }

  .form-card {
    position: sticky;
    top: 20px;
    height: fit-content;
  }
}

/* Large screens - 1200px+ */
@media (min-width: 1200px) {
  .page-header {
    margin-bottom: 40px;
  }

  .simulator-content {
    gap: 50px;
}
}

/* Touch improvements for all devices */
@media (hover: none) and (pointer: coarse) {
  .form-control {
    min-height: 52px;
    padding: 16px;
    font-size: 16px;
  }

  .form-check-input {
    width: 22px;
    height: 22px;
  }

  .tooltip {
    width: 24px;
    height: 24px;
    line-height: 24px;
  }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .form-control {
    border-width: 3px;
  }

  .result-summary {
    background: #07A6AE;
  }
}

/* Error states */
.form-control.error {
  border-color: #dc3545;
  box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.2);
}

.error-message {
  color: #dc3545;
  font-size: 14px;
  margin-top: 4px;
}