/* Reset e stili di base */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-light: #60a5fa;
  --secondary: white;
  --text-dark: #1e293b;
  --text-light: #f8fafc;
  --text-muted: #64748b;
  --background: white;
  --card-bg: #ffffff;
  --border-radius: 12px;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1),
    0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1),
    0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --transition: all 0.3s ease;
}

body {
  font-family: "Poppins", sans-serif;
  line-height: 1.6;
  color: var(--text-dark);
  background-color: var(--background);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  cursor: none;
}

main {
  flex: 1;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  position: relative;
  z-index: 2;
}

/* Loader */
.loader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: var(--primary);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}

.loader-content {
  text-align: center;
}

.loader-text {
  color: var(--text-light);
  font-size: 2.5rem;
  margin-bottom: 1rem;
  letter-spacing: 3px;
}

.progress-bar {
  width: 300px;
  height: 4px;
  background-color: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
  overflow: hidden;
}

.progress {
  height: 100%;
  width: 0;
  background-color: var(--text-light);
  transition: width 0.5s ease;
}

/* Custom Cursor */
.cursor {
  position: fixed;
  width: 10px;
  height: 10px;
  background-color: var(--primary);
  border-radius: 50%;
  pointer-events: none;
  transform: translate(-50%, -50%);
  z-index: 9999;
  transition: transform 0.1s ease;
}

.cursor-follower {
  position: fixed;
  width: 30px;
  height: 30px;
  border: 2px solid var(--primary);
  border-radius: 50%;
  pointer-events: none;
  transform: translate(-50%, -50%);
  z-index: 9998;
  transition: transform 0.3s ease, width 0.3s ease, height 0.3s ease;
}

/* Header e navigazione */
header {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: var(--text-light);
  padding: 1rem 0;
  position: fixed;
  width: 100%;
  top: 0;
  z-index: 1000;
  box-shadow: var(--shadow-md);
}

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

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

.logo img {
  width: 50px;
  height: 50px;
  border-radius: 0;
  transition: var(--transition);
}

nav ul {
  list-style: none;
  display: flex;
}

nav ul li {
  margin-left: 1.5rem;
}

nav ul li a {
  color: var(--text-light);
  text-decoration: none;
  font-weight: 600;
  transition: var(--transition);
  position: relative;
  padding: 0.5rem 0;
}

nav ul li a::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background-color: var(--text-light);
  transition: var(--transition);
}

nav ul li a:hover::after,
nav ul li a.active-link::after {
  width: 100%;
}

nav ul li a:hover {
  color: var(--secondary);
}

.hamburger {
  display: none;
  cursor: pointer;
  font-size: 1.5rem;
  background: transparent;
  border: none;
  color: var(--text-light);
}

.hamburger i {
  font-size: 1.8rem;
}

/* Avatar nel menu */
.avatar-container {
  display: none;
}

.avatar-menu {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: var(--shadow-lg);
  margin-bottom: 1.5rem;
}

/* Home */
#home {
  padding: 8rem 0 4rem;
  min-height: 100vh;
  display: flex;
  align-items: center;
  position: relative;
  overflow: hidden;
}

/* Shape Divider */
.shape-divider {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  overflow: hidden;
  line-height: 0;
  transform: rotate(180deg);
}

.shape-divider svg {
  position: relative;
  display: block;
  width: calc(100% + 1.3px);
  height: 120px;
}

.shape-divider .shape-fill {
  fill: var(--primary-light);
  opacity: 0.1;
}

/* Nuovo layout per la hero section */
.hero-content-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.avatar-wrapper {
  margin-bottom: 2rem;
  position: relative;
}

.avatar {
  width: 220px;
  height: 220px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: var(--shadow-lg);
  border: 4px solid var(--primary);
  transition: var(--transition);
  display: block;
  animation: float 6s ease-in-out infinite;
}

@keyframes float {
  0% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-20px);
  }
  100% {
    transform: translateY(0px);
  }
}

.hero-content {
  width: 100%;
  max-width: 800px;
}

h1,
h2,
h3 {
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 1.5rem;
  color: var(--primary);
}

h1 {
  font-size: 3.5rem;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  position: relative;
}

/* Glitch Effect */
.glitch {
  position: relative;
}

.glitch::before {
  left: 2px;
  text-shadow: -2px 0 var(--primary-light);
  animation: glitch-animation 2s infinite linear alternate-reverse;
}

/* Typing Effect */
.typing-container {
  font-size: 1.5rem;
  margin-bottom: 1.5rem;
  height: 40px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.static-text {
  color: var(--text-dark);
  font-weight: 500;
}

.dynamic-text {
  color: var(--primary);
  font-weight: 700;
  position: relative;
}

.dynamic-text::after {
  content: "";
  position: absolute;
  right: -5px;
  top: 0;
  height: 100%;
  width: 2px;
  background-color: var(--primary);
  animation: blink 0.7s infinite;
}

@keyframes blink {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0;
  }
}

