/* =========================================
   SEZIONE REGISTRATION - PERFECT REPLICA
   ========================================= */

/* --- VARIABILI COLORI (Dal React) --- */
:root {
  --reg-bg-base: #2c3922; /* Sfondo pattern */
  --reg-bg-carved: #2c3922; /* Sfondo form */
  --reg-green: #7a9939;
  --reg-red: #e65f5c;
  --reg-text-light: #e6ded1;
  --reg-input-bg: #232d1b; /* Input background */
}

.reg-section-container {
  position: relative;
  width: 100%;
  min-height: 100vh;
  /* Padding massiccio top per compensare l'onda e centrare visivamente */
  padding-top: 15rem;
  padding-bottom: 8rem;
  overflow: hidden;
  background-color: var(--reg-bg-base);
  color: var(--reg-text-light);
  z-index: 20;
}
@media (min-width: 768px) {
  .reg-section-container {
    padding-top: 22rem;
  }
}
@media (min-width: 1024px) {
  .reg-section-container {
    padding-top: 30rem;
  }
}

/* --- 1. TRANSITION WAVES (Top) --- */
.reg-waves-container {
  position: absolute;
  top: -1px;
  left: 0;
  width: 100%;
  height: 14rem;
  pointer-events: none;
  overflow: hidden;
  z-index: 90;
  /* Importante: line-height 0 per evitare spazi bianchi sotto gli SVG */
  line-height: 0;
}
@media (min-width: 768px) {
  .reg-waves-container {
    height: 20rem;
  }
}

.reg-wave-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 200%;
  height: 100%;
  display: flex;
}
.reg-wave-layer svg {
  width: 50%;
  height: 100%;
  color: #eae8de;
}

/* Animazioni Onde */
.duration-slow {
  animation: waveSlide 80s linear infinite;
}
.duration-medium {
  animation: waveSlide 55s linear infinite;
}
.duration-fast {
  animation: waveSlide 40s linear infinite;
}
@keyframes waveSlide {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(-50%);
  }
}

.blur-md {
  filter: blur(4px);
}
.blur-sm {
  filter: blur(2px);
}
.opacity-40 {
  opacity: 0.4;
}
.opacity-70 {
  opacity: 0.7;
}
.opacity-100 {
  opacity: 1;
}

/* --- 2. SFONDO ATMOSFERICO (Esatto React) --- */
.background-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-color: var(--reg-bg-base);
  overflow: hidden;
}

/* Pattern Conico Identico al React */
.geometric-pattern {
  position: absolute;
  inset: 0;
  background-image: conic-gradient(from 0deg at 50% 50%, #5d7538 0%, #110e0c 50%, #5d7538 100%);
  background-size: 100% 100%;
  background-repeat: no-repeat;
  /* Nessun blend mode, opacity 1 come da React */
  opacity: 1;
}

/* Spotlights */
.spotlight {
  position: absolute;
  width: 100%;
  height: 100%;
}
.spot-1 {
  top: 0;
  left: 0;
  background: radial-gradient(circle at 20% 40%, rgba(122, 153, 57, 0.15), transparent 60%);
}
.spot-2 {
  bottom: 0;
  right: 0;
  background: radial-gradient(circle at 80% 80%, rgba(166, 138, 100, 0.1), transparent 60%);
}

/* Canvas Natura */
.nature-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 10;
  pointer-events: none;
}

/* --- 3. LAYOUT GRID --- */
.reg-content-wrapper {
  position: relative;
  z-index: 40;
  max-width: 80rem; /* O il valore che preferisci (es. 1280px) */
  margin: 0 auto; /* Centra il blocco nella pagina */
  padding: 0 1.5rem; /* Evita che tocchi i bordi su schermi piccoli */
}
.reg-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 4rem;
  align-items: start;
}
@media (min-width: 1024px) {
  .reg-grid {
    grid-template-columns: 5fr 7fr;
    gap: 4rem;
  }
}

/* --- 4. COLONNA SINISTRA (Manifesto) --- */
.reg-left-col {
  padding-top: 2rem;
  position: relative;
}
@media (min-width: 1024px) {
  .reg-left-col {
    padding-top: 5rem;
  }
}

