/* Profile, onboarding and confirmations share the landing page's outdoor identity. */
/* La superficie della nav: gli stessi valori di `--superficie-avorio` e
   `--superficie-sfocatura` in landing.css, che queste pagine non caricano. */
:root {
  --superficie-avorio: rgba(247, 244, 238, .85);
  --superficie-sfocatura: blur(3px);
}

/* Keep the landscape viewport-sized while long forms scroll naturally. */
.profile-page {
  position: relative;
  isolation: isolate;
}

.profile-page::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background: inherit;
  pointer-events: none;
}

.profile-main {
  width: 100%;
  max-width: 44rem;
  margin-inline: auto;
  padding: 8rem 1rem 3rem;
}

.profile-nav {
  position: fixed;
  top: 1rem;
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 1.5rem);
  max-width: 65rem;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  background: var(--superficie-avorio);
  backdrop-filter: var(--superficie-sfocatura);
  -webkit-backdrop-filter: var(--superficie-sfocatura);
  border: 1px solid rgba(28, 58, 43, .20);
  border-radius: 14px;
  padding: .75rem 1.25rem;
  box-shadow: 0 4px 20px rgba(28, 58, 43, .10);
}

.profile-logout,
.profile-page a,
.profile-page button,
.account-page a,
.account-page button {
  min-height: 44px;
}

.profile-logout {
  padding: .5rem;
}

.profile-nav-links {
  display: flex;
  align-items: center;
  gap: .25rem;
}

.profile-nav-link {
  display: inline-flex;
  align-items: center;
  padding: .5rem .625rem;
  border-radius: 8px;
  color: #1c3a2b;
}

.profile-nav-link:hover {
  background: rgba(28, 58, 43, .08);
}

.profile-nav-link[aria-current="page"] {
  font-weight: 600;
  background: rgba(28, 58, 43, .10);
}

/* Il mio weekend: la stessa card sabbia, larga quanto la colonna del report
   della pagina provinciale. Le card delle attività sono quelle di landing.css. */
.weekend-main {
  max-width: 56rem;
}

/* Due classi: `.account-card`, più in basso nel file, fisserebbe 34rem. */
.account-card.weekend-card {
  max-width: none;
}

.weekend-intro {
  margin-bottom: 1.5rem;
}

.weekend-meta {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin: .75rem 0 0;
  padding: 0;
  list-style: none;
}

.weekend-meta li {
  padding: .375rem .75rem;
  border-radius: 99px;
  background: #edf2e7;
  color: #1c3a2b;
  font-size: .875rem;
  font-weight: 500;
}

.weekend-meteo {
  margin-bottom: 1.5rem;
  padding: 1rem 1.125rem;
  border-left: 3px solid #9aa78b;
  border-radius: 3px;
  background: #f3ede0;
}

.weekend-meteo-titolo {
  margin-bottom: .5rem;
  color: #2f5540;
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .07em;
  text-transform: uppercase;
}

.weekend-meteo-giorni {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
  gap: .5rem 1.25rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.weekend-meteo-giorni li {
  display: flex;
  align-items: flex-start;
  gap: .625rem;
  color: #2a2215;
  font-size: .875rem;
  line-height: 1.5;
}

.weekend-meteo-emoji {
  font-size: 1.25rem;
  line-height: 1.2;
}

.weekend-meteo-desc,
.weekend-meteo-temp {
  display: block;
  color: var(--profile-muted);
}

.weekend-avviso {
  padding: 1.25rem;
  border: 1px solid var(--profile-rule);
  border-radius: 14px;
  background: #fff;
}

.weekend-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 1rem;
  padding: .75rem 1.5rem;
  border-radius: 10px;
  background: #1c3a2b;
  color: #f3ede0;
  font-size: .875rem;
  font-weight: 500;
}

.weekend-btn:hover {
  background: #2d5a42;
}

.weekend-link {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: .25rem 1.5rem;
  margin-top: 1.75rem;
  padding-top: 1rem;
  border-top: 1px solid var(--profile-rule);
  font-size: .875rem;
}

.weekend-link a {
  display: inline-flex;
  align-items: center;
  color: #2f5540;
  font-weight: 600;
}

.weekend-link a:hover {
  text-decoration: underline;
}

.profile-form,
.profile-summary {
  background: #fff;
  border: 1px solid var(--profile-rule);
  border-radius: 16px;
  box-shadow: 0 2px 8px rgba(28,58,43,.05);
  padding: 1.5rem 1.25rem;
}

.profile-form hr {
  border-color: var(--profile-rule);
}

