@font-face {
  font-family: 'Inter';
  src: url('../fonts/Inter-400Regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
}

@font-face {
  font-family: 'Chalet NewYork Sixty';
  src: url('../fonts/Chalet-NewYorkSixty.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
}

:root {
  --font-sans: 'Inter', 'Segoe UI', Arial, sans-serif;
  --font-display: 'Chalet NewYork Sixty', 'Segoe UI', Arial, sans-serif;

  --color-white: #ffffff;
  --accent: #5565f5;
  --accent-rgb: 85, 101, 245;
  --accent-hover: #4656ea;
  --accent-vivid: #5e52ff;
  --primary: var(--accent);
  --error: #b42318;
  --success: #16803a;
  --blu-carino: #1877F2;

  --background: #f9f9f9;
  --surface-soft: #f8fafc;
  --border: #d8d8d8;
  --line: var(--border);
  --control-border: #d7dcea;
  --page-visual-background:
    radial-gradient(ellipse 58% 48% at 8% 8%, rgba(var(--accent-rgb), 0.24) 0%, rgba(var(--accent-rgb), 0.09) 46%, transparent 74%),
    radial-gradient(ellipse 52% 44% at 92% 28%, rgba(255, 255, 255, 0.98) 0%, rgba(255, 255, 255, 0.5) 48%, transparent 76%),
    radial-gradient(ellipse 58% 52% at 58% 100%, rgba(var(--accent-rgb), 0.12) 0%, transparent 72%),
    #f3f3f8;

  --text: #0b1324;
  --text-muted: #5d687d;
  --subtext: #2f2f2f;
  --neutral-ink: #0f172a;
  --neutral-ink-page: #171717;
  --neutral-ink-heading: #111111;
  --ink-strong: var(--neutral-ink);

  --legal-text: #2f2f2f;
  --legal-text-muted: #5e5e5e;
  --legal-line: #e7e7e7;
  --legal-link-hover: #555555;
  --legal-kicker-text: #6b6b6b;
  --legal-scroll-thumb: #b8b8b8;
  --legal-code-line: #dddddd;
  --privacy-link-bg: rgba(248, 250, 252, 0.9);
  --privacy-link-hover: rgba(238, 242, 255, 0.9);

  --radius-2xs: 8px;
  --radius-xs: 10px;
  --radius-pill: 999px;
  --space-half: 4px;
  --space-1: 8px;
  --space-2: 12px;
  --space-3: 16px;
  --space-4: 20px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 40px;
  --space-8: 48px;
  --space-9: 64px;
  --layout-content-narrow: 760px;

  --btn-height: 48px;
  --btn-padding-x: 16px;
  --btn-icon-gap: 8px;
  --motion-fast: 120ms;
  --motion-ease: cubic-bezier(0.22, 1, 0.36, 1);

  --checkbox-size: var(--space-3);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-family: var(--font-sans);
}

body {
  min-height: 100vh;
  margin: 0;
  background: var(--page-visual-background);
  background-attachment: fixed;
  background-repeat: no-repeat;
  background-size: cover;
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

button,
input,
textarea,
select {
  font: inherit;
  width: 100%;
  padding: var(--space-3);
  border: 1px solid var(--border);
  background: var(--background);
  border-radius: var(--radius-pill);
}

p,
span {
  font-family: var(--font-sans);
  color: var(--text-muted);
}

img {
  display: block;
  max-width: 100%;
}

/* ============================================
   Auth page nuova
   ============================================ */

.auth-container {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  max-width: 500px;
  margin: auto;
  padding: var(--space-4);
  background: transparent;
}

.auth-title {
  margin: 0;
  color: var(--text);
  font-family: var(--font-display);
  line-height: 2.5rem;
  text-align: center;
  font-size: clamp(1.8rem, 6vw, 2.4rem);
  font-weight: 400;
}

.auth-header {
  display: grid;
  place-items: center;
  margin-bottom: var(--space-5);
  max-width: 400px;
}

.auth-header p {
  text-align: center;
}

.auth-header img {
  width: 20%;
}

/* OAuth form - questi button usano brightness come transizione*/
.oauth-form {
  display: grid;
  gap: var(--space-3);
  width: 100%;
  max-width: 400px;
}

.container-img {
  display: flex;
  justify-content: center;
  align-items: center;
}

.oauth-form img {
  width: 18px;
  height: 18px;

  margin: auto;
}

.google {
  display: flex;
  flex-direction: row;
  gap: 10px;
  justify-content: center;

  background: var(--background);
  color: var(--text);
  font-family: var(--font-display);
  border: 1px solid var(--border);
  font-weight: 700;

  transition: filter 0.15s ease;
}

.apple {
  display: flex;
  flex-direction: row;
  gap: 10px;
  justify-content: center;

  background: var(--background);
  color: var(--text);
  font-family: var(--font-display);
  border: 1px solid var(--border);
  font-weight: 700;

  transition: filter 0.15s ease;
}

.meta {
  display: flex;
  flex-direction: row;
  gap: 10px;
  justify-content: center;

  background: var(--background);
  color: var(--text);
  font-family: var(--font-display);
  border: 1px solid var(--border);
  font-weight: 700;

  transition: filter 0.15s ease;
}

.oauth-form button i {
  margin-right: 1px;
}

.oauth-form button:hover {
  filter: brightness(0.90);
}

/* Login/Register form con mail e password - anche qui usiamo brightness per continuità*/
.auth-form {
  display: grid;
  gap: var(--space-3);
  width: 100%;
  max-width: 400px;
}

.auth-form span {
  font-size: 0.85rem;
}

.auth-form button {
  background: var(--primary);
  color: var(--color-white);
  font-family: var(--font-display);
  border: none;
  font-weight: 500;
  letter-spacing: 0.5px;

  transition: filter 0.15s ease;
}

.auth-form button:hover {
  filter: brightness(0.90);
}

.auth-form button:disabled,
.oauth-form button:disabled {
  cursor: not-allowed;
  filter: none;
  opacity: 0.55;
}

.form-message {
  margin: 0;
  padding: 11px var(--space-3);
  border: 1px solid rgba(180, 35, 24, 0.22);
  border-radius: var(--radius-pill);
  background: rgba(180, 35, 24, 0.06);
  color: var(--error) !important;
  font-size: 0.86rem;
  line-height: 1.45;
  text-align: center;
}

.form-message[role="alert"] {
  border-radius: var(--radius-pill);
}

.form-message--success {
  border-color: rgba(22, 128, 58, 0.22);
  background: rgba(22, 128, 58, 0.06);
  color: var(--success) !important;
}

/* Divider */
.auth-divider {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 400px;
  margin: var(--space-4) auto;
  gap: var(--space-3);
}

.divider-line {
  flex: 1;
  height: 1px;
  background: var(--border);
}

.divider-name {
  white-space: nowrap;
  color: var(--text-muted);
  font-size: 0.875rem;
  font-weight: 500;
}

/* Floating Label negli input */
.input-group {
  --input-surface: var(--background);
  position: relative;
  width: 100%;
}

.sotto-input {
  margin: -10px auto auto var(--space-5);
}

.input-group input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  padding: var(--space-3) var(--space-5);
  background: var(--input-surface);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 1rem;
  transition: border-color var(--motion-fast) var(--motion-ease),
    box-shadow var(--motion-fast) var(--motion-ease);
}

.input-group input:focus {
  outline: none;
  border-color: var(--primary);
}

.input-group textarea {
  width: 100%;
  min-height: 112px;
  resize: vertical;
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: var(--space-4) var(--space-5);
  background: var(--input-surface);
  color: var(--text);
  font-family: var(--font-sans);
  transition: border-color var(--motion-fast) var(--motion-ease);
}

.input-group textarea:focus {
  outline: none;
  border-color: var(--primary);
}

.input-group--textarea label {
  top: 24px;
}

.input-group:has(.password-toggle) input {
  padding-right: 54px;
}

button.password-toggle {
  position: absolute;
  z-index: 2;
  top: 50%;
  right: 14px;
  display: grid;
  width: 34px;
  height: 34px;
  padding: 7px;
  transform: translateY(-50%);
  border: 0;
  border-radius: 50%;
  place-items: center;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  transition: filter 0.15s ease;
}

.input-group input:-webkit-autofill,
.input-group input:-webkit-autofill:hover,
.input-group input:-webkit-autofill:focus,
.input-group input:-webkit-autofill:active {
  -webkit-box-shadow: 0 0 0 1000px var(--input-surface) inset;
  -webkit-text-fill-color: var(--text);
  caret-color: var(--text);
  transition: background-color 9999s ease-out 0s;
}

button.password-toggle:hover,
button.password-toggle:active {
  filter: brightness(0.90);
}

button.password-toggle:focus-visible {
  outline: 2px solid var(--text-muted);
  outline-offset: 1px;
}

.password-toggle svg {
  width: 20px;
  height: 20px;
  overflow: visible;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.input-group.focused input {
  border-color: var(--primary);
}

.input-group label {
  position: absolute;
  left: var(--space-5);
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 1rem;
  pointer-events: none;
  transition: top var(--motion-fast) var(--motion-ease),
    transform var(--motion-fast) var(--motion-ease),
    font-size var(--motion-fast) var(--motion-ease),
    color var(--motion-fast) var(--motion-ease);
  font-weight: 400;
}

.input-group.active label,
.input-group.noactive label,
.input-group:has(input:-webkit-autofill) label {
  top: 0;
  transform: translateY(-50%);
  isolation: isolate;
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 500;
  background: transparent;
  padding: 0 var(--space-1);
}

.input-group.active label::before,
.input-group.noactive label::before,
.input-group:has(input:-webkit-autofill) label::before {
  content: "";
  position: absolute;
  z-index: -1;
  top: 50%;
  right: 0;
  left: 0;
  height: 2px;
  transform: translateY(-50%);
  background: var(--input-surface);
}

.input-group.focused label {
  color: var(--primary);
}

/* Azione sotto al form di auth utile per indietro o registrati */
.azione-sotto-auth,
.link-sotto-auth {
  display: flex;
  flex-direction: row;
  gap: 16px;
  justify-content: center;
  margin-top: 8px;
}

.azione-sotto-auth a {
  font-size: 0.95rem;
  color: var(--accent);
  text-decoration: none;
  font-family: var(--font-display);

  transition: filter 0.15s ease;
}

.azione-sotto-auth a:hover {
  filter: brightness(0.90)
}

/* Link sotto al login per collegamenti */
.link-sotto-auth a {
  font-size: 0.85rem;
  color: var(--text-muted);
  text-decoration: none;
}

.link-sotto-auth a:hover {
  color: var(--accent-hover);
}

/* Spunte nel registrati */
input[type="checkbox"] {
  display: grid;
  place-content: center;
  width: var(--checkbox-size);
  min-width: var(--checkbox-size);
  height: var(--checkbox-size);
  padding: var(--space-2);
  margin: 0;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--background);
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  transition:
    border-color var(--motion-fast) var(--motion-ease),
    background-color var(--motion-fast) var(--motion-ease),
    box-shadow var(--motion-fast) var(--motion-ease);
}

input[type="checkbox"]::before {
  content: "\2713";
  color: var(--color-white);
  font-size: 0.85rem;
  font-weight: 800;
  line-height: 1;
  transform: scale(0);
  transition: transform var(--motion-fast) var(--motion-ease);
}

input[type="checkbox"]:checked {
  border-color: var(--primary);
  background: var(--primary);
}

input[type="checkbox"]:checked::before {
  transform: scale(1);
}

.container-spunte {
  margin: 16px 0 16px 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.registration-check {
  display: flex;
  align-items: center;
  flex-direction: row;
  gap: 10px;
}

.registration-check a {
  font-size: 0.85rem;
  color: var(--text-muted);
  text-decoration: none;
}

.registration-check a:hover {
  color: var(--accent-hover);
}

/* ============================================
   COMPLETAMENTO PROFILO
   ============================================ */
.onboarding-container {
  justify-content: flex-start;
  padding-top: clamp(var(--space-6), 10vh, 96px);
  padding-bottom: var(--space-7);
}

.onboarding-container .auth-header img {
  width: 58px;
  margin-bottom: var(--space-3);
  border-radius: var(--radius-xs);
}

.onboarding-step {
  display: grid;
  gap: var(--space-4);
  padding: var(--space-5) 0;
  border-top: 1px solid var(--border);
}

.onboarding-step:first-child {
  border-top: 0;
  padding-top: 0;
}

.onboarding-step--complete {
  padding-bottom: var(--space-3);
}

.step-heading {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
}

.step-heading h2,
.step-heading p {
  margin: 0;
}

.step-heading h2 {
  color: var(--text);
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 400;
}

.step-heading p {
  margin-top: 2px;
  font-size: 0.87rem;
}

.step-number {
  display: grid;
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  border-radius: 50%;
  place-items: center;
  background: var(--primary);
  color: var(--color-white);
  font-family: var(--font-display);
}

.school-results {
  display: grid;
  gap: var(--space-1);
}

.school-result {
  display: grid;
  gap: 2px;
  width: 100%;
  padding: 11px var(--space-4);
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--background);
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.school-results button {
  background: var(--background);
  color: var(--text-muted);
  font-family: var(--font-display);
  border: 1px solid var(--border);
  transition: filter 0.15s ease;
}

.school-results button:hover {
  filter: brightness(0.90);
}

.school-results strong {
  margin-right: 5px;
  font-size: 0.9rem;
}

.school-results span,
.school-results-empty,
.selected-school {
  margin: 0;
  font-size: 0.8rem;
}

.selected-school {
  padding: 11px var(--space-4);
  border: 1px solid rgba(22, 128, 58, 0.24);
  border-radius: 18px;
  background: rgba(22, 128, 58, 0.06);
  color: var(--success);
  font-weight: 700;
}

/* ============================================
   PROFILO
   ============================================ */
.profile-container {
  width: min(100%, 840px);
  min-height: 100vh;
  margin: auto;
  margin-top: 36px;
  padding: var(--space-5) var(--space-4) var(--space-8);
}

.profile-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-7);
}

.profile-header .text-button {
  min-height: 40px;
  padding: 8px 0 8px var(--space-3);
  font-size: 0.9rem;
  line-height: 1.2;
}

.profile-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-family: var(--font-display);
  font-size: 1.2rem;
  text-decoration: none;
}