.section-title {
  font-size: 2.5rem;
  text-align: center;
  margin-bottom: 2.5rem;
  position: relative;
  display: inline-block;
  left: 50%;
  transform: translateX(-50%);
}

.section-title::after {
  content: "";
  position: absolute;
  bottom: -10px;
  left: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, transparent, var(--primary), transparent);
}

.description {
  font-size: 1.1rem;
  margin-bottom: 2rem;
  color: var(--text-dark);
  line-height: 1.8;
}

.description strong {
  color: var(--primary);
  font-weight: 600;
}

.cta-container {
  margin-top: 2rem;
  text-align: center;
}

.cta-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: var(--text-light);
  padding: 0.9rem 2rem;
  text-decoration: none;
  border-radius: var(--border-radius);
  font-weight: 600;
  transition: var(--transition);
  box-shadow: var(--shadow-md);
  border: none;
  cursor: pointer;
  font-size: 1rem;
  position: relative;
  overflow: hidden;
  z-index: 1;
}

.cta-button::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 0%;
  height: 100%;
  background: linear-gradient(135deg, var(--primary-dark), var(--primary));
  transition: width 0.5s ease;
  z-index: -1;
}

.cta-button:hover::before {
  width: 100%;
}

.cta-button:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}

.cta-button i {
  font-size: 1.2rem;
}

.scroll-arrow {
  font-size: 2.5rem;
  color: var(--primary);
  text-decoration: none;
  display: block;
  margin-top: 3rem;
  text-align: center;
  animation: bounce 1.5s infinite;
  transition: var(--transition);
}

.scroll-arrow i {
  font-size: 2.5rem;
}

@keyframes bounce {
  0%,
  20%,
  50%,
  80%,
  100% {
    transform: translateY(0);
  }
  40% {
    transform: translateY(-20px);
  }
  60% {
    transform: translateY(-10px);
  }
}

/* Curriculum */
#curriculum {
  padding: 6rem 0;
  background-color: var(--background);
  position: relative;
}

.section {
  margin-bottom: 4rem;
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.section.visible {
  opacity: 1;
  transform: translateY(0);
}

.section h3 {
  display: flex;
  align-items: center;
  cursor: pointer;
  padding: 1rem;
  background: linear-gradient(135deg, var(--primary-light), var(--primary));
  color: var(--text-light);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  position: relative;
  overflow: hidden;
  z-index: 1;
}

.section h3::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 0%;
  height: 100%;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  transition: width 0.5s ease;
  z-index: -1;
}

.section h3:hover::before {
  width: 100%;
}

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

.toggle-icon {
  margin-left: auto;
  transition: var(--transition);
}

.card-container {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  margin-top: 1.5rem;
  max-height: 700px;
  overflow-y: auto;
  padding: 1rem;
  scrollbar-width: thin;
  scrollbar-color: var(--primary) transparent;
}

.card-container::-webkit-scrollbar {
  width: 8px;
}

.card-container::-webkit-scrollbar-track {
  background: transparent;
}

.card-container::-webkit-scrollbar-thumb {
  background-color: var(--primary);
  border-radius: 20px;
}

.card {
  background-color: var(--card-bg);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-md);
  padding: 2rem;
  width: calc(33.333% - 1.5rem);
  transition: var(--transition);
  border-bottom: 3px solid var(--primary);
  display: flex;
  flex-direction: column;
  transform: translateY(50px);
  opacity: 0;
  animation: card-appear 0.5s forwards;
  animation-delay: calc(var(--i) * 0.1s);
}

@keyframes card-appear {
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-lg);
}

.card img {
  max-width: 100%;
  height: auto;
  margin-bottom: 1.5rem;
  border-radius: var(--border-radius);
  object-fit: contain;
  max-height: 150px;
  align-self: center;
}

.card h4 {
  font-family: "Poppins", sans-serif;
  color: var(--primary);
  margin-bottom: 1rem;
  font-size: 1.3rem;
  border-bottom: 2px solid var(--primary-light);
  padding-bottom: 0.5rem;
}

.card p {
  font-size: 1rem;
  margin-bottom: 1.5rem;
  color: var(--text-dark);
}

.card ul {
  margin-bottom: 1.5rem;
  padding-left: 1.5rem;
}

.card ul li {
  margin-bottom: 0.5rem;
}

.card a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
  transition: var(--transition);
}

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

.text-center {
  text-align: center;
  width: 100%;
  margin-top: 3rem;
}

/* Contatti */
#contacts {
  padding: 6rem 0;
  background-color: var(--card-bg);
  min-height: 100vh;
  position: relative;
}

.contact-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 800px;
  margin: 0 auto;
  padding: 3rem;
  background-color: var(--card-bg);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-lg);
  border: 1px solid rgba(0, 0, 0, 0.05);
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  width: 100%;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.form-group label {
  font-weight: 600;
  color: var(--text-dark);
}