.status-line {
  height: 4px;
  width: 40px;
  background-color: var(--reg-red);
  border-radius: 99px;
  margin-bottom: 2rem;
  box-shadow: 0 0 10px rgba(230, 95, 92, 0.5);
  transition: all 0.5s ease;
}
.status-line.open {
  width: 80px;
  background-color: var(--reg-green);
  box-shadow: 0 0 10px rgba(122, 153, 57, 0.5);
}

.title-container {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

@media (min-width: 1024px) {
  .title-container {
    align-items: start;
  }
}

.reg-title {
  font-family: var(--font-primary);
  font-size: 2.4rem;
  letter-spacing: -0.15em;
  line-height: 1.5;
  color: var(--reg-text-light);
  margin-bottom: 1.5rem;
  text-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
  text-align: center;
}

.reg-subtitle {
  font-family: var(--font-secondary);
  font-size: 1.2rem;
  line-height: 1.5;
  opacity: 0.9;
  max-width: 30rem;
  text-align: center;
}

@media (min-width: 1024px) {
  .reg-title {
    font-size: 3.4rem;
    text-align: start;
  }
  .reg-subtitle {
    text-align: start;
  }
}

.text-red {
  color: var(--reg-red);
}
.text-red-dim {
  color: rgba(230, 95, 92, 0.9);
}
.text-green {
  color: var(--reg-green);
}

/* Steps */
.steps-container {
  margin-top: 3rem;
  display: flex;
  align-items: center;
  flex-direction: column;
  gap: 2rem;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  letter-spacing: 0.1em;
  transition: all 0.5s;
}
@media (min-width: 1024px) {
  .steps-container {
    align-items: start;
  }
}

.steps-container.blurred {
  opacity: 0.2;
  filter: blur(1px);
}
.steps-container.active {
  opacity: 0.7;
  filter: blur(0);
}

.step-row {
  display: flex;
  align-items: center;
  gap: 1rem;
}
.step-num {
  width: 2.5rem;
  height: 2.5rem;
  background-color: #2c3922;
  border: 1px solid rgba(230, 222, 209, 0.3);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--reg-green);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.5);
}

/* --- 5. COLONNA DESTRA (Carved Form) --- */
/* =========================================
   FORM SCAVATO & GLASSMORPHISM (Replica React)
   ========================================= */

/* --- 1. CONTENITORE SCAVATO (CARVED BOX) --- */
.carved-box {
  position: relative;
  background-color: #2c3922; /* Base scura */
  border-radius: 0.75rem;
  overflow: hidden;
  /* Ombre profonde per effetto incassato */
  box-shadow:
    inset 20px 20px 60px rgba(0, 0, 0, 0.6),
    inset -5px -5px 20px rgba(255, 255, 255, 0.02),
    0 1px 0 rgba(255, 255, 255, 0.05);
  border-top: 1px solid rgba(0, 0, 0, 0.5);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  min-height: 700px; /* Altezza minima per estetica */
}

/* --- 2. LOCKED LAYER (Vetro Smerigliato) --- */
.locked-layer {
  position: absolute;
  inset: 0;
  z-index: 50;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(30, 32, 28, 0.85); /* #1e201c / 85% */
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: transform 1.2s cubic-bezier(0.7, 0, 0.3, 1);
}

.locked-layer.unlocked {
  transform: translateY(-100%);
}

/* Mist Lines (Linee Eleganti) */
.mist-container {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  opacity: 0.3;
  color: #e6ded1;
}

.mist-line {
  position: absolute;
  left: 0;
  width: 200%; /* Doppio per loop */
  height: 100px;
}

.top-line {
  top: 20%;
  animation: mistSlide 40s ease-in-out infinite alternate;
}
.bottom-line {
  bottom: 20%;
  animation: mistSlide 50s ease-in-out infinite alternate-reverse;
}

@keyframes mistSlide {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(-50%);
  }
}

/* Content Wrapper */
.locked-content-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  z-index: 10;
}

/* --- AGGIORNAMENTO ICONE LOCKED LAYER --- */