.profile-brand img {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-xs);
}

.text-button {
  width: auto;
  padding: 9px var(--space-3);
  border: 0;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
}

.text-button:hover {
  color: var(--primary);
}

.profile-loading {
  min-height: 50vh;
  align-content: center;
}

.profile-hero {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  margin-bottom: var(--space-6);
}

.profile-avatar-wrap {
  width: 76px;
  height: 76px;
  flex: 0 0 auto;
  padding: 3px;
  border: 1px solid var(--border);
  border-radius: 50%;
}

.profile-avatar {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

.profile-hero h1,
.profile-hero p {
  margin: 0;
}

.profile-hero h1 {
  color: var(--text);
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 6vw, 2.5rem);
  font-weight: 400;
  line-height: 1.1;
}

.profile-hero p {
  margin-top: 5px;
}

.profile-card {
  margin-top: var(--space-4);
  padding: clamp(var(--space-4), 5vw, var(--space-6));
  border: 1px solid var(--border);
  border-radius: 28px;
  background: var(--background);
}

.profile-card-heading {
  margin-bottom: var(--space-5);
}

.profile-card-heading h2,
.profile-card-heading p {
  margin: 0;
}

.profile-card-heading h2 {
  color: var(--text);
  font-family: var(--font-display);
  font-size: 1.45rem;
  font-weight: 400;
}

