/* ============================================================
   TALENTUM — Phase 3 Shared Components
   AnimatedLink · FormField · ChoiceCard
   Step 3.0
   ============================================================ */

/* ----------------------------------------------------------------
   AnimatedLink — underline gold gauche-droite au hover (CSS pur)
   ---------------------------------------------------------------- */

.animated-link {
  position: relative;
  display: inline-block;
  text-decoration: none;
  color: inherit;
  transition: color var(--duration-fast) var(--ease-expo-out);
}

.animated-link::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 100%;
  height: 1px;
  background-color: var(--color-accent-gold);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform var(--duration-normal) var(--ease-expo-out);
}

.animated-link:hover {
  color: var(--color-accent-gold);
}

.animated-link:hover::after {
  transform: scaleX(1);
  transform-origin: left;
}

@media (prefers-reduced-motion: reduce) {
  .animated-link::after {
    transition: none;
  }
}

/* ----------------------------------------------------------------
   FormField — input / textarea / select avec floating label
   ---------------------------------------------------------------- */

.form-field {
  position: relative;
  margin-bottom: var(--space-lg);
}

.form-field__input {
  width: 100%;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--color-form-underline);
  padding: var(--space-md) 0 var(--space-sm);
  color: var(--color-text-primary);
  font-family: var(--font-display);
  font-weight: 400;
  font-size: var(--text-body);
  line-height: 1.5;
  outline: none;
  transition: border-color var(--duration-normal) var(--ease-expo-out),
              border-bottom-width var(--duration-normal) var(--ease-expo-out);
  appearance: none;
  -webkit-appearance: none;
  border-radius: 0;
}

.form-field__input--textarea {
  resize: vertical;
  min-height: 6rem;
}

.form-field__input--select {
  cursor: pointer;
  padding-right: var(--space-lg);
}

.form-field__input:focus {
  border-bottom-color: var(--color-accent-gold);
  border-bottom-width: 1.5px;
}

/* Floating label */
.form-field__label {
  position: absolute;
  left: 0;
  top: var(--space-md);
  pointer-events: none;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: var(--text-body);
  color: var(--color-text-secondary);
  transition: transform var(--duration-normal) var(--ease-expo-out),
              font-size var(--duration-normal) var(--ease-expo-out),
              color var(--duration-normal) var(--ease-expo-out);
  transform-origin: left top;
}

/* Inputs + textarea : pure CSS via :not(:placeholder-shown) */
.form-field__input:focus ~ .form-field__label,
.form-field__input:not(:placeholder-shown) ~ .form-field__label {
  transform: translateY(-1.5rem) scale(0.75);
  color: var(--color-accent-gold);
}

/* Select : JS ajoute .is-filled sur le wrapper au change */
.form-field.is-filled .form-field__label {
  transform: translateY(-1.5rem) scale(0.75);
  color: var(--color-accent-gold);
}

/* Select focus label */
.form-field__input--select:focus ~ .form-field__label {
  transform: translateY(-1.5rem) scale(0.75);
  color: var(--color-accent-gold);
}

.form-field__required {
  color: var(--color-accent-gold);
  margin-left: 0.15em;
}

/* Chevron select */
.form-field__chevron {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-30%);
  pointer-events: none;
  color: var(--color-accent-gold);
  width: 12px;
  height: 8px;
}

.form-field__chevron svg {
  width: 100%;
  height: 100%;
  display: block;
}

/* Error */
.form-field__error {
  display: block;
  min-height: 1.2em;
  margin-top: var(--space-xs);
  font-family: var(--font-display);
  font-weight: 500;
  font-size: var(--text-small);
  color: var(--color-error);
  letter-spacing: 0.02em;
  opacity: 0;
  transition: opacity var(--duration-fast) var(--ease-expo-out);
}

.form-field.is-invalid .form-field__error {
  opacity: 1;
}

.form-field.is-invalid .form-field__input {
  border-bottom-color: var(--color-error);
}

/* Reduced motion — floating label raccourci */
@media (prefers-reduced-motion: reduce) {
  .form-field__label {
    transition: transform 0.15s ease, font-size 0.15s ease, color 0.15s ease;
  }
}

/* ----------------------------------------------------------------
   DatePicker — calendrier date unique (Step 7.4)
   ---------------------------------------------------------------- */

.form-field--date .form-field__input--date {
  cursor: pointer;
  padding-right: var(--space-lg);
}