/* Wrapper per centrare il lucchetto nel progress circle */
.lock-center-wrapper {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Il Cerchio Bello dietro al lucchetto */
.lock-circle-bg {
  width: 4rem; /* w-16 */
  height: 4rem; /* h-16 */
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.1); /* bg-white/10 */
  border: 1px solid rgba(255, 255, 255, 0.2); /* border-white/20 */
  backdrop-filter: blur(12px); /* backdrop-blur-md */
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.2); /* shadow-lg */
  color: rgba(255, 255, 255, 0.9);
}

.lock-circle-bg svg {
  width: 2rem; /* w-8 */
  height: 2rem; /* h-8 */
}

/* Progress Circle Container */
.progress-container {
  position: relative;
  width: 200px;
  height: 200px;
  margin-bottom: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.progress-svg {
  transform: rotate(0deg); /* SVG nativo, rotazione gestita internamente */
}

.track {
  fill: none;
  stroke: rgba(230, 222, 209, 0.1); /* Track tenue */
  stroke-width: 4;
}

.indicator {
  fill: none;
  stroke: #7a9939; /* Verde JE */
  stroke-width: 4;
  stroke-linecap: round;
  stroke-dasharray: 100;
  stroke-dashoffset: 100; /* Parte pieno o vuoto a seconda del JS */
  transition: stroke-dashoffset 1s linear; /* Animazione fluida ogni secondo */
}

/* Lock Icon (Assoluta al centro) */
.lock-icon-center {
  position: absolute;
  width: 3rem; /* w-12 */
  height: 3rem; /* h-12 */
  color: white;
  opacity: 0.9;
  display: flex;
  align-items: center;
  justify-content: center;
}
.lock-icon-center svg {
  width: 100%;
  height: 100%;
}

/* Typography (Identica a React) */
.locked-title {
  font-family: var(--font-primary); /* Dongle */
  font-size: 1rem;
  line-height: 2;
  letter-spacing: -0.15em;
  color: #e6ded1;
  margin-bottom: 0;
}

.locked-timer {
  font-family: var(--font-primary); /* Dongle */
  font-size: 1rem;
  font-weight: bold;
  line-height: 2;
  letter-spacing: -0.15em;
  color: white;
  font-variant-numeric: tabular-nums;
  margin-bottom: 0.5rem;
  text-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
}
@media (min-width: 375px) {
  .locked-title {
    font-size: 1.5rem;
  }
  .locked-timer {
    font-size: 2.5rem;
  }
}

.locked-subtitle {
  font-family: var(--font-secondary); /* Shantell Sans */
  font-size: 0.875rem; /* text-sm */
  color: rgba(230, 222, 209, 0.6);
}

/* Indicator Bottom */
.unlock-indicator-box {
  position: absolute;
  bottom: 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  color: rgba(230, 222, 209, 0.1);
  font-family: var(--font-mono);
  font-size: 0.625rem; /* text-[10px] */
  letter-spacing: 0.2em;
}

.arrow-down {
  width: 1.5rem;
  height: 1.5rem;
}

/* Il Cerchio attorno alla freccia in basso */
.arrow-circle-bg {
  width: 2rem; /* w-8 */
  height: 2rem; /* h-8 */
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.1); /* border-white/30 */
  background-color: rgba(255, 255, 255, 0.01); /* bg-white/5 */
  backdrop-filter: blur(4px); /* backdrop-blur-sm */
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 0.5rem;
  transition: all 0.5s ease-in-out;
}

.arrow-circle-bg svg {
  width: 1rem; /* w-4 */
  height: 1rem; /* h-4 */
}

.unlock-indicator-box.active {
  color: rgba(230, 222, 209, 0.5);
  animation: bounce 2s infinite;
}

@keyframes bounce {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-25%);
  }
}

.unlock-indicator-box.active .arrow-circle-bg {
  border: 1px solid rgba(255, 255, 255, 0.3);
  background-color: rgba(255, 255, 255, 0.05);
}

/* --- 3. CONTENUTO FORM (Inputs & Layout) --- */
.reg-form-container {
  padding: 3rem 2rem 4rem; /* Padding bottom extra per footer status */
  position: relative;
  z-index: 10;
  transition: all 1s ease;
}

@media (min-width: 768px) {
  .reg-form-container {
    padding: 3rem 2rem 6rem;
  }
}

.reg-form-container.blurred {
  filter: blur(5px);
  opacity: 0.4;
  pointer-events: none;
}