.profile-card-heading p {
  margin-top: 3px;
  font-size: 0.88rem;
}

.profile-form {
  display: grid;
  gap: var(--space-4);
}

.profile-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-3);
}

.profile-grid--single {
  grid-template-columns: 1fr;
}

.readonly-details {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-3);
  padding: var(--space-3) 0;
}

.readonly-details div {
  display: grid;
  gap: 3px;
}

.readonly-details span {
  font-size: 0.76rem;
}

.readonly-details strong {
  overflow: hidden;
  color: var(--text);
  font-size: 0.88rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.primary-button,
.secondary-button {
  width: auto;
  min-width: 180px;
  justify-self: start;
  padding: 13px var(--space-5);
  border-radius: var(--radius-pill);
  font-family: var(--font-display);
  cursor: pointer;
}

.primary-button {
  border-color: var(--primary);
  background: var(--primary);
  color: var(--color-white);
}

.secondary-button {
  border-color: var(--border);
  background: var(--background);
  color: var(--text);
}

.primary-button:hover,
.secondary-button:hover {
  filter: brightness(0.92);
}

.security-state {
  display: inline-flex;
  width: auto;
  flex: 0 0 auto;
  align-items: center;
  gap: 7px;
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 700;
  line-height: 1.2;
}

.security-state::before {
  content: "";
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--text-muted);
}

