/* ========================================== */
/* SISTEMA LICENZE - CSS FINALE CON PULSANTE COPIA */
/* ========================================== */

/* ========== BLOCCO COMPLETO PAGINA ========== */

html.license-blocked,
body.license-blocked {
  overflow: hidden !important;
  position: fixed !important;
  width: 100% !important;
  height: 100vh !important;
  top: 0 !important;
  left: 0 !important;
}

body.license-blocked main,
body.license-blocked header,
body.license-blocked footer,
body.license-blocked section,
body.license-blocked .album-countries,
body.license-blocked .album-hero,
body.license-blocked nav {
  filter: blur(50px) !important;
  opacity: 0.1 !important;
  pointer-events: none !important;
  user-select: none !important;
  -webkit-user-select: none !important;
  -moz-user-select: none !important;
}

/* ========== OVERLAY LICENZA ========== */

.license-overlay {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.license-overlay.is-visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.license-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

/* ========== BOX CENTRALE ========== */

.license-box {
  position: relative;
  width: 94%;
  max-width: 520px;
  background: #ffffff;
  border-radius: 24px;
  box-shadow: 0 25px 70px rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(0, 0, 0, 0.08);
  overflow: hidden;
  transform: translateY(30px) scale(0.95);
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.license-overlay.is-visible .license-box {
  transform: translateY(0) scale(1);
}

.license-overlay.license-success .license-box {
  animation: successPulse 0.5s ease;
}

@keyframes successPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

/* ========== HEADER ========== */

.license-header {
  background: linear-gradient(135deg, #151720 0%, #2a2d3f 100%);
  padding: 32px 28px 28px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.license-header::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #f4b000, #f39c12, #f4b000);
  background-size: 200% 100%;
  animation: gradientSlide 3s linear infinite;
}

@keyframes gradientSlide {
  0% { background-position: 0% 50%; }
  100% { background-position: 200% 50%; }
}

.license-icon {
  font-size: 3.5rem;
  margin-bottom: 12px;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
  animation: float 3s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-10px); }
}

.license-title {
  font-size: 1.4rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: #ffffff;
  margin: 0 0 6px;
  font-weight: 700;
}

.license-subtitle {
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.75);
  margin: 0;
  letter-spacing: 0.05em;
}

/* ========== CONTENT ========== */

.license-content {
  padding: 32px 28px 28px;
}

.license-description {
  font-size: 0.95rem;
  line-height: 1.7;
  color: #444;
  margin: 0 0 24px;
  text-align: center;
}

/* ========== FINGERPRINT/IP BOX CON PULSANTE COPIA ========== */

.license-fingerprint {
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  border: 2px dashed rgba(0, 0, 0, 0.12);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 28px;
  text-align: center;
}

.fingerprint-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: #666;
  margin-bottom: 8px;
  font-weight: 600;
}

.fingerprint-value-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

.fingerprint-value {
  font-family: 'Courier New', monospace;
  font-size: 1rem;
  color: #222;
  background: rgba(255, 255, 255, 0.8);
  padding: 10px 14px;
  border-radius: 8px;
  cursor: help;
  transition: all 0.2s ease;
  font-weight: 600;
  word-break: break-all;
  flex: 0 1 auto;
}

.fingerprint-value:hover {
  background: #fff;
  transform: scale(1.02);
}

/* ========== PULSANTE COPIA ========== */

.copy-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 14px;
  background: linear-gradient(135deg, #f4b000 0%, #f39c12 100%);
  border: none;
  border-radius: 8px;
  color: #000;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s ease;
  box-shadow: 0 4px 12px rgba(244, 176, 0, 0.3);
  flex-shrink: 0;
}

.copy-button:hover:not(:disabled) {
  background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(244, 176, 0, 0.4);
}

.copy-button:active:not(:disabled) {
  transform: translateY(0);
  box-shadow: 0 3px 8px rgba(244, 176, 0, 0.3);
}

.copy-button:disabled {
  cursor: not-allowed;
  opacity: 0.3;
  background: #ccc;
}

.copy-button.copied {
  background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
  color: white;
}

.copy-button svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.copy-success {
  font-size: 0.9rem;
  font-weight: 700;
}

/* ========== FORM ========== */

.license-form {
  margin-bottom: 24px;
}

.license-input-group {
  margin-bottom: 18px;
}