.form-header {
  text-align: center;
  border-bottom: 1px solid rgba(230, 222, 209, 0.1);
  padding-bottom: 1rem;
  margin-bottom: 1.5rem;
}
.form-title {
  font-family: var(--font-primary);
  font-size: 1.5rem;
  letter-spacing: -0.15em;
  line-height: 1.5;
}
.form-desc {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

@media (min-width: 768px) {
  .form-header {
    padding-bottom: 1.5rem;
    margin-bottom: 2rem;
  }
  .form-title {
    font-size: 2rem;
    margin-bottom: 0.25rem;
  }
}

/* Applichiamo la transizione agli elementi di testo che cambiano */
.reg-title,
.reg-subtitle,
.form-title,
.form-desc,
.status-indicator {
  transition:
    opacity 0.4s ease-out,
    transform 0.4s ease-out,
    color 0.4s ease;
  will-change: opacity, transform;
}

/* Classe che applicheremo via JS durante il cambio */
.text-changing {
  opacity: 0 !important;
  transform: translateY(10px); /* Leggero spostamento in basso mentre esce */
}

/* INPUT STYLING (Replica esatta React) */
.main-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.form-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}
@media (min-width: 768px) {
  .main-form {
    gap: 1.5rem;
  }
  .form-row {
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
  }
}

.input-group label {
  display: block;
  font-family: var(--font-primary);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: -0.15em;
  color: rgba(230, 222, 209, 0.6);
  margin-bottom: 0.25rem;
  margin-left: 0.25rem;
  text-align: center;
}
@media (min-width: 768px) {
  .input-group label {
    /* font-size: 1rem; */
    margin-bottom: 0.25rem;
    margin-left: 0.25rem;
    text-align: start;
  }
}

.input-group input,
.input-group select {
  width: 100%;
  background-color: #232d1b; /* Colore input scuro */
  border: 1px solid transparent;
  border-radius: 0.5rem;
  padding: 0.5rem 1rem;
  font-family: var(--font-secondary);
  color: var(--reg-text-light);
  font-size: 1rem;
  /* Ombra interna per effetto scavato */
  box-shadow:
    inset 0 2px 4px rgba(0, 0, 0, 0.4),
    0 1px 0 rgba(255, 255, 255, 0.05);
  outline: none;
  transition: all 0.3s;
  text-align: center;
}
@media (min-width: 768px) {
  .input-group input,
  .input-group select {
    padding: 0.75rem 1rem;
    text-align: start;
  }
}

.input-group input:focus,
.input-group select:focus {
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.8);
  border-color: rgba(122, 153, 57, 0.3);
}

.input-group input:disabled,
.input-group select:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.input-group input::placeholder {
  color: rgba(230, 222, 209, 0.2);
}

/* Custom Select */
.select-box {
  position: relative;
}
.select-box select {
  appearance: none;
  cursor: pointer;
}
.chevron {
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  opacity: 0.5;
  pointer-events: none;
}

/* CHECKBOXES WORKSHOPS */
.workshops-panel {
  background-color: #232d1b;
  padding: 1rem;
  border-radius: 0.5rem;
  box-shadow:
    inset 0 2px 4px rgba(0, 0, 0, 0.4),
    0 1px 0 rgba(255, 255, 255, 0.05);
}
.panel-label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: rgba(230, 222, 209, 0.5);
  letter-spacing: 0.1em;
  margin-bottom: 0.75rem;
  display: block;
  text-align: center;
}
.check-item {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 0.5rem;
  border-radius: 4px;
  transition: background 0.2s;
  cursor: pointer;
}
@media (min-width: 768px) {
  .panel-label {
    text-align: start;
  }
  .check-item {
    justify-content: start;
  }
}
.check-item:hover {
  background: rgba(255, 255, 255, 0.05);
}
.check-item input {
  display: none;
}

/* Box Check personalizzato */
.box {
  width: 1rem;
  height: 1rem;
  border: 1px solid rgba(230, 222, 209, 0.4);
  border-radius: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: transparent;
  transition: all 0.2s;
}
.check-item input:checked + .box {
  background: var(--reg-green);
  border-color: var(--reg-green);
  color: white;
}
.box svg {
  width: 0.75rem;
  height: 0.75rem;
}
.txt {
  font-family: var(--font-primary);
  font-size: 0.8rem;
  line-height: 1;
  letter-spacing: -0.15em;
  color: rgba(230, 222, 209, 0.6);
  margin-top: 2px;
  transition: color 0.2s;
}
.check-item input:checked ~ .txt {
  color: #e6ded1;
}