.security-state--success {
  color: var(--success);
}

.security-state--success::before {
  background: var(--success);
}

.security-state--required {
  color: var(--error);
}

.security-state--required::before {
  background: var(--error);
}

.security-summary {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-5);
  color: var(--primary);
}

.security-summary--success {
  color: var(--success);
}

.security-summary--required {
  color: var(--error);
}

.security-summary-icon {
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.security-summary-copy {
  display: grid;
  gap: 2px;
}

.security-summary-copy strong {
  color: currentColor;
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 400;
}

.security-summary-copy span {
  font-size: 0.82rem;
}

.security-status-list {
  display: grid;
  border-top: 1px solid var(--border);
}

.security-status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--border);
}

.security-status-row > div,
.mfa-factor-info {
  display: grid;
  gap: 2px;
}

.security-status-row strong,
.mfa-factor strong,
.mfa-setup-copy strong {
  color: var(--text);
  font-size: 0.9rem;
}

.security-status-row span,
.mfa-factor-info span,
.mfa-setup-copy p {
  margin: 0;
  font-size: 0.8rem;
}

.mfa-factors {
  display: grid;
  gap: 0;
  border-top: 1px solid var(--border);
}

.mfa-factor {
  padding: var(--space-3) 0;
}

.mfa-factor-actions {
  display: flex !important;
  align-items: center;
  grid-auto-flow: column;
  gap: var(--space-4) !important;
}

