/* ==========================================================================
   Maya.gent ROI Calculator - Styles
   Charte graphique: violet #504d79, Roboto, minimaliste B2B
   ========================================================================== */

/* ---------- CSS Variables ---------- */
:root {
  --primary: #504d79;
  --primary-light: #6b67a0;
  --primary-dark: #3d3a5e;
  --white: #ffffff;
  --black: #1a1a1a;
  --gray-100: #f8f9fa;
  --gray-200: #e9ecef;
  --gray-400: #ced4da;
  --gray-600: #6c757d;
  --radius: 12px;
  --shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

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

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: 'Roboto', sans-serif;
  font-weight: 400;
  color: var(--black);
  background-color: var(--gray-100);
  line-height: 1.6;
  min-height: 100vh;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--primary-dark);
}

/* ---------- Layout ---------- */
.container {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 20px;
  width: 100%;
}

/* ---------- Header ---------- */
.header {
  background-color: var(--white);
  box-shadow: var(--shadow);
  padding: 16px 0;
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 16px;
}

.logo-link {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.logo {
  height: 40px;
  width: auto;
}

.header-subtitle {
  font-size: 1rem;
  font-weight: 500;
  color: var(--primary);
  white-space: nowrap;
}

/* ---------- Main ---------- */
.main {
  padding: 40px 0;
  min-height: calc(100vh - 140px);
}

/* ---------- Progress Bar ---------- */
.progress-bar {
  margin-bottom: 40px;
}

.progress-track {
  width: 100%;
  height: 4px;
  background-color: var(--gray-200);
  border-radius: 2px;
  margin-bottom: 20px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background-color: var(--primary);
  border-radius: 2px;
  transition: width 0.4s ease;
}

.progress-steps {
  display: flex;
  justify-content: space-between;
}

.progress-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  flex: 1;
}

.step-circle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.875rem;
  font-weight: 500;
  border: 2px solid var(--gray-400);
  color: var(--gray-600);
  background-color: var(--white);
  transition: all 0.3s ease;
}

.progress-step.active .step-circle {
  border-color: var(--primary);
  color: var(--white);
  background-color: var(--primary);
}

.progress-step.completed .step-circle {
  border-color: var(--primary);
  color: var(--white);
  background-color: var(--primary);
}

.step-label {
  font-size: 0.8rem;
  color: var(--gray-600);
  text-align: center;
  font-weight: 400;
  transition: color 0.3s ease;
}

.progress-step.active .step-label {
  color: var(--primary);
  font-weight: 500;
}

.progress-step.completed .step-label {
  color: var(--primary);
}

/* ---------- Form Step ---------- */
.form-step {
  background-color: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 40px;
  max-width: 700px;
  margin: 0 auto;
}

.form-step h2 {
  color: var(--primary);
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.step-desc {
  color: var(--gray-600);
  font-size: 0.95rem;
  margin-bottom: 32px;
  line-height: 1.5;
}

/* ---------- Form Fields ---------- */
.field {
  margin-bottom: 1.5rem;
}

.field label {
  display: block;
  font-weight: 500;
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--black);
  margin-bottom: 8px;
}

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="number"],
select,
textarea {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--gray-400);
  border-radius: 8px;
  font-family: 'Roboto', sans-serif;
  font-size: 1rem;
  color: var(--black);
  background-color: var(--white);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  appearance: none;
  -webkit-appearance: none;
}

select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none'%3E%3Cpath d='M1 1.5l5 5 5-5' stroke='%236c757d' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  padding-right: 40px;
  cursor: pointer;
}

textarea {
  resize: vertical;
  min-height: 120px;
  line-height: 1.5;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(80, 77, 121, 0.15);
}

input::placeholder,
textarea::placeholder {
  color: var(--gray-400);
}

/* ---------- Tags / Tool Buttons ---------- */
.tags-group {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.tag-btn {
  padding: 10px 20px;
  border: 1px solid var(--gray-400);
  border-radius: 24px;
  background-color: var(--white);
  color: var(--black);
  font-family: 'Roboto', sans-serif;
  font-size: 0.9rem;
  font-weight: 400;
  cursor: pointer;
  transition: all 0.2s ease;
}

.tag-btn:hover {
  border-color: var(--primary-light);
  color: var(--primary);
}

.tag-btn.selected {
  background-color: var(--primary);
  color: var(--white);
  border-color: var(--primary);
}

.tag-btn.selected:hover {
  background-color: var(--primary-dark);
  border-color: var(--primary-dark);
  color: var(--white);
}

/* ---------- Radio Cards ---------- */
.radio-group {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.radio-card {
  flex: 1;
  min-width: 140px;
  border: 2px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 16px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
}

.radio-card:hover {
  border-color: var(--primary-light);
}

.radio-card input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}

.radio-card:has(input:checked) {
  border-color: var(--primary);
  background-color: rgba(80, 77, 121, 0.06);
}

.radio-card-content {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--black);
  line-height: 1.4;
}

/* ---------- Navigation Buttons ---------- */
.nav-buttons {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 2rem;
}

/* ---------- Buttons ---------- */
.btn {
  padding: 12px 32px;
  border-radius: 8px;
  font-family: 'Roboto', sans-serif;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
  line-height: 1.4;
}

.btn-primary {
  background-color: var(--primary);
  color: var(--white);
}

.btn-primary:hover {
  background-color: var(--primary-dark);
  color: var(--white);
}