.input-container {
  position: relative;
  display: flex;
  align-items: center;
}

.input-container i {
  position: absolute;
  left: 15px;
  color: var(--primary);
  font-size: 1.2rem;
}

.textarea-container i {
  top: 15px;
}

.form-group input,
.form-group textarea {
  padding: 1rem 1rem 1rem 45px;
  border: 1px solid #e2e8f0;
  border-radius: var(--border-radius);
  font-size: 1rem;
  width: 100%;
  transition: var(--transition);
  font-family: "Poppins", sans-serif;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-group textarea {
  min-height: 150px;
  resize: vertical;
}

.submit-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
  padding: 1rem 2rem;
  border: none;
  border-radius: var(--border-radius);
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  align-self: center;
  width: auto;
  margin-top: 1rem;
  font-size: 1rem;
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
  z-index: 1;
}

.submit-btn::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 0%;
  height: 100%;
  background: linear-gradient(135deg, var(--primary-dark), var(--primary));
  transition: width 0.5s ease;
  z-index: -1;
}

.submit-btn:hover::before {
  width: 100%;
}

.submit-btn:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}

.submit-btn i {
  font-size: 1.2rem;
}

/* Social links styling */
.social-container {
  margin-top: 3rem;
  text-align: center;
  width: 100%;
}

.social-container h3 {
  margin-bottom: 1.5rem;
}

.social-links {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}

/* Stile per le icone social con sfondo bianco */
.social-links a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: white;
  color: var(--primary);
  text-decoration: none;
  transition: var(--transition);
  box-shadow: var(--shadow-md);
  border: 2px solid var(--primary);
  position: relative;
  overflow: hidden;
}

.social-links a::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--primary);
  transform: translateY(100%);
  transition: transform 0.3s ease;
  z-index: 0;
}

.social-links a:hover::before {
  transform: translateY(0);
}

.social-links a:hover {
  transform: translateY(-5px) scale(1.1);
  box-shadow: var(--shadow-lg);
}

.social-links a:hover img {
  filter: brightness(0) invert(1);
}

.social-links a img {
  width: 30px;
  height: 30px;
  object-fit: contain;
  filter: none;
  position: relative;
  z-index: 1;
  transition: filter 0.3s ease;
}

/* Footer */
footer {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: var(--text-light);
  text-align: center;
  padding: 2rem 0;
  margin-top: 2rem;
  position: relative;
}

/* Back to top button */
.back-to-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 50px;
  height: 50px;
  background: var(--primary);
  color: white;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  z-index: 99;
  box-shadow: var(--shadow-md);
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
}

.back-to-top i {
  font-size: 1.5rem;
}

/* Reveal animations */
.reveal-left,
.reveal-right,
.reveal-top,
.reveal-bottom {
  opacity: 0;
  transition: all 1s ease;
}

.reveal-left {
  transform: translateX(-100px);
}

.reveal-right {
  transform: translateX(100px);
}

.reveal-top {
  transform: translateY(-100px);
}

.reveal-bottom {
  transform: translateY(100px);
}

.reveal-left.active,
.reveal-right.active,
.reveal-top.active,
.reveal-bottom.active {
  opacity: 1;
  transform: translate(0);
}

/* Responsive Design */
@media (max-width: 1024px) {
  .card {
    width: calc(50% - 1rem);
  }

  .card-container {
    max-height: 500px;
  }
}

@media (max-width: 768px) {
  .hamburger {
    display: block;
  }

  nav ul {
    display: none;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    padding: 5rem 2rem 2rem;
    z-index: 1000;
    align-items: center;
    justify-content: center;
  }

  nav ul.show {
    display: flex;
  }

  .avatar-container {
    display: block;
  }

  nav ul li {
    margin: 1rem 0;
    margin-left: 0;
  }

  nav ul li a {
    font-size: 1.5rem;
    text-align: center;
  }

  h1 {
    font-size: 2.5rem;
  }

  h2 {
    font-size: 2rem;
  }

  .card {
    width: 100%;
  }

  .contact-container {
    padding: 2rem 1.5rem;
  }

  .cursor,
  .cursor-follower {
    display: none;
  }

  body {
    cursor: auto;
  }
}

@media (max-width: 480px) {
  h1 {
    font-size: 2rem;
  }

  h2 {
    font-size: 1.8rem;
  }

  .avatar-menu {
    width: 100px;
    height: 100px;
  }

  .avatar {
    width: 180px;
    height: 180px;
  }

  .contact-container {
    padding: 1.5rem 1rem;
  }

  .form-group input,
  .form-group textarea,
  .submit-btn {
    font-size: 0.9rem;
  }

  .typing-container {
    font-size: 1.2rem;
    flex-direction: column;
    height: auto;
  }
}

/* Animazioni e effetti */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

section {
  animation: fadeIn 0.8s ease-out;
}