.danger-button {
  width: auto;
  padding: 6px 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--error);
  font-size: 0.8rem;
  font-weight: 700;
  line-height: 1.2;
  cursor: pointer;
}

.danger-button:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.mfa-unenroll-confirmation {
  display: grid;
  gap: var(--space-4);
  padding-top: var(--space-5);
  border-top: 1px solid var(--border);
}

.mfa-unenroll-copy {
  display: grid;
  gap: 2px;
}

.mfa-unenroll-copy strong {
  color: var(--text);
  font-size: 0.9rem;
}

.mfa-unenroll-copy p {
  margin: 0;
  font-size: 0.8rem;
}

.mfa-confirm-actions {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.danger-confirm-button {
  width: auto;
  padding: 13px var(--space-5);
  border-color: rgba(180, 35, 24, 0.3);
  background: transparent;
  color: var(--error);
  font-family: var(--font-display);
  cursor: pointer;
  transition: filter 0.15s ease;
}

.danger-confirm-button:hover {
  filter: brightness(0.90);
}

.mfa-methods {
  display: grid;
  gap: var(--space-3);
  padding-top: var(--space-5);
}

.mfa-methods-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-3);
}

.mfa-methods-heading strong {
  color: var(--text);
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 400;
}

.mfa-enrollment {
  display: grid;
  gap: var(--space-4);
  margin-top: var(--space-1);
  padding-top: var(--space-5);
  border-top: 1px solid var(--border);
}