.license-input-group label {
  display: block;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #555;
  margin-bottom: 10px;
  font-weight: 600;
}

.license-input {
  width: 100%;
  padding: 14px 16px;
  border: 2px solid rgba(0, 0, 0, 0.12);
  border-radius: 12px;
  font-size: 1rem;
  font-family: 'Courier New', monospace;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  transition: all 0.25s ease;
  background: #fafafa;
}

.license-input:focus {
  outline: none;
  border-color: #f4b000;
  background: #ffffff;
  box-shadow: 0 0 0 4px rgba(244, 176, 0, 0.1);
  transform: translateY(-1px);
}

.license-input::placeholder {
  color: #aaa;
  letter-spacing: 0.1em;
}

/* ========== ERROR MESSAGE ========== */

.license-error {
  background: linear-gradient(135deg, #fff5f5 0%, #ffe5e5 100%);
  border: 1px solid #ff6b6b;
  border-left-width: 4px;
  border-radius: 10px;
  padding: 12px 16px;
  margin-bottom: 16px;
  font-size: 0.88rem;
  color: #c92a2a;
  text-align: center;
}

.license-error.shake {
  animation: shake 0.4s ease;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-10px); }
  75% { transform: translateX(10px); }
}

/* ========== BUTTON ========== */

.license-button {
  width: 100%;
  padding: 16px 24px;
  border: none;
  border-radius: 12px;
  background: linear-gradient(135deg, #f4b000 0%, #f39c12 100%);
  color: #000;
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.25s ease;
  box-shadow: 0 8px 20px rgba(244, 176, 0, 0.3);
  position: relative;
  overflow: hidden;
}

.license-button::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transform: translate(-50%, -50%);
  transition: width 0.6s ease, height 0.6s ease;
}

.license-button:hover::before {
  width: 300px;
  height: 300px;
}

.license-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(244, 176, 0, 0.4);
}

.license-button:active {
  transform: translateY(0);
  box-shadow: 0 6px 16px rgba(244, 176, 0, 0.3);
}

.license-button:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
}

.button-text,
.button-loader {
  position: relative;
  z-index: 1;
}

.button-loader {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
}

.loader-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #000;
  animation: dotPulse 1.4s infinite ease-in-out;
}

.loader-dot:nth-child(1) {
  animation-delay: -0.32s;
}

.loader-dot:nth-child(2) {
  animation-delay: -0.16s;
}

@keyframes dotPulse {
  0%, 80%, 100% {
    transform: scale(0.6);
    opacity: 0.5;
  }
  40% {
    transform: scale(1);
    opacity: 1;
  }
}

/* ========== FOOTER ========== */

.license-footer {
  text-align: center;
  padding-top: 24px;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
}

.license-footer p {
  font-size: 0.88rem;
  color: #666;
  margin: 0 0 10px;
}

.license-contact-link {
  display: inline-block;
  font-size: 0.9rem;
  color: #f4b000;
  text-decoration: none;
  font-weight: 600;
  letter-spacing: 0.05em;
  transition: all 0.2s ease;
  padding: 8px 16px;
  border-radius: 8px;
  background: rgba(244, 176, 0, 0.08);
}

.license-contact-link:hover {
  background: rgba(244, 176, 0, 0.15);
  transform: translateY(-1px);
}

/* ========== RESPONSIVE COMPLETO ========== */

/* Tablet e iPad */
@media (min-width: 769px) and (max-width: 1024px) {
  .license-box {
    width: 90%;
    max-width: 480px;
  }
}

/* Mobile normale (iPhone 12, Samsung Galaxy, ecc.) */
@media (max-width: 768px) {
  .license-box {
    width: 92%;
    max-width: none;
    border-radius: 16px;
    margin: 10px;
  }

  .license-header {
    padding: 24px 20px 20px;
  }

  .license-icon {
    font-size: 2.5rem;
    margin-bottom: 8px;
  }

  .license-title {
    font-size: 1.1rem;
    letter-spacing: 0.12em;
  }

  .license-subtitle {
    font-size: 0.85rem;
  }

  .license-content {
    padding: 24px 20px 20px;
  }

  .license-description {
    font-size: 0.88rem;
    line-height: 1.6;
  }

  .fingerprint-label {
    font-size: 0.68rem;
  }

  .fingerprint-value {
    font-size: 0.9rem;
    padding: 8px 12px;
  }
  
  .copy-button {
    padding: 8px 12px;
    font-size: 0.8rem;
  }
  
  .copy-button svg {
    width: 14px;
    height: 14px;
  }
  
  .fingerprint-value-container {
    gap: 8px;
  }

  .license-input-group label {
    font-size: 0.8rem;
  }

  .license-input {
    padding: 12px 14px;
    font-size: 0.9rem;
    letter-spacing: 0.1em;
  }

  .license-button {
    padding: 14px 20px;
    font-size: 0.88rem;
    letter-spacing: 0.12em;
  }
  
  .license-footer p {
    font-size: 0.85rem;
  }
  
  .license-contact-link {
    font-size: 0.85rem;
    padding: 6px 14px;
  }
}