.go-live-btn,
.view-code-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 0.8rem 1.5rem;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
  border: none;
  border-radius: var(--border-radius);
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 600;
  transition: var(--transition);
  text-decoration: none;
  box-shadow: var(--shadow-sm);
  margin-top: auto;
  position: relative;
  overflow: hidden;
  z-index: 1;
}

.go-live-btn::before,
.view-code-btn::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 0%;
  height: 100%;
  background: linear-gradient(135deg, var(--primary-dark), var(--primary));
  transition: width 0.5s ease;
  z-index: -1;
}

.go-live-btn:hover::before,
.view-code-btn:hover::before {
  width: 100%;
}

.go-live-btn:hover,
.view-code-btn:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.site-links {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-top: 1.5rem;
  flex-wrap: wrap;
}

/* Stile per tutti i link di tipo "testo" (incluso "Scarica Certificato") */
.testo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 0.8rem 1.5rem;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white !important;
  border-radius: var(--border-radius);
  text-decoration: none;
  font-weight: 600;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
  font-size: 0.9rem;
  text-align: center;
  position: relative;
  overflow: hidden;
  z-index: 1;
}

.testo::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 0%;
  height: 100%;
  background: linear-gradient(135deg, var(--primary-dark), var(--primary));
  transition: width 0.5s ease;
  z-index: -1;
}

.testo:hover::before {
  width: 100%;
}

.testo:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  color: white !important;
}

/* Notification styles */
.notification {
  padding: 1rem;
  margin-bottom: 1.5rem;
  border-radius: var(--border-radius);
  text-align: center;
  font-weight: 500;
  animation: fadeIn 0.3s ease-in-out;
}

.notification.success {
  background-color: #d1fae5;
  color: #065f46;
  border: 1px solid #a7f3d0;
}

.notification.error {
  background-color: #fee2e2;
  color: #b91c1c;
  border: 1px solid #fecaca;
}

/* Spinner */
.spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: #fff;
  animation: spin 1s ease-in-out infinite;
  margin-right: 8px;
  vertical-align: middle;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Disabled button */
.submit-btn:disabled {
  background: #94a3b8;
  cursor: not-allowed;
  transform: none;
}

/* Azienda logo */
.azienda {
  height: auto;
  width: auto;
  max-height: 80px;
}

/* Site image */
.site-image {
  height: auto;
  width: auto;
  max-width: 150px;
  max-height: 150px;
}

/* Assicura che le icone nei social siano visibili */
.social-links img.icona {
  width: 30px;
  height: 30px;
  display: block;
}

/* Assicura che tutti i link "Scarica Certificato" siano bianchi */
.card a[download] {
  color: white !important;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  padding: 0.8rem 1.5rem;
  border-radius: var(--border-radius);
  text-decoration: none;
  font-weight: 600;
  display: inline-block;
  text-align: center;
  width: 100%;
  margin-top: 1rem;
  position: relative;
  overflow: hidden;
  z-index: 1;
}

.card a[download]::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 0%;
  height: 100%;
  background: linear-gradient(135deg, var(--primary-dark), var(--primary));
  transition: width 0.5s ease;
  z-index: -1;
}

.card a[download]:hover::before {
  width: 100%;
}

.card a[download]:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

/* Aggiungi queste nuove regole CSS alla fine del tuo file style.css */

/* Stili per la sezione curriculum migliorata */
.section h3 {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  padding: 1.2rem;
  background: linear-gradient(135deg, var(--primary-light), var(--primary));
  color: var(--text-light);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  position: relative;
  overflow: hidden;
  z-index: 1;
}

.section h3 i {
  font-size: 1.5rem;
}

.section h3::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 0%;
  height: 100%;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  transition: width 0.5s ease;
  z-index: -1;
}

.section h3:hover::before {
  width: 100%;
}

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

.toggle-icon {
  margin-left: auto;
  transition: var(--transition);
}

.card-container {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  margin-top: 1.5rem;
  max-height: 700px;
  overflow-y: auto;
  padding: 1rem;
  scrollbar-width: thin;
  scrollbar-color: var(--primary) transparent;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

/* Stili per le card animate */
.card {
  background-color: var(--card-bg);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-md);
  padding: 2rem;
  width: calc(33.333% - 1.5rem);
  transition: all 0.5s cubic-bezier(0.25, 0.8, 0.25, 1);
  border-bottom: 3px solid var(--primary);
  display: flex;
  flex-direction: column;
  transform: translateY(50px);
  opacity: 0;
  position: relative;
  overflow: hidden;
}

.card.animated {
  animation: card-appear 0.5s forwards;
  animation-delay: calc(var(--i) * 0.1s);
}

.card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 5px;
  background: linear-gradient(
    90deg,
    var(--primary-light),
    var(--primary),
    var(--primary-dark)
  );
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.5s ease;
}

.card:hover::before {
  transform: scaleX(1);
}

.card:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: var(--shadow-lg);
}