.mfa-setup-copy {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
}

.mfa-qr-code {
  width: min(100%, 220px);
  margin: 0 auto;
}

.mfa-secret-row {
  display: grid;
  justify-items: center;
  gap: 5px;
  text-align: center;
}

.mfa-secret-row span {
  font-size: 0.76rem;
}

.mfa-secret-row code {
  max-width: 100%;
  overflow-wrap: anywhere;
  color: var(--text);
  font-size: 0.82rem;
}

.security-message {
  margin-top: var(--space-4);
}

.mfa-challenge-page {
  min-height: 100vh;
}

/* ============================================
   PRIVACY + SECURITY
   ============================================ */
.privacy-security-linkbox {
  margin-top: var(--space-4);
  padding-top: var(--space-3);
  border-top: 1px solid var(--line, var(--border));
}

.privacy-security-linkbox h2 {
  margin: 0 0 var(--space-half);
  font-size: 1rem;
  color: var(--ink-strong, var(--neutral-ink));
}

.privacy-security-linkbox p {
  margin: 0 0 10px;
  font-size: 0.8rem;
  color: var(--subtext, var(--text-muted));
}

.privacy-security-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-xs);
  border: 1px solid var(--line, var(--control-border));
  color: var(--primary, var(--accent-vivid));
  font-size: 0.8rem;
  font-weight: 700;
  text-decoration: none;
  background: var(--privacy-link-bg);
}

.privacy-security-link:hover {
  border-color: var(--primary, var(--accent-vivid));
  background: var(--privacy-link-hover);
}

.privacy-security-page {
  min-height: 100vh;
  padding: var(--space-8) var(--space-4);
  background: transparent;
  color: var(--neutral-ink-page);
  color-scheme: light;
  font-family: var(--font-sans, "Inter", "Segoe UI", "Helvetica Neue", Arial, sans-serif);
}

.privacy-security-page.has-site-footer {
  padding: var(--space-8) 0 0;
}

.privacy-security-page-card {
  width: 100%;
  max-width: 920px;
  margin: 0 auto;
  padding: clamp(var(--space-6), 6vw, var(--space-9));
  box-shadow: none;
}

.privacy-security-page-head {
  margin: 0;
  padding: 0 0 var(--space-6);
  border-bottom: 1px solid var(--legal-line);
}

.privacy-security-page-head h1 {
  max-width: var(--layout-content-narrow);
  margin: 0 0 var(--space-3);
  color: var(--neutral-ink-heading);
  font-family: var(--font-display, "Chalet NewYork Sixty", "Segoe UI", Arial, sans-serif);
  font-size: clamp(2.15rem, 6vw, 3.75rem);
  font-weight: 400;
  line-height: 1.04;
  letter-spacing: -0.025em;
}

.privacy-security-page-head p {
  max-width: 720px;
  margin: 0;
  color: var(--legal-text-muted);
  font-size: 1rem;
  line-height: 1.65;
}

.privacy-security-page-section {
  margin: 0;
  padding: var(--space-6) 0;
  border: 0;
  border-bottom: 1px solid var(--legal-line);
  border-radius: 0;
  background: var(--background);
}

.privacy-security-page-section:last-of-type {
  border-bottom: 0;
}

.privacy-security-page-section h2 {
  margin: 0 0 14px;
  color: var(--neutral-ink-heading);
  font-family: var(--font-display, "Chalet NewYork Sixty", "Segoe UI", Arial, sans-serif);
  font-size: clamp(1.35rem, 3vw, 1.75rem);
  font-weight: 400;
  line-height: 1.15;
  letter-spacing: -0.012em;
}

.privacy-security-page-section p {
  margin: 0;
  color: var(--legal-text);
  font-size: 0.98rem;
  line-height: 1.7;
}

