body {
    min-height: 100dvh;
    display: grid;
    place-items: center;
    background: #0a0a0f;
    font-family: system-ui, -apple-system, sans-serif; color: #e2e8f0;
    /*padding: 1.5rem;*/
}

/* ── Card ── */
.card {
    width: 100%; max-width: 420px;
    background: rgba(255, 255, 255, 0.04); backdrop-filter: blur(24px) saturate(160%);
    -webkit-backdrop-filter: blur(24px) saturate(160%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px; padding: 2rem 1.75rem;
    box-shadow:0 16px 48px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}
.card h1 {
    font-size: 1.375rem; font-weight: 700; margin-bottom: 0.375rem;
    letter-spacing: -0.02em;
}
.card p {
    font-size: 0.875rem; color: #94a3b8;
    margin-bottom: 1.75rem;
}

    /* ── Form ── */
form {
    display: flex; flex-direction: column; gap: 1rem;
}

label {
    display: block;
    font-size: 0.8125rem; font-weight: 500; color: #cbd5e1;
    margin-bottom: 0.375rem;
}

input, select {
    width: 100%; min-height: 48px; padding: 0.75rem 1rem;
    font-size: 16px; /* previene zoom automatico iOS */
    color: #f1f5f9;
    background: rgba(255, 255, 255, 0.12); /* era 0.05 */
    border: 1px solid rgba(255, 255, 255, 0.18); /* era 0.1 */
    border-radius: 12px; -webkit-appearance: none;
    appearance: none; transition: border-color 0.2s, box-shadow 0.2s;
}
input::placeholder {
    color: #64748b;
}
input:focus, select:focus {
    border-color: rgba(99, 102, 241, 0.6);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

/* Dropdown arrow custom */
select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%2394a3b8' viewBox='0 0 16 16'%3E%3Cpath d='M4.5 6l3.5 4 3.5-4z'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 1rem center;
    padding-right: 2.5rem;
}

select option {
    background: #1e1e2e; color: #e2e8f0;
}
/* ── Textarea ── */
textarea {
  width: 100%; min-height: 100px; padding: 0.75rem 1rem;
  font-size: 16px; font-family: inherit; color: #f1f5f9;
  background: rgba(255, 255, 255, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.35); border-radius: 12px;
  -webkit-appearance: none; appearance: none;
  resize: vertical; transition: border-color 0.2s, box-shadow 0.2s;
}

textarea::placeholder {
  color: #64748b;
}

textarea:focus {
  outline: none;
  border-color: rgba(99, 102, 241, 0.6);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

/* ── Checkbox ── */
.checkbox-wrap {
  display: flex; align-items: center; gap: 0.625rem; cursor: pointer;
}

.checkbox-wrap input[type="checkbox"] {
  appearance: none; -webkit-appearance: none;
  width: 22px; height: 22px; flex-shrink: 0;
  border: 1.5px solid rgba(255, 255, 255, 0.18);
  border-radius: 6px; background: rgba(255, 255, 255, 0.12);
  cursor: pointer; transition: all 0.15s; position: relative;
}

.checkbox-wrap input[type="checkbox"]:focus-visible {
  border-color: rgba(99, 102, 241, 0.6); box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.checkbox-wrap input[type="checkbox"]:checked {
  background: #6366f1; border-color: #6366f1;
}

.checkbox-wrap input[type="checkbox"]:checked::after {
  content: ""; position: absolute; inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' fill='white' viewBox='0 0 16 16'%3E%3Cpath d='M13.78 4.22a.75.75 0 010 1.06l-7.25 7.25a.75.75 0 01-1.06 0L2.22 9.28a.75.75 0 011.06-1.06L6 10.94l6.72-6.72a.75.75 0 011.06 0z'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: center;
}
.checkbox-wrap span {
  font-size: 0.875rem; color: #cbd5e1;
}

/* ── Bottone ── */
button {
    width: 100%; min-height: 52px; margin-top: 0.5rem;
    font-size: 1rem; font-weight: 600; color: #fff;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    border: none; border-radius: 12px;
    cursor: pointer; transition: transform 0.15s, box-shadow 0.2s;
}
button:active {
    transform: scale(0.97);
}
button:hover {
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.35);
}

/* ── Bottone con spinner integrato ── */
.btn-primary {
  position: relative; width: 100%; min-height: 52px;
  font-size: 1rem; font-weight: 600; color: #fff;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  border: none; border-radius: 12px;
  cursor: pointer; transition: transform 0.15s, box-shadow 0.2s;
  display: flex; align-items: center; justify-content: center;
  gap: 0.5rem;
}

.btn-primary:active {
  transform: scale(0.97);
}

.btn-primary:disabled {
  cursor: not-allowed; opacity: 0.75; transform: none;
}

/* Spinner nascosto di default */
.btn-primary .spinner {
  display: none; width: 20px; height: 20px;
  border: 2.5px solid rgba(255, 255, 255, 0.25);
  border-top-color: #fff; border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

/* Quando è in loading: mostra spinner, nascondi testo */
.btn-primary.loading .spinner {
  display: block;
}

.btn-primary.loading .btn-text {
  display: none;
}

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

/* ── Bottone secondario (back / annulla) ── */
button.btn-secondary {
    width: 100%; min-height: 52px;
    font-size: 1rem; font-weight: 600; color: #e2e8f0; /* era #94a3b8 → più leggibile */
    background: rgba(255, 255, 255, 0.06);  /* era transparent → leggero "riempimento" */
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.22);
    border: 1px solid rgba(255, 255, 255, 0.28); /* era 0.12 */
    border-radius: 12px;
    cursor: pointer; transition: background 0.15s, border-color 0.15s;
}
button.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1); border-color: rgba(255, 255, 255, 0.28);
}
button.btn-secondary:active {
  transform: scale(0.97);
}