/* Stili per le card degli attestati */
.card-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.certificate-icon {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background-color: var(--primary-light);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.5rem;
}

.certificate-icon i {
  font-size: 1.8rem;
}

/* Stili per le card delle lingue */
.language-card {
  text-align: center;
}

.language-flag {
  width: 100px;
  height: 100px;
  margin: 0 auto 1.5rem;
  border-radius: 50%;
  overflow: hidden;
  border: 3px solid var(--primary);
}

.language-flag img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.language-level {
  margin: 1rem 0;
  font-size: 1.1rem;
}

.level-indicator {
  margin: 1.5rem 0;
}

.level-dots {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.level-dot {
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background-color: #e2e8f0;
  transition: background-color 0.3s ease;
}

.level-dot.active {
  background-color: var(--primary);
}

.level-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Stili per le esperienze lavorative */
.timeline-container {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  position: relative;
}

.timeline-container::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 2px;
  height: 100%;
  background: linear-gradient(
    to bottom,
    transparent,
    var(--primary),
    transparent
  );
}

.experience-card {
  width: 100%;
  position: relative;
}

.timeline-dot {
  position: absolute;
  top: 20px;
  left: -30px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background-color: var(--primary);
  border: 3px solid white;
  box-shadow: var(--shadow-md);
}

.experience-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.company-logo {
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: white;
  border-radius: 10px;
  padding: 0.5rem;
  box-shadow: var(--shadow-sm);
}

.company-info {
  flex: 1;
}

.role-badge {
  display: inline-block;
  background-color: var(--primary-light);
  color: white;
  padding: 0.3rem 0.8rem;
  border-radius: 20px;
  font-size: 0.9rem;
  margin-top: 0.5rem;
}

.experience-period,
.experience-location {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.8rem;
  color: var(--text-muted);
}

.experience-activities {
  margin: 1.5rem 0;
}

.experience-activities h5 {
  margin-bottom: 0.8rem;
  color: var(--primary);
}

.activities-list {
  list-style: none;
  padding: 0;
}

.activities-list li {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  margin-bottom: 0.8rem;
}

.activities-list li i {
  color: var(--primary);
  font-size: 1.2rem;
}

/* Stili per le card di istruzione */
.education-card {
  transform-style: preserve-3d;
  perspective: 1000px;
}

.education-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.education-logo {
  width: 80px;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: white;
  border-radius: 10px;
  padding: 0.5rem;
  box-shadow: var(--shadow-sm);
}

.education-logo img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.eqf-badge {
  background-color: var(--primary);
  color: white;
  padding: 0.3rem 0.8rem;
  border-radius: 20px;
  font-size: 0.9rem;
  font-weight: 600;
}

.education-institute,
.education-period,
.education-location {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.8rem;
}

.education-skills {
  margin: 1.5rem 0;
}

.education-skills h5 {
  margin-bottom: 0.8rem;
  color: var(--primary);
}