.privacy-security-page-section p+p,
.privacy-security-page-section p+.legal-table-wrap,
.privacy-security-page-section .legal-table-wrap+p,
.privacy-security-page-section ul+p,
.privacy-security-page-section ol+p {
  margin-top: var(--space-3);
}

.privacy-security-page-section ul,
.privacy-security-page-section ol {
  margin: 0;
  padding-left: 22px;
  display: grid;
  gap: 10px;
  color: var(--legal-text);
  font-size: 0.98rem;
  line-height: 1.65;
}

.privacy-security-page-section p+ul,
.privacy-security-page-section p+ol {
  margin-top: 14px;
}

.privacy-security-page a {
  color: var(--neutral-ink-page);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.privacy-security-page a:hover {
  color: var(--legal-link-hover);
}

.privacy-security-page-link {
  margin-top: 0;
  padding-top: 28px;
  border-top: 1px solid var(--legal-line);
  text-align: center;
  font-size: 0.92rem;
}

.privacy-security-page code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono",
    "Courier New", monospace;
  font-size: 0.8rem;
  padding: 1px 5px;
  border: 1px solid var(--legal-code-line);
  border-radius: var(--radius-2xs);
  background: var(--background);
}

.legal-kicker {
  margin: 0 0 0.35rem;
  color: var(--legal-kicker-text);
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 400;
}

.legal-summary {
  background: var(--background);
}

.legal-table-wrap {
  width: 100%;
  overflow-x: auto;
  scrollbar-color: var(--legal-scroll-thumb) var(--background);
}

.legal-table {
  width: 100%;
  border-collapse: collapse;
  margin: 0;
  color: var(--legal-text);
  font-size: 0.92rem;
  line-height: 1.55;
}

.legal-table th,
.legal-table td {
  padding: 14px var(--space-2);
  border: 0;
  border-bottom: 1px solid var(--legal-line);
  text-align: left;
  vertical-align: top;
}

.legal-table th {
  color: var(--neutral-ink-page);
  background: var(--background);
  font-weight: 600;
}

.legal-table tbody tr:last-child td {
  border-bottom: 0;
}

.privacy-security-page a:focus-visible {
  outline: 2px solid var(--neutral-ink-heading);
  outline-offset: 3px;
}

/* Componenti condivisi effettivamente usati dalle pagine pubbliche. */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--btn-icon-gap);
  min-height: var(--btn-height);
  padding: 10px var(--btn-padding-x);
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition:
    background-color var(--motion-fast) var(--motion-ease),
    border-color var(--motion-fast) var(--motion-ease),
    color var(--motion-fast) var(--motion-ease),
    opacity var(--motion-fast) var(--motion-ease);
}

.btn:disabled,
.btn[aria-disabled="true"] {
  cursor: not-allowed;
  opacity: 0.58;
}

/* Callback OAuth/OTP: nessuna dipendenza CSS o icona esterna. */
.auth-callback-page {
  display: grid;
  min-height: 100vh;
  margin: 0;
  padding: var(--space-4);
  place-items: center;
  background: transparent;
}

.auth-callback-card {
  width: min(100%, 420px);
  text-align: center;
}

.auth-callback-logo {
  width: 58px;
  height: 58px;
  margin: 0 auto var(--space-4);
  border-radius: var(--radius-xs);
}

.auth-callback-card h1 {
  margin: 0 0 6px;
  color: var(--ink-strong);
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 6vw, 2.4rem);
  font-weight: 400;
}

.auth-callback-subtitle,
.callback-state p {
  color: var(--text-muted);
}

.auth-callback-subtitle {
  margin: 0 0 var(--space-5);
}

.callback-state {
  display: grid;
  justify-items: center;
  gap: var(--space-3);
}

.callback-state[role="alert"] {
  width: 100%;
  padding: var(--space-4);
  border: 1px solid rgba(180, 35, 24, 0.22);
  border-radius: var(--radius-pill);
  background: rgba(180, 35, 24, 0.06);
}