.form-field__date-icon {
  width: 14px;
  height: 14px;
  color: var(--color-accent-gold);
  pointer-events: none; /* le clic traverse vers l'input */
}

.datepicker__panel {
  margin-top: var(--space-sm);
  max-width: 320px;
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-divider-gold-whisper);
  padding: var(--space-md);
}

.datepicker__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-md);
}

.datepicker__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--text-body);
  text-transform: capitalize;
  letter-spacing: 0.02em;
  color: var(--color-text-primary);
}

.datepicker__nav {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0 var(--space-sm);
  font-size: 1.4rem;
  line-height: 1;
  color: var(--color-accent-gold);
  transition: color var(--duration-fast) var(--ease-expo-out);
}

.datepicker__nav:hover {
  color: var(--color-accent-gold-light);
}

.datepicker__grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}

.datepicker__day {
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: var(--text-small);
  color: var(--color-accent-gold);
  transition: background-color var(--duration-fast) var(--ease-expo-out),
              color var(--duration-fast) var(--ease-expo-out);
}

.datepicker__day--empty {
  cursor: default;
}

.datepicker__day:not(.is-past):not(.datepicker__day--empty):hover {
  background: var(--color-divider-gold-whisper);
}

.datepicker__day.is-today {
  box-shadow: inset 0 0 0 1px var(--color-divider-gold-whisper);
}

.datepicker__day.is-selected {
  background: var(--color-accent-gold);
  color: var(--color-bg-primary);
  font-weight: 700;
}

.datepicker__day.is-past {
  color: var(--color-text-secondary);
  opacity: 0.35;
  cursor: default;
}

@media (prefers-reduced-motion: reduce) {
  .datepicker__nav,
  .datepicker__day {
    transition: none;
  }
}

/* ----------------------------------------------------------------
   ChoiceCard — card cliquable dual-entry (production / talent)
   ---------------------------------------------------------------- */

.choice-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-choice-card-border);
  padding: var(--space-lg);
  cursor: pointer;
  font-family: var(--font-display);
  color: var(--color-text-primary);
  transition: background-color var(--duration-slow) var(--ease-expo-out),
              border-color var(--duration-normal) var(--ease-expo-out),
              transform var(--duration-normal) var(--ease-expo-out),
              color var(--duration-slow) var(--ease-expo-out);
  border-radius: 0;
  width: 100%;
}

.choice-card__eyebrow {
  font-weight: 500;
  font-size: var(--text-small);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--color-accent-gold);
  margin-bottom: var(--space-md);
  transition: color var(--duration-slow) var(--ease-expo-out);
}

.choice-card__title {
  font-weight: 900;
  font-size: clamp(1.5rem, 2.5vw, 2.25rem);
  line-height: 1.1;
  text-transform: uppercase;
  letter-spacing: -0.01em;
  color: var(--color-text-primary);
  margin: 0 0 var(--space-md);
  transition: color var(--duration-slow) var(--ease-expo-out);
}

.choice-card__description {
  font-weight: 400;
  font-size: var(--text-body);
  line-height: 1.6;
  color: var(--color-text-secondary);
  margin: 0;
  transition: color var(--duration-slow) var(--ease-expo-out);
}

/* Hover : fond or, texte noir */
.choice-card:hover {
  background-color: var(--color-accent-gold);
  border-color: var(--color-accent-gold);
  transform: translateY(-4px);
  color: var(--color-bg-primary);
}

.choice-card:hover .choice-card__eyebrow,
.choice-card:hover .choice-card__title {
  color: var(--color-bg-primary);
}

.choice-card:hover .choice-card__description {
  color: var(--color-choice-card-hover-text);
}

/* État actif : or (même qu'au hover — confirme la sélection) */
.choice-card.is-active {
  background-color: var(--color-accent-gold);
  border-color: var(--color-accent-gold);
  transform: none;
  color: var(--color-bg-primary);
}

.choice-card.is-active .choice-card__eyebrow,
.choice-card.is-active .choice-card__title {
  color: var(--color-bg-primary);
}

.choice-card.is-active .choice-card__description {
  color: var(--color-choice-card-hover-text);
}

/* Dimmed : l'autre card quand une est active */
.choice-card.is-dimmed {
  opacity: 0.35;
  pointer-events: none;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .choice-card {
    transition: background-color 0.2s linear, color 0.2s linear, border-color 0.2s linear;
  }

  .choice-card:hover,
  .choice-card.is-active {
    transform: none;
  }
}
