/* ==========================================================================
   Submit "Fregio" — fondo verde brillante, testo bordeaux, cornice oro
   Palette: verde #a4e884 · hover #8ee065 · active #7ad24d
            bordeaux #82112f · oro #b8935a · oro-soft #d4b889
   ========================================================================== */

input[data-drupal-selector="edit-submit"],
input[data-drupal-selector="edit-submit"].button--primary,
input[data-drupal-selector="edit-submit"].js-form-submit {
  /* --- palette --- */
  --green:        #a4e884;   /* verde brillante, fondo base */
  --green-hover:  #8ee065;   /* hover, un tono più saturo */
  --green-active: #7ad24d;   /* active, leggermente più scuro */
  --text:         #82112f;   /* bordeaux, fisso in tutti gli stati */
  --gold:         #b8935a;
  --gold-soft:    #d4b889;

  /* --- reset --- */
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  border-radius: 0;

  /* --- box --- */
  display: inline-block;
  position: relative;
  min-height: 48px;
  padding: 1em 3.6em;

  /* --- tipografia --- */
  font-family: "Cormorant Garamond", "EB Garamond", Georgia, "Times New Roman", serif;
  font-size: 0.92rem;
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;

  /* --- colori: fondo verde brillante, testo bordeaux, diamanti oro --- */
  color: var(--text);
  background-color: var(--green);
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3E%3Cpolygon points='4,0 8,4 4,8 0,4' fill='%23b8935a'/%3E%3C/svg%3E"),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3E%3Cpolygon points='4,0 8,4 4,8 0,4' fill='%23b8935a'/%3E%3C/svg%3E");
  background-position: left 1.5em center, right 1.5em center;
  background-size: 7px 7px, 7px 7px;
  background-repeat: no-repeat, no-repeat;

  /* --- cornice oro doppia: border + inset staccato dal fondo --- */
  border: 1px solid var(--gold);
  box-shadow:
    inset 0 0 0 3px var(--green),
    inset 0 0 0 4px var(--gold);

  cursor: pointer;
  transition:
    background-color .35s ease,
    box-shadow .35s ease,
    letter-spacing .35s ease;
}

/* --------------------------------------------------------------------------
   Hover / focus: il verde si accende, l'oro vibra
   -------------------------------------------------------------------------- */
input[data-drupal-selector="edit-submit"]:hover,
input[data-drupal-selector="edit-submit"]:focus-visible {
  background-color: var(--green-hover);
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3E%3Cpolygon points='4,0 8,4 4,8 0,4' fill='%23d4b889'/%3E%3C/svg%3E"),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3E%3Cpolygon points='4,0 8,4 4,8 0,4' fill='%23d4b889'/%3E%3C/svg%3E");
  box-shadow:
    inset 0 0 0 3px var(--green-hover),
    inset 0 0 0 4px var(--gold);
  letter-spacing: 0.34em;
  outline: none;
}

/* --------------------------------------------------------------------------
   Focus ring (accessibilità)
   -------------------------------------------------------------------------- */
input[data-drupal-selector="edit-submit"]:focus-visible {
  box-shadow:
    inset 0 0 0 3px var(--green-hover),
    inset 0 0 0 4px var(--gold),
    0 0 0 2px #ffffff,
    0 0 0 3px rgba(130, 17, 47, .45);
}

/* --------------------------------------------------------------------------
   Active
   -------------------------------------------------------------------------- */
input[data-drupal-selector="edit-submit"]:active {
  transform: translateY(1px);
  background-color: var(--green-active);
  box-shadow:
    inset 0 0 0 3px var(--green-active),
    inset 0 0 0 4px var(--gold);
  transition-duration: .08s;
}

/* --------------------------------------------------------------------------
   Disabled
   -------------------------------------------------------------------------- */
input[data-drupal-selector="edit-submit"]:disabled,
input[data-drupal-selector="edit-submit"][disabled] {
  opacity: .55;
  cursor: not-allowed;
  transform: none;
  filter: saturate(.6) brightness(.98);
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 480px) {
  input[data-drupal-selector="edit-submit"] {
    width: 100%;
    padding: 1em 2.6em;
    font-size: .82rem;
    letter-spacing: .24em;
    background-position: left 1em center, right 1em center;
  }
}

/* --------------------------------------------------------------------------
   Preferenze di movimento
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  input[data-drupal-selector="edit-submit"] {
    transition: none;
  }
}

/* --------------------------------------------------------------------------
   Fallback focus (browser senza :focus-visible)
   -------------------------------------------------------------------------- */
@supports not selector(:focus-visible) {
  input[data-drupal-selector="edit-submit"]:focus {
    outline: 2px solid var(--text);
    outline-offset: 3px;
  }
}


input[data-drupal-selector="edit-submit"],
input[data-drupal-selector="edit-submit"]:hover,
input[data-drupal-selector="edit-submit"]:focus-visible {
  background-image: none;
}



/* ============================================================
   Wrapper: contesto di posizionamento per i rombi
   ============================================================ */
.submit-fregio {
  position: relative;
  display: inline-block;
  line-height: 0;
}

/* ============================================================
   I due rombi rotanti
   ============================================================ */
.submit-fregio::before,
.submit-fregio::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 8px;
  height: 8px;
  margin-top: -4px;               /* centro verticale esatto */
  background: #b8935a;            /* oro */
  transform: rotate(45deg);       /* posa iniziale: rombo */
  pointer-events: none;           /* non rubano il click */
  z-index: 1;                     /* sopra l'input */
  animation: fregioSpin 5s linear infinite;
  transition: background-color .3s ease;
}

.submit-fregio::before {
  left: 22px;                     /* allineato al padding 3.6em dell'input */
}

.submit-fregio::after {
  right: 22px;
  animation-direction: reverse;   /* gira in senso opposto */
}

/* Hover: accelerano e si scaldano di colore */
.submit-fregio:hover::before,
.submit-fregio:hover::after,
.submit-fregio:focus-within::before,
.submit-fregio:focus-within::after {
  animation-duration: 1.5s;
  background: #d4b889;            /* oro-soft */
}

/* Keyframes: 45° → 405° = 360° di giro completo, loop senza scatti */
@keyframes fregioSpin {
  from { transform: rotate(45deg); }
  to   { transform: rotate(405deg); }
}

/* Accessibilità */
@media (prefers-reduced-motion: reduce) {
  .submit-fregio::before,
  .submit-fregio::after {
    animation: none;
  }
}