.skills-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.skill-pill {
  background-color: #f1f5f9;
  padding: 0.3rem 0.8rem;
  border-radius: 20px;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.skill-pill i {
  color: var(--primary);
}

.education-description {
  margin: 1rem 0;
  font-style: italic;
  color: var(--text-muted);
}

/* Stili per le competenze */
.skills-tabs {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.skill-tab {
  padding: 0.8rem 1.5rem;
  background-color: #f1f5f9;
  border-radius: 30px;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.skill-tab i {
  font-size: 1.2rem;
}

.skill-tab.active {
  background-color: var(--primary);
  color: white;
}

.skills-container {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  transition: opacity 0.3s ease;
}

.skills-container.fade-out {
  opacity: 0;
}

.skill-card {
  text-align: center;
}

.skill-icon {
  width: 80px;
  height: 80px;
  margin: 0 auto 1.5rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.skill-icon img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.skill-progress {
  margin: 1.5rem 0;
}

.progress-bar {
  height: 8px;
  background-color: #e2e8f0;
  border-radius: 4px;
  overflow: hidden;
  --progress-color: var(--primary);
}

.progress-fill {
  height: 100%;
  width: 0;
  background-color: var(--progress-color);
  transition: width 1s ease;
}

/* Stili per i siti web */
.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 2rem;
}

.portfolio-card {
  padding: 0;
  overflow: hidden;
  width: 100%;
}

.portfolio-image {
  position: relative;
  height: 200px;
  overflow: hidden;
}

.portfolio-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.portfolio-card:hover .portfolio-image img {
  transform: scale(1.1);
}

.portfolio-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(37, 99, 235, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.portfolio-card:hover .portfolio-overlay {
  opacity: 1;
}

.portfolio-buttons {
  display: flex;
  gap: 1rem;
}

.portfolio-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background-color: white;
  color: var(--primary);
  padding: 0.5rem 1rem;
  border-radius: 30px;
  font-weight: 600;
  transition: all 0.3s ease;
  transform: translateY(20px);
  opacity: 0;
  transition: transform 0.3s ease, opacity 0.3s ease, background-color 0.3s ease;
}

.portfolio-card:hover .portfolio-btn {
  transform: translateY(0);
  opacity: 1;
}

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

.view-btn {
  transition-delay: 0.1s;
}

.code-btn {
  transition-delay: 0.2s;
}

.portfolio-info {
  padding: 1.5rem;
}

.portfolio-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
}

.portfolio-tag {
  background-color: #f1f5f9;
  padding: 0.2rem 0.8rem;
  border-radius: 20px;
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Messaggio di errore */
.error-message {
  background-color: #fee2e2;
  color: #b91c1c;
  padding: 1.5rem;
  border-radius: var(--border-radius);
  margin: 2rem 0;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.error-message i {
  font-size: 3rem;
}

.reload-btn {
  background-color: #b91c1c;
  color: white;
  padding: 0.5rem 1rem;
  border-radius: var(--border-radius);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
}

.reload-btn:hover {
  background-color: #991b1b;
}

/* Animazioni per AOS (Animate On Scroll) */
[data-aos] {
  opacity: 0;
  transition-property: opacity, transform;
}

[data-aos="fade-up"] {
  transform: translateY(50px);
}

[data-aos="fade-down"] {
  transform: translateY(-50px);
}

[data-aos="fade-right"] {
  transform: translateX(-50px);
}

[data-aos="fade-left"] {
  transform: translateX(50px);
}

[data-aos="zoom-in"] {
  transform: scale(0.8);
}

[data-aos="flip-up"] {
  transform: perspective(1000px) rotateX(30deg);
}

[data-aos].aos-animate {
  opacity: 1;
  transform: translate(0) scale(1) rotate(0);
}

/* Responsive per la sezione curriculum */
@media (max-width: 1024px) {
  .card {
    width: calc(50% - 1rem);
  }

  .portfolio-grid {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  }
}

@media (max-width: 768px) {
  .card {
    width: 100%;
  }

  .skills-tabs {
    flex-wrap: wrap;
  }

  .skill-tab {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
  }

  .timeline-container::before {
    left: 20px;
  }

  .timeline-dot {
    left: 10px;
  }

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

@media (max-width: 480px) {
  .card-header {
    flex-direction: column;
    text-align: center;
  }

  .education-header {
    flex-direction: column;
  }

  .portfolio-buttons {
    flex-direction: column;
  }
}

/* Mobile optimizations for curriculum section */
@media (max-width: 768px) {
  /* Center curriculum title */
  #curriculum .section-title {
    text-align: center !important;
    width: 100% !important;
    left: auto !important;
    transform: none !important;
  }

  /* Optimize site images for mobile */
  .site-image {
    max-height: 120px !important;
    object-fit: contain !important;
  }

  /* Remove scrollable containers */
  .card-container {
    max-height: none !important;
    overflow-y: visible !important;
  }

  /* Improve mobile sites grid */
  .mobile-sites-grid {
    display: flex;
    flex-direction: column;
    gap: 1rem;
  }

  .mobile-sites-grid .portfolio-card {
    width: 100%;
    margin-bottom: 1.5rem;
  }

  .mobile-sites-grid .portfolio-image {
    height: 120px !important;
  }
}

/* Aggiungi queste regole specifiche per la sezione competenze su mobile */

/* Stili per la sezione competenze su mobile */
@media (max-width: 768px) {
  /* Rimuovi lo scrolling per la sezione competenze */
  #competenze .card-container {
    max-height: none !important;
    overflow-y: visible !important;
    padding-bottom: 2rem;
  }

  /* Migliora il layout delle tab delle competenze */
  #competenze .skills-tabs {
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
  }

  #competenze .skill-tab {
    width: calc(50% - 0.5rem);
    padding: 0.7rem 1rem;
    justify-content: center;
    font-size: 0.9rem;
  }

  /* Migliora il layout delle card delle competenze */
  #competenze .skills-container {
    flex-direction: column;
  }

  #competenze .skill-card {
    width: 100% !important;
    margin-bottom: 1.5rem;
  }

  /* Assicurati che le barre di progresso siano ben visibili */
  #competenze .progress-bar {
    height: 10px;
  }

  /* Migliora la visualizzazione delle icone delle competenze */
  #competenze .skill-icon {
    width: 70px;
    height: 70px;
  }
}

/* Stili generali per tutte le sezioni del curriculum su mobile */
@media (max-width: 768px) {
  /* Rimuovi lo scrolling per tutte le sezioni */
  .card-container {
    max-height: none !important;
    overflow-y: visible !important;
  }

  /* Migliora la visualizzazione delle card */
  .card {
    width: 100% !important;
    margin-bottom: 1.5rem;
  }

  /* Assicurati che le sezioni siano ben distanziate */
  .section {
    margin-bottom: 2rem;
  }

  /* Migliora la visualizzazione dei titoli delle sezioni */
  .section h3 {
    padding: 1rem;
    font-size: 1.1rem;
  }

  /* Centra il titolo del curriculum */
  #curriculum .section-title {
    text-align: center !important;
    width: 100% !important;
    left: auto !important;
    transform: none !important;
  }
}