.profile-form input:not([type="checkbox"]):not([type="range"]),
.profile-form select,
.profile-delete input {
  min-height: 46px;
  min-width: 0;
  border-radius: 3px;
  font-size: 1rem;
  background: #faf8f3;
}

.profile-form input[type="range"] {
  min-height: 32px;
}

.profile-page :is(input, select, button, a):focus-visible,
.account-page :is(input, select, button, a):focus-visible {
  outline: 2px solid #3d7a56;
  outline-offset: 3px;
}

.profile-nav :is(button, a):focus-visible {
  outline-color: #1c3a2b;
}

.profile-choice {
  min-height: 46px;
  padding: .625rem;
  border: 1px solid var(--profile-rule);
  border-radius: 10px;
  align-items: flex-start;
}

.profile-choice input {
  flex-shrink: 0;
  margin-top: .15rem;
}

.profile-choice:has(input:checked) {
  border-color: #9aa78b;
  background: #e9eee3;
}

.profile-choice:focus-within {
  outline: 2px solid #3d7a56;
  outline-offset: 2px;
}

.profile-actions {
  gap: 1rem;
}

.profile-actions button,
.profile-summary + div a,
.profile-delete button {
  border-radius: 10px;
}

.profile-actions a {
  display: inline-flex;
  align-items: center;
}

.profile-summary > div {
  display: grid;
  grid-template-columns: minmax(5rem, .65fr) minmax(0, 1.35fr);
  gap: 1rem;
  padding-block: .875rem;
  line-height: 1.6;
}

.profile-summary > div + div {
  border-top: 1px solid var(--profile-rule);
}

.profile-summary span {
  overflow-wrap: anywhere;
}

/* Account forms and confirmations share one sand card over the landscape. */
.account-page {
  --profile-muted: #686255;
  --profile-rule: #dcded0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background-color: #1c3a2b;
  background-image:
    linear-gradient(rgba(28,58,43,.56), rgba(28,58,43,.64)),
    url('/static/hero-bg-mobile.webp');
  background-size: cover;
  background-position: 82% 45%;
}

.account-main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8rem 1rem 3rem;
}

.account-card {
  width: 100%;
  max-width: 34rem;
  padding: 2rem 1.5rem;
  background: #f7f4ee;
  border: 1px solid rgba(243,237,224,.65);
  border-radius: 20px;
  box-shadow: 0 18px 50px rgba(10,30,19,.26), 0 3px 10px rgba(10,30,19,.12);
  overflow-wrap: anywhere;
}

.account-card--wide {
  max-width: 40rem;
}

.account-card h1 {
  color: #1c3a2b;
  font-size: clamp(1.6rem, 3vw, 2rem);
  font-weight: 700;
  line-height: 1.2;
}

.account-card .text-stone,
.account-card [class*="text-stone/"] {
  color: var(--profile-muted);
}

.account-card .profile-summary,
.account-card .profile-form {
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  padding: 0;
}

.account-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}

/* Keep the public navigation in flow when JavaScript is unavailable. */
html:not(.js) .account-page .landing-nav {
  position: relative;
  top: auto;
  left: auto;
  right: auto;
  /* In flusso, dentro la colonna flex di `.account-page`, i margini
     automatici la stringerebbero sul contenuto: la larghezza va data. */
  width: calc(100% - 2 * var(--nav-margine));
  margin: 1rem auto 0;
}

html:not(.js) .account-page .landing-nav + .account-main {
  padding-top: 2rem;
}

@media (max-width: 479px) {
  /* Tre voci e il logo non stanno in 343px con il nome per esteso. */
  .profile-nav {
    padding: .5rem .75rem;
  }

  .profile-nav-brand {
    display: none;
  }

  .profile-nav-link {
    padding: .5rem;
  }

  /* Le card delle attività hanno già il loro padding: quello della card
     sabbia attorno le stringerebbe sotto i 300px. */
  .account-card.weekend-card {
    padding: 1.5rem 1rem;
  }

  .profile-form .profile-interests,
  .profile-form .profile-schedule {
    grid-template-columns: 1fr;
  }

  .profile-form .profile-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .profile-actions a {
    justify-content: center;
  }
}

@media (min-width: 768px) {
  .account-page {
    background-image:
      linear-gradient(to right, rgba(28,58,43,.70), rgba(28,58,43,.30)),
      url('/static/hero-bg.webp');
    background-position: center 45%;
  }

  .account-main {
    padding: 8rem 2rem 4rem;
  }

  .account-card {
    padding: 2.5rem;
  }

  .profile-main {
    padding: 8rem 2rem 4rem;
  }

  .profile-summary {
    padding: 2rem;
  }
}