/* Mobile piccoli (iPhone SE, iPhone 8, ecc.) */
@media (max-width: 380px) {
  .license-box {
    width: 94%;
    border-radius: 12px;
  }
  
  .license-header {
    padding: 20px 16px 18px;
  }
  
  .license-icon {
    font-size: 2.2rem;
  }
  
  .license-title {
    font-size: 1rem;
    letter-spacing: 0.1em;
  }
  
  .license-subtitle {
    font-size: 0.8rem;
  }
  
  .license-content {
    padding: 20px 16px 18px;
  }
  
  .license-description {
    font-size: 0.85rem;
  }
  
  .fingerprint-label {
    font-size: 0.65rem;
  }
  
  .fingerprint-value {
    font-size: 0.85rem;
    padding: 8px 10px;
  }
  
  .copy-button {
    padding: 7px 10px;
    font-size: 0.75rem;
  }
  
  .copy-button svg {
    width: 13px;
    height: 13px;
  }
  
  .fingerprint-value-container {
    gap: 6px;
  }
  
  .license-input-group label {
    font-size: 0.75rem;
  }
  
  .license-input {
    font-size: 0.85rem;
    padding: 10px 12px;
  }
  
  .license-button {
    padding: 12px 18px;
    font-size: 0.85rem;
  }
  
  .license-footer p {
    font-size: 0.8rem;
  }
  
  .license-contact-link {
    font-size: 0.8rem;
    padding: 6px 12px;
  }
}

/* Landscape mobile (telefono orizzontale) */
@media (max-height: 600px) and (orientation: landscape) {
  .license-overlay {
    overflow-y: auto;
    align-items: flex-start;
    padding: 20px 0;
  }
  
  .license-box {
    margin: 20px auto;
  }
  
  .license-header {
    padding: 18px 24px 16px;
  }
  
  .license-icon {
    font-size: 2rem;
    margin-bottom: 6px;
  }
  
  .license-title {
    font-size: 1rem;
  }
  
  .license-subtitle {
    font-size: 0.8rem;
  }
  
  .license-content {
    padding: 18px 24px 16px;
  }
  
  .license-description {
    font-size: 0.85rem;
    margin-bottom: 16px;
  }
  
  .license-fingerprint {
    margin-bottom: 16px;
    padding: 12px;
  }
  
  .license-input {
    padding: 10px 12px;
  }
  
  .license-button {
    padding: 10px 20px;
  }
  
  .license-footer {
    padding-top: 16px;
  }
}

/* Dark mode (opzionale) */
@media (prefers-color-scheme: dark) {
  .license-box {
    background: #1a1d2e;
    border-color: rgba(255, 255, 255, 0.1);
  }

  .license-description {
    color: #c8d0e0;
  }

  .license-fingerprint {
    background: linear-gradient(135deg, #252938 0%, #1f2230 100%);
    border-color: rgba(255, 255, 255, 0.15);
  }

  .fingerprint-label {
    color: #9aa3b5;
  }

  .fingerprint-value {
    color: #e8eaf0;
    background: rgba(255, 255, 255, 0.08);
  }

  .fingerprint-value:hover {
    background: rgba(255, 255, 255, 0.12);
  }

  .license-input-group label {
    color: #9aa3b5;
  }

  .license-input {
    background: #252938;
    border-color: rgba(255, 255, 255, 0.15);
    color: #e8eaf0;
  }

  .license-input:focus {
    background: #2a2d3f;
    border-color: #f4b000;
  }

  .license-footer {
    border-top-color: rgba(255, 255, 255, 0.08);
  }

  .license-footer p {
    color: #9aa3b5;
  }
}