.social-links a:hover img {
  filter: brightness(0.5) invert(1);
}

.white:hover {
  color: white;
}

/* Loader e animazione iniziale */
.loader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: var(--primary);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}

.loader-content {
  text-align: center;
}

.loader-avatar {
  margin-bottom: 1rem;
}

.loader-avatar-img {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: var(--shadow-lg);
  border: 4px solid var(--text-light);
  opacity: 0;
  transform: translateY(-20px);
}

.loader-logo {
  margin-bottom: 0.5rem;
}

.loader-logo img {
  width: 80px;
  height: 80px;
  border-radius: 0;
  opacity: 0;
  transform: scale(0.5);
}

.loader-portfolio {
  color: var(--text-light);
  font-size: 1.5rem;
  margin-top: 0.5rem;
  margin-bottom: 1.5rem;
  letter-spacing: 2px;
  font-weight: 600;
  opacity: 0;
  transform: translateY(20px);
}

.progress-bar {
  width: 300px;
  height: 4px;
  background-color: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
  overflow: hidden;
}

.progress {
  height: 100%;
  width: 0;
  background-color: var(--text-light);
  transition: width 0.5s ease;
}
/* Stili per il menu mobile */
.hamburger {
  display: none;
  cursor: pointer;
  background: transparent;
  border: none;
  color: var(--text-light);
  z-index: 1001;
}

@media (max-width: 768px) {
  .hamburger {
    display: flex;
    align-items: center;
    justify-content: center;
  }

  nav ul {
    display: none;
  }

  .avatar-container {
    display: block;
  }

  .avatar-menu {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: var(--shadow-lg);
    margin-bottom: 1.5rem;
  }
}

/* Animazione per il menu mobile */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.mobile-menu-item {
  animation: fadeIn 0.3s ease forwards;
  animation-delay: calc(var(--i) * 0.1s);
  opacity: 0;
}

/* Aggiungi queste regole CSS alla fine del tuo file style.css */

/* Correzione per la visualizzazione delle competenze su mobile */
@media (max-width: 768px) {
  /* Previene lo scrolling orizzontale nella sezione competenze */
  #competenze .card-container {
    max-height: none !important;
    overflow-y: visible !important;
    overflow-x: hidden !important; /* Impedisce lo scrolling orizzontale */
    width: 100%;
    padding-right: 0;
    padding-left: 0;
  }

  /* Assicura che le card delle competenze si adattino correttamente */
  #competenze .skill-card {
    width: 100% !important;
    margin-bottom: 1.5rem;
    box-sizing: border-box;
  }

  /* Migliora la visualizzazione delle icone delle competenze */
  #competenze .skill-icon {
    width: 70px;
    height: 70px;
    margin: 0 auto 1rem;
    overflow: hidden; /* Nasconde eventuali parti dell'icona che sporgono */
  }

  /* Assicura che le immagini nelle icone non sporgano */
  #competenze .skill-icon img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
  }

  /* Migliora il layout delle tab delle competenze */
  #competenze .skills-tabs {
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0 0.5rem;
    box-sizing: border-box;
  }

  #competenze .skill-tab {
    width: calc(50% - 0.5rem);
    padding: 0.7rem 0.5rem;
    justify-content: center;
    font-size: 0.9rem;
    box-sizing: border-box;
    overflow: hidden; /* Nasconde eventuali parti che sporgono */
  }

  /* Assicura che le barre di progresso siano ben visibili e contenute */
  #competenze .progress-bar {
    height: 10px;
    width: 100%;
    overflow: hidden; /* Nasconde eventuali parti che sporgono */
  }

  /* Assicura che il contenitore delle competenze non causi scrolling */
  .skills-container {
    width: 100%;
    overflow-x: hidden;
    box-sizing: border-box;
  }

  /* Rimuove eventuali margini o padding eccessivi */
  #competenze h4,
  #competenze p {
    width: 100%;
    box-sizing: border-box;
    word-wrap: break-word;
  }
}