/* FILE UPLOAD */
.file-panel {
  margin-top: 1rem;
  border-radius: 0.5rem;
  transition: all 0.3s;
  cursor: pointer;
  background: rgba(35, 45, 27, 0.5);
  border: 1px solid transparent;
}

.file-panel:hover {
  border: 1px solid rgba(122, 153, 57, 0.3);
}

.file-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 0.5rem;
}
@media (min-width: 768px) {
  .file-btn {
    justify-content: start;
  }
}

.file-btn.disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.reg-icon-circle {
  width: 3rem;
  height: 3rem;
  background: rgba(122, 153, 57, 0.1);
  border: 1px solid rgba(122, 153, 57, 0.3);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--reg-green);
  transition: all 0.3s;
}

.file-panel:hover .reg-icon-circle {
  background: rgba(122, 153, 57, 0.3);
}

.reg-icon-circle .reg-add-cv {
  width: 30px;
}

.file-info {
  display: flex;
  flex-direction: column;
}
.file-info .main {
  font-family: var(--font-primary);
  font-size: 0.8rem;
  letter-spacing: -0.15em;
  line-height: 1.5;
}
.file-info .sub {
  font-family: var(--font-mono);
  font-size: 0.5rem;
  opacity: 0.5;
  letter-spacing: 0.05em;
}

/* SUBMIT BUTTON */
.submit-area {
  margin-top: 1.5rem;
}
.btn-submit {
  width: 100%;
  padding: 1rem;
  border: none;
  border-radius: 0.5rem;
  font-family: var(--font-primary);
  font-size: 1.2rem;
  line-height: 1.5;
  text-transform: uppercase;
  letter-spacing: -0.15em;
  position: relative;
  overflow: hidden;
  box-shadow:
    0 5px 15px rgba(0, 0, 0, 0.3),
    inset 0 1px 1px rgba(255, 255, 255, 0.2);
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  transition: all 0.3s;
}
@media (min-width: 768px) {
  .btn-submit {
      font-size: 1.5rem;
  }
}
.btn-submit.disabled {
  background: #4b5563;
  color: #9ca3af;
  cursor: not-allowed;
}
.btn-submit:not(.disabled) {
  background: var(--reg-green);
  color: white;
  cursor: pointer;
}
.btn-submit:not(.disabled):hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(122, 153, 57, 0.4);
}

.shine {
  position: absolute;
  top: 0;
  left: -100%;
  width: 50%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transform: skewX(-20deg);
  transition: 0.5s;
}
.btn-submit:not(.disabled):hover .shine {
  left: 150%;
  transition: 0.7s;
}

/* Footer Status */
.form-footer-status {
  position: absolute;
  bottom: 1rem;
  left: 2rem;
  right: 2rem;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  font-family: var(--font-mono);
  font-size: 0.5rem;
  opacity: 0.4;
}

/* Bulloni (Bolts) */
.reg-bolt {
  position: absolute;
  width: 1rem;
  height: 1rem;
  background: #1a2214;
  border-radius: 50%;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.05),
    0 2px 4px rgba(0, 0, 0, 0.8);
}
.reg-slot {
  width: 50%;
  height: 2px;
  background: #3e342b;
  opacity: 0.5;
}
.reg-bolt.reg-bolt-top-left {
  top: 1rem;
  left: 1rem;
}
.reg-bolt.reg-bolt-top-right {
  top: 1rem;
  right: 1rem;
}
.reg-bolt.reg-bolt-bottom-left {
  bottom: 1rem;
  left: 1rem;
}
.reg-bolt.reg-bolt-bottom-right {
  bottom: 1rem;
  right: 1rem;
}
.rotate-45 {
  transform: rotate(45deg);
}
.rotate-neg-45 {
  transform: rotate(-45deg);
}
.rotate-15 {
  transform: rotate(15deg);
}
.rotate-90 {
  transform: rotate(90deg);
}