.btn-secondary {
  background-color: transparent;
  border: 1px solid var(--primary);
  color: var(--primary);
}

.btn-secondary:hover {
  background-color: rgba(80, 77, 121, 0.06);
}

.btn-lg {
  padding: 16px 40px;
  font-size: 1.05rem;
}

.btn-full {
  width: 100%;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn:disabled:hover {
  background-color: var(--primary);
}

.btn-secondary:disabled:hover {
  background-color: transparent;
}

/* ---------- Spinner ---------- */
.spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid var(--white);
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  vertical-align: middle;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* ---------- Results Section ---------- */
.results-section {
  position: relative;
}

.results-container {
  background-color: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 40px;
}

.results-container h2 {
  color: var(--primary);
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 24px;
  text-align: center;
}

.results-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin-bottom: 24px;
}

.result-card {
  text-align: center;
  padding: 24px 16px;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  transition: transform 0.2s ease;
}

.result-card:hover {
  transform: translateY(-2px);
}

.result-card.highlight {
  border-color: var(--primary);
  background-color: rgba(80, 77, 121, 0.04);
}

.result-value {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--primary);
  line-height: 1.2;
  margin-bottom: 8px;
}

.result-label {
  font-size: 0.9rem;
  color: var(--gray-600);
  font-weight: 400;
}

/* ---------- Result Detail ---------- */
.result-detail {
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--gray-200);
}

.detail-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
}

.detail-label {
  font-size: 0.95rem;
  color: var(--gray-600);
}

.detail-value {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--black);
}

.detail-explanation {
  margin-top: 16px;
  padding: 16px;
  background-color: var(--gray-100);
  border-radius: 8px;
}

.detail-explanation p {
  font-size: 0.9rem;
  color: var(--gray-600);
  line-height: 1.6;
}

/* ---------- Blurred State ---------- */
.blurred .results-grid,
.blurred .result-detail {
  filter: blur(5px);
  user-select: none;
  pointer-events: none;
}

/* ---------- Lead Section (below blurred results) ---------- */
.lead-section {
  margin-top: 2rem;
}

.lead-card {
  background-color: var(--white);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
  border-radius: var(--radius);
  padding: 2.5rem;
  max-width: 560px;
  width: 100%;
  margin: 0 auto;
  text-align: center;
}

.lock-icon {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
}

.lead-form-row {
  display: flex;
  gap: 1rem;
}

.lead-form-row input {
  flex: 1;
}

.lead-card h3 {
  color: var(--primary);
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.lead-subtitle {
  color: var(--gray-600);
  font-size: 0.95rem;
  margin-bottom: 24px;
  line-height: 1.5;
}

.lead-form input {
  width: 100%;
  margin-bottom: 1rem;
  padding: 12px 16px;
  border: 1px solid var(--gray-400);
  border-radius: 8px;
  font-family: 'Roboto', sans-serif;
  font-size: 1rem;
  color: var(--black);
  background-color: var(--white);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.lead-form input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(80, 77, 121, 0.15);
}

.lead-form input::placeholder {
  color: var(--gray-400);
}

.lead-form .btn {
  margin-top: 8px;
}

/* ---------- CTA Section ---------- */
.cta-section {
  text-align: center;
  margin-top: 2rem;
}

.cta-text {
  font-size: 1.1rem;
  color: var(--gray-600);
  margin-bottom: 16px;
}

/* ---------- Footer ---------- */
.footer {
  text-align: center;
  padding: 32px 0;
  color: var(--gray-600);
  font-size: 0.85rem;
  margin-top: 40px;
}

/* ---------- Alpine.js cloak ---------- */
[x-cloak] {
  display: none !important;
}

/* ---------- Transitions (Alpine x-transition) ---------- */
.form-step,
.results-section {
  transition: opacity 0.3s ease, transform 0.3s ease;
}

/* ---------- Responsive (max-width 768px) ---------- */
@media (max-width: 768px) {
  .header-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

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

  .main {
    padding: 24px 0;
  }

  .form-step {
    padding: 24px 20px;
  }

  .form-step h2 {
    font-size: 1.25rem;
  }

  .progress-steps {
    gap: 4px;
  }

  .step-label {
    font-size: 0.7rem;
  }

  .step-circle {
    width: 30px;
    height: 30px;
    font-size: 0.75rem;
  }

  .radio-group {
    flex-direction: column;
  }

  .radio-card {
    min-width: unset;
  }

  .results-grid {
    grid-template-columns: 1fr;
  }

  .result-value {
    font-size: 2rem;
  }

  .results-container {
    padding: 24px 20px;
  }

  .lead-card {
    padding: 1.5rem;
  }

  .lead-card h3 {
    font-size: 1.2rem;
  }

  .lead-form-row {
    flex-direction: column;
    gap: 0;
  }

  .btn-lg {
    padding: 14px 24px;
    font-size: 0.95rem;
  }

  .nav-buttons {
    gap: 12px;
  }

  .detail-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }
}

/* ---------- Small mobile (max-width 480px) ---------- */
@media (max-width: 480px) {
  .container {
    padding: 0 16px;
  }

  .form-step {
    padding: 20px 16px;
  }

  .tags-group {
    gap: 8px;
  }

  .tag-btn {
    padding: 8px 16px;
    font-size: 0.85rem;
  }

  .progress-bar {
    margin-bottom: 24px;
  }
}
