/* ============================================================================
   acces.css — Pantalla d'accés de la demo (acces.html)
   ----------------------------------------------------------------------------
   Il·lustració a l'esquerra, formulari a la dreta. Per sota de 900 px la
   imatge passa a dalt i el formulari a sota. Sense scroll lateral a cap
   amplada. La pintura és un <img>: no es retona amb el tema fosc.
   ========================================================================== */

body.acces { min-height: 100vh; min-height: 100dvh; overflow-x: hidden; }

.acces-marc {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr);
  min-height: 100vh;
  min-height: 100dvh;
}

/* --- Il·lustració ------------------------------------------------------- */

.acces-imatge {
  position: relative;
  margin: 0;
  overflow: hidden;
  min-width: 0;
  background: #F6EAD6;
}
.acces-imatge img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 32% 55%;   /* educadora i nadó sempre dins */
  display: block;
  animation: acces-apareix 1.1s ease-out both;
}
/* Fos cap al fons del formulari: la pintura no acaba en un tall sec. */
.acces-imatge::after {
  content: "";
  position: absolute;
  inset: 0 0 0 auto;
  width: 14%;
  background: linear-gradient(to right, transparent, var(--fons));
  pointer-events: none;
}

/* --- Formulari ---------------------------------------------------------- */

.acces-costat {
  display: grid;
  place-items: center;
  padding: var(--e-7) clamp(var(--e-5), 4vw, var(--e-8));
  min-width: 0;
  position: relative;
}
.acces-costat::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(22rem 18rem at 92% 8%,
      color-mix(in srgb, var(--blau-fons) 45%, transparent), transparent 70%),
    radial-gradient(20rem 16rem at 80% 98%,
      color-mix(in srgb, var(--verd-fons) 40%, transparent), transparent 70%);
}

.acces-targeta {
  position: relative;
  width: 100%;
  max-width: 25rem;
  animation: acces-puja .7s .15s cubic-bezier(.2, .8, .2, 1) both;
}

.acces-marca { margin-bottom: var(--e-6); }

.acces-targeta h1 {
  font-size: clamp(1.7rem, 1.2rem + 1.5vw, 2.35rem);
  margin-bottom: var(--e-3);
}
.acces-entradeta {
  color: var(--text-suau);
  margin: 0 0 var(--e-6);
  max-width: 30rem;
}

.acces-form {
  display: grid;
  gap: var(--e-4);
  padding: var(--e-5);
  background: var(--superficie);
  border: 1px solid var(--linia);
  border-radius: var(--radi-organic);
  box-shadow: var(--ombra-2);
}
.acces-form.te-error { animation: acces-no .38s ease; }

.acces-camp { display: grid; gap: var(--e-1); }
.acces-camp label {
  font-size: var(--mida-s);
  font-weight: 700;
  color: var(--text-suau);
}
.acces-camp input {
  width: 100%;
  min-height: var(--area-tactil);
  padding: var(--e-2) var(--e-4);
  font: inherit;
  color: var(--text);
  background: var(--superficie-2);
  border: 1.5px solid var(--linia-forta);
  border-radius: var(--radi-s);
  transition: border-color .2s ease, box-shadow .2s ease;
}
.acces-camp input:focus {
  outline: none;
  border-color: var(--verd);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--verd-fons) 55%, transparent);
}

.acces-contrasenya { position: relative; }
.acces-contrasenya input { padding-right: 5.5rem; }
.acces-mostra {
  position: absolute;
  top: 50%;
  right: var(--e-2);
  transform: translateY(-50%);
  min-height: 34px;
  padding: 0 var(--e-3);
  font: inherit;
  font-size: var(--mida-xs);
  font-weight: 700;
  color: var(--verd-text);
  background: transparent;
  border: 0;
  border-radius: var(--radi-ple);
  cursor: pointer;
}
.acces-mostra:hover { background: var(--verd-vel); }

.acces-avis {
  margin: 0;
  padding: var(--e-2) var(--e-3);
  font-size: var(--mida-s);
  font-weight: 600;
  color: var(--pressec-text);
  background: var(--pressec-vel);
  border-radius: var(--radi-s);
}

.acces-entra {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--e-2);
  min-height: 48px;
  margin-top: var(--e-1);
  font: inherit;
  font-weight: 800;
  font-size: var(--mida-m);
  color: var(--text);
  background: var(--verd-fons);
  border: 0;
  border-radius: var(--radi-ple);
  cursor: pointer;
  transition: filter .2s ease, transform .2s ease;
}
.acces-entra svg { width: 20px; height: 20px; transition: transform .24s ease; }
.acces-entra:hover { filter: brightness(1.04) saturate(1.1); }
.acces-entra:hover svg { transform: translateX(4px); }
.acces-entra:active { transform: scale(.98); }

.acces-peu {
  margin: var(--e-5) 0 0;
  font-size: var(--mida-xs);
  line-height: 1.5;
  color: var(--text-tenue);
}

body.entrant .acces-marc { opacity: 0; transition: opacity .25s ease; }

/* --- Mòbil i tauleta vertical ----------------------------------------- */

@media (max-width: 900px) {
  .acces-marc { grid-template-columns: minmax(0, 1fr); min-height: 0; }
  .acces-imatge { height: 44vh; min-height: 15rem; max-height: 30rem; }
  .acces-imatge img { object-position: 30% 60%; }
  .acces-imatge::after {
    inset: auto 0 0 0;
    width: auto;
    height: 22%;
    background: linear-gradient(to bottom, transparent, var(--fons));
  }
  .acces-costat { padding: var(--e-5) var(--e-4) var(--e-7); }
  .acces-marca { margin-bottom: var(--e-4); }
}

/* --- Moviment -------------------------------------------------------- */

@keyframes acces-apareix { from { opacity: 0; transform: scale(1.03); } to { opacity: 1; transform: none; } }
@keyframes acces-puja    { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes acces-no {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  75% { transform: translateX(6px); }
}
@media (prefers-reduced-motion: reduce) {
  .acces-imatge img, .acces-targeta, .acces-form.te-error { animation: none; }
}