/* Stili generali per tutte le sezioni del curriculum su mobile */
@media (max-width: 768px) {
  /* Previene lo scrolling orizzontale in tutte le sezioni */
  .card-container {
    max-height: none !important;
    overflow-y: visible !important;
    overflow-x: hidden !important;
    width: 100%;
    padding-right: 0;
    padding-left: 0;
  }

  /* Assicura che tutte le card si adattino correttamente */
  .card {
    width: 100% !important;
    margin-bottom: 1.5rem;
    box-sizing: border-box;
    overflow: hidden; /* Nasconde eventuali parti che sporgono */
  }

  /* Assicura che le sezioni siano ben distanziate e non causino scrolling */
  .section {
    margin-bottom: 2rem;
    width: 100%;
    overflow: hidden;
  }

  /* Migliora la visualizzazione dei titoli delle sezioni */
  .section h3 {
    padding: 1rem;
    font-size: 1.1rem;
    width: 100%;
    box-sizing: border-box;
    overflow: hidden; /* Nasconde eventuali parti che sporgono */
  }

  /* Centra il titolo del curriculum */
  #curriculum .section-title {
    text-align: center !important;
    width: 100% !important;
    left: auto !important;
    transform: none !important;
  }

  /* Assicura che le immagini non causino scrolling orizzontale */
  img {
    max-width: 100%;
    height: auto;
  }

  /* Assicura che i bottoni non causino scrolling orizzontale */
  .go-live-btn,
  .view-code-btn,
  .submit-btn,
  .cta-button {
    max-width: 100%;
    box-sizing: border-box;
    white-space: normal;
  }
}

/* media all query mobile */
@media (max-width: 768px) {
  /* Rimuove lo scrolling orizzontale nella sezione curriculum */
  .card-container {
    height: 600px !important; /* Imposta un'altezza fissa per evitare lo scrolling */
    overflow-y: auto !important;
    overflow-x: hidden !important; /* Impedisce lo scrolling orizzontale */
  }
}

.form-group {
  margin-bottom: 1.5rem;
  font-family: "Poppins", sans-serif;
}

.form-group label {
  font-weight: 600;
  display: block;
  margin-bottom: 0.5rem;
}

.input-container {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 0.5rem;
}

#captchaCanvas {
  width: 250px;
  height: 40px;
  background: #f1f5f9;
  border-radius: 8px;
  font-family: "Poppins", sans-serif;
}

#refreshCaptcha {
  padding: 0.4rem 0.8rem;
  font-size: 0.8rem;
  border-radius: 8px;
  background: #2563eb; /* oppure var(--primary) se hai una variabile */
  color: white;
  border: none;
  cursor: pointer;
}

#captchaInput {
  flex: 1;
  min-width: 180px;
  padding: 0.4rem;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font-size: 0.9rem;
}

#refreshCaptcha,
#captchaInput,
.send {
  font-size: 1.5rem;
}

.form-group {
  margin-bottom: 25px;
}

.form-group label {
  display: block;
  margin-bottom: 12px;
  font-weight: 600;
  color: #2d3748;
  font-size: 16px;
}

.captcha-container-wrapper {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 15px;
}

.captcha-display {
  flex: 1;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
  border: 2px solid rgba(255, 255, 255, 0.8);
  transition: all 0.3s ease;
}

.captcha-display:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

#captchaCanvas {
  width: 100%;
  height: 70px;
  display: block;
  cursor: pointer;
  background: transparent;
}

#refreshCaptcha {
  flex: 0 0 auto;
  width: 50px;
  height: 50px;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  border: none;
  border-radius: 12px;
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

#refreshCaptcha:hover {
  background: linear-gradient(135deg, #4f46e5, #7c3aed);
  transform: translateY(-2px) rotate(180deg);
  box-shadow: 0 8px 25px rgba(99, 102, 241, 0.4);
}

.input-container {
  position: relative;
}

#captchaInput {
  width: 100%;
  padding: 15px 20px;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 500;
  background: rgba(248, 250, 252, 0.8);
  transition: all 0.3s ease;
  letter-spacing: 2px;
  text-align: center;
  text-transform: uppercase;
}

#captchaInput:focus {
  outline: none;
  border-color: #6366f1;
  background: white;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
  transform: translateY(-1px);
}

#captchaInput.valid {
  border-color: #10b981;
  background: rgba(16, 185, 129, 0.05);
}

#captchaInput.invalid {
  border-color: #ef4444;
  background: rgba(239, 68, 68, 0.05);
  animation: shake 0.5s ease-in-out;
}

.input-status {
  position: absolute;
  right: 15px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 18px;
  transition: all 0.3s ease;
}

.input-status.valid {
  color: #10b981;
}

.input-status.invalid {
  color: #ef4444;
}

@keyframes shake {
  0%,
  100% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-5px);
  }
  75% {
    transform: translateX(5px);
  }
}

/* Responsive */
@media (max-width: 480px) {
  .captcha-container-wrapper {
    gap: 8px;
  }

  .captcha-display {
    min-width: 0; /* Permette al flex item di rimpicciolire */
  }

  #captchaCanvas {
    height: 60px;
    min-width: 280px; /* Assicura spazio sufficiente per 8 caratteri */
  }

  #refreshCaptcha {
    width: 45px;
    height: 45px;
    flex-shrink: 0; /* Non si riduce mai */
  }

  #captchaInput {
    padding: 12px 16px;
    font-size: 14px;
  }
}

#captchaInput {
  font-family: monospace;
  text-transform: none;
  font-size: 1rem;
  letter-spacing: 2px;
}