.callback-state p {
  margin: 0;
}

.callback-spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: callback-spin 700ms linear infinite;
}

.callback-symbol {
  display: grid;
  width: 42px;
  height: 42px;
  border: 2px solid currentColor;
  border-radius: 50%;
  place-items: center;
  font-size: 1.5rem;
  font-weight: 700;
}

.callback-symbol--error {
  color: var(--error);
}

.callback-symbol--success {
  color: var(--success);
}

.callback-action {
  margin-top: var(--space-1);
  border-color: var(--primary);
  background: var(--primary);
  color: var(--color-white);
}

.callback-action:hover {
  border-color: var(--accent-hover);
  background: var(--accent-hover);
}

.hidden {
  display: none !important;
}

@keyframes callback-spin {
  to {
    transform: rotate(360deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .callback-spinner {
    animation-duration: 1.6s;
  }
}

.united-brand-lockup {
  --brand-lockup-icon-size: 32px;
  --brand-lockup-wordmark-width: 104px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: inherit;
  text-decoration: none;
}

.united-brand-lockup__icon {
  width: var(--brand-lockup-icon-size);
  height: var(--brand-lockup-icon-size);
  flex: 0 0 auto;
  border-radius: var(--radius-xs);
}

.united-brand-lockup__wordmark {
  width: var(--brand-lockup-wordmark-width);
  height: auto;
  flex: 0 0 auto;
}

.has-site-footer {
  display: flex;
  min-height: 100vh;
  flex-direction: column;
}

.has-site-footer>main {
  flex: 1 0 auto;
}

.site-footer {
  width: 100%;
  margin-top: auto;
  border-top: 1px solid var(--border);
  background: var(--surface-soft);
  color: var(--text-muted);
}

.site-footer__inner {
  display: grid;
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: var(--space-6) var(--space-4) var(--space-5);
  grid-template-columns: minmax(220px, 1fr) minmax(0, 1.4fr);
  gap: var(--space-5) var(--space-6);
  align-items: start;
}

.site-footer__identity {
  display: grid;
  gap: var(--space-1);
}

.site-footer__brand {
  --brand-lockup-icon-size: 30px;
  --brand-lockup-wordmark-width: 96px;
  width: fit-content;
}

.site-footer__tagline,
.site-footer__company,
.site-footer__copyright {
  margin: 0;
}

.site-footer__tagline {
  color: var(--text);
  font-size: 0.88rem;
  line-height: 1.5;
}

.site-footer__company,
.site-footer__copyright {
  font-size: 0.76rem;
  line-height: 1.55;
}

.site-footer__nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: var(--space-1) var(--space-3);
}

.site-footer .site-footer__nav a {
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
}

.site-footer .site-footer__nav a:hover {
  color: var(--primary);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.site-footer__copyright {
  grid-column: 1 / -1;
  padding-top: var(--space-3);
  border-top: 1px solid var(--border);
  text-align: right;
}

@media (max-width: 768px) {

  .profile-container {
    padding: var(--space-4) var(--space-3) var(--space-7);
  }

  .profile-header {
    margin-bottom: var(--space-6);
  }

  .profile-grid,
  .readonly-details {
    grid-template-columns: 1fr;
  }

  .profile-card {
    border-radius: 22px;
  }

  .primary-button,
  .secondary-button {
    width: 100%;
  }

  .privacy-security-page,
  .privacy-security-page.has-site-footer {
    padding: 0;
  }

  .privacy-security-page-card {
    padding: var(--space-6) var(--space-4) var(--space-7);
  }

  .privacy-security-page-head {
    padding-bottom: 28px;
  }

  .privacy-security-page-section {
    padding: 28px 0;
  }

  .legal-table {
    min-width: 660px;
  }

  .site-footer__inner {
    padding: var(--space-5) var(--space-3);
    grid-template-columns: 1fr;
    gap: var(--space-4);
  }

  .site-footer__nav {
    justify-content: flex-start;
  }

  .site-footer__copyright {
    text-align: left;
  }
}
