/* =========================================================================
   Wasabi · hoja de estilo única para todas las páginas.
   Identidad visual de energie fitness Poblenou: negro, verde energie y
   un toque de rosa. El verde puro (--brand) es para rellenos; para texto
   sobre blanco se usa --accent, más oscuro, que sí tiene contraste.
   Mobile first: lo que ves sin media query es el móvil; a partir de 880px
   la navegación pasa de barra inferior a columna lateral.
   ========================================================================= */

:root {
  /* Superficies y texto */
  --bg:            #f4f4f2;
  --surface:       #ffffff;
  --surface-2:     #fafaf9;
  --surface-3:     #efefec;
  --line:          #e4e4e0;
  --line-strong:   #d0d0cb;
  --text:          #1b1b1b;
  --text-2:        #54565a;
  --text-3:        #80828a;

  /* Marca energie: rellenos, fondos oscuros y detalles */
  --brand:         #76b82a;
  --brand-hover:   #86c83a;
  --ink:           #1b1b1b;
  --ink-2:         #262626;
  --pink:          #e6007e;

  /* Acento para texto sobre claro: verde energie oscurecido */
  --accent:        #4e8c16;
  --accent-hover:  #3f7411;
  --accent-soft:   #eef6e4;
  --accent-line:   #cbe3ae;

  /* Estados */
  --danger:        #bd4b3f;
  --danger-soft:   #fbeceb;
  --warn:          #a9761c;
  --warn-soft:     #fbf2e1;
  --info:          #3d6f96;
  --info-soft:     #e9f1f7;

  /* Formas */
  --r-sm: 8px;
  --r:    12px;
  --r-lg: 18px;
  --shadow-1: 0 1px 2px rgba(27, 27, 27, .05);
  --shadow-2: 0 6px 20px rgba(27, 27, 27, .09);
  --shadow-3: 0 18px 48px rgba(27, 27, 27, .2);

  --nav-h: 66px;
  --bar-h: 56px;
  --side-w: 236px;

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
          Arial, "Noto Sans", sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
}

h1, h2, h3, h4 { margin: 0; font-weight: 700; letter-spacing: -.015em; }
h1 { font-size: 1.3rem; }
h2 { font-size: 1.05rem; }
h3 { font-size: .95rem; }
p  { margin: 0 0 .8em; }
a  { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}
/* Sobre fondo oscuro, el verde de marca se ve mejor que el acento. */
.sidebar :focus-visible, .bottomnav :focus-visible, .login :focus-visible { outline-color: var(--brand); }

/* ---------------------------------------------------------------- arranque */

.boot {
  min-height: 100dvh;
  display: grid;
  place-items: center;
}

.spinner {
  width: 22px; height: 22px;
  border: 2.5px solid var(--accent-line);
  border-top-color: var(--accent);
  border-radius: 50%;
  display: inline-block;
  animation: spin .7s linear infinite;
}
.spinner--sm { width: 15px; height: 15px; border-width: 2px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ------------------------------------------------------------------ layout */

.app { min-height: 100dvh; }

.shell {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

/* Barra superior (móvil) */
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  height: var(--bar-h);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  padding-top: env(safe-area-inset-top);
  background: rgba(255, 255, 255, .88);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
.topbar__title {
  font-size: 1.02rem;
  font-weight: 600;
  letter-spacing: -.01em;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.topbar__actions { display: flex; align-items: center; gap: 6px; }

.main {
  flex: 1;
  padding: 16px 14px calc(var(--nav-h) + env(safe-area-inset-bottom) + 18px);
  max-width: 1120px;
  width: 100%;
  margin: 0 auto;
}

/* Navegación inferior (móvil) */
.bottomnav {
  position: fixed;
  z-index: 30;
  left: 0; right: 0; bottom: 0;
  display: flex;
  background: rgba(27, 27, 27, .96);
  backdrop-filter: saturate(1.4) blur(10px);
  border-top: 1px solid rgba(255, 255, 255, .06);
  padding-bottom: env(safe-area-inset-bottom);
}
.bottomnav a {
  flex: 1;
  height: var(--nav-h);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  font-size: .69rem;
  font-weight: 500;
  letter-spacing: .01em;
  color: rgba(255, 255, 255, .58);
  text-decoration: none;
  position: relative;
  transition: color .15s ease;
}
.bottomnav a svg { width: 22px; height: 22px; }
.bottomnav a[aria-current="page"] { color: var(--brand); }
.bottomnav a[aria-current="page"]::before {
  content: "";
  position: absolute;
  top: 0; left: 30%; right: 30%;
  height: 3px;
  border-radius: 0 0 3px 3px;
  background: var(--brand);
}

.sidebar { display: none; }

/* Columna lateral a partir de tableta */
@media (min-width: 880px) {
  .shell { flex-direction: row; }

  .sidebar {
    display: flex;
    flex-direction: column;
    width: var(--side-w);
    flex: 0 0 var(--side-w);
    background: var(--ink);
    color: #fff;
    position: sticky;
    top: 0;
    height: 100dvh;
    padding: 22px 14px 16px;
  }
  .brand {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 4px 10px 26px;
  }
  .brand__logo { width: 168px; height: auto; display: block; }
  .brand__place {
    font-size: .66rem;
    font-weight: 700;
    letter-spacing: .16em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, .45);
  }

  .sidenav { display: flex; flex-direction: column; gap: 2px; }
  .sidenav a {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 9px 10px;
    border-radius: var(--r-sm);
    color: rgba(255, 255, 255, .66);
    font-weight: 600;
    font-size: .93rem;
    text-decoration: none;
    transition: background .15s ease, color .15s ease;
  }
  .sidenav a svg { width: 19px; height: 19px; flex: none; }
  .sidenav a:hover { background: rgba(255, 255, 255, .06); color: #fff; text-decoration: none; }
  .sidenav a[aria-current="page"] {
    background: rgba(118, 184, 42, .14);
    color: var(--brand);
    box-shadow: inset 3px 0 0 var(--brand);
  }

  .sideuser {
    margin-top: auto;
    border-top: 1px solid rgba(255, 255, 255, .1);
    padding-top: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
  }
  .sideuser__info { min-width: 0; flex: 1; }
  .sideuser__name {
    font-size: .88rem; font-weight: 600;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  .sideuser__group { font-size: .76rem; color: rgba(255, 255, 255, .5); }
  .sideuser .avatar { background: var(--brand); color: var(--ink); border-color: var(--brand); }
  .sideuser .btn--ghost { color: rgba(255, 255, 255, .6); }
  .sideuser .btn--ghost:hover { background: rgba(255, 255, 255, .08); color: #fff; }

  .bottomnav { display: none; }
  .topbar {
    height: 68px;
    padding: 0 32px;
    background: transparent;
    backdrop-filter: none;
    border-bottom: none;
    position: static;
  }
  .topbar__title {
    font-size: 1.55rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: -.01em;
  }
  .main { padding: 4px 32px 48px; }
  .content { flex: 1; min-width: 0; display: flex; flex-direction: column; }
}

/* ---------------------------------------------------------------- avatares */

.avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent-hover);
  display: grid;
  place-items: center;
  font-size: .76rem;
  font-weight: 700;
  letter-spacing: .02em;
  flex: none;
  border: 1px solid var(--accent-line);
}
.avatar--sm { width: 26px; height: 26px; font-size: .66rem; }
.avatar--muted { background: var(--surface-3); color: var(--text-3); border-color: var(--line); }

/* ---------------------------------------------------------------- botones */

.btn {
  -webkit-appearance: none;
  appearance: none;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: .9rem;
  font-weight: 600;
  padding: 9px 16px;
  border-radius: 999px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  white-space: nowrap;
  transition: background .13s ease, border-color .13s ease, opacity .13s ease, box-shadow .13s ease;
}
.btn svg { width: 17px; height: 17px; }
.btn:hover { background: var(--surface-3); }
.btn:active { transform: translateY(.5px); }
.btn[disabled] { opacity: .55; cursor: not-allowed; }

.btn--primary {
  background: var(--brand);
  border-color: var(--brand);
  color: var(--ink);
  font-weight: 700;
}
.btn--primary:hover {
  background: var(--brand-hover);
  border-color: var(--brand-hover);
  box-shadow: 0 6px 18px rgba(118, 184, 42, .3);
}
.btn--primary .spinner { border-color: rgba(27, 27, 27, .25); border-top-color: var(--ink); }

.btn--danger { color: var(--danger); border-color: #e6c4c0; background: var(--surface); }
.btn--danger:hover { background: var(--danger-soft); }

.btn--ghost { border-color: transparent; background: transparent; color: var(--text-2); }
.btn--ghost:hover { background: var(--surface-3); color: var(--text); }

.btn--sm { padding: 6px 12px; font-size: .83rem; }
.btn--icon { padding: 7px; border-radius: 999px; }
.btn--icon svg { width: 18px; height: 18px; }
.btn--block { width: 100%; }

/* --------------------------------------------------------------- tarjetas */

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--shadow-1);
}
.card__body { padding: 16px; }
.card__head {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 10px;
}
.card__head h2 { flex: 1; min-width: 0; }

/* -------------------------------------------------------------- cabeceras */

.pagehead {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 14px;
}
.pagehead__text { flex: 1; min-width: 0; }
.pagehead__sub { color: var(--text-3); font-size: .86rem; margin-top: 2px; }

.section-title {
  font-size: .78rem;
  font-weight: 650;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--text-3);
  margin: 22px 0 9px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.section-title::before {
  content: "";
  width: 14px; height: 3px;
  border-radius: 2px;
  background: var(--brand);
  flex: none;
}

/* --------------------------------------------------------------- filtros */

.toolbar {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 14px;
}
@media (min-width: 720px) {
  .toolbar { flex-direction: row; align-items: center; flex-wrap: wrap; }
  .toolbar .search { max-width: 320px; }
}

.search { position: relative; flex: 1; min-width: 0; }
.search svg {
  position: absolute;
  left: 11px; top: 50%;
  transform: translateY(-50%);
  width: 17px; height: 17px;
  color: var(--text-3);
  pointer-events: none;
}
.search input { padding-left: 34px; }

.chips { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--text-2);
  font: inherit;
  font-size: .83rem;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
}
.chip:hover { background: var(--surface-3); }
.chip[aria-pressed="true"] {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}

/* --------------------------------------------------------------- listados */

.list { display: flex; flex-direction: column; gap: 8px; }

.row {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 13px 14px;
  box-shadow: var(--shadow-1);
  display: flex;
  align-items: flex-start;
  gap: 12px;
  text-align: left;
  width: 100%;
  font: inherit;
  color: inherit;
  text-decoration: none;
}
a.row, button.row { transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease; }
a.row:hover, button.row:hover {
  border-color: var(--line-strong);
  box-shadow: var(--shadow-2);
  transform: translateY(-1px);
  text-decoration: none;
}
button.row { cursor: pointer; }

.row__main { flex: 1; min-width: 0; }
.row__title {
  font-weight: 600;
  font-size: .96rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.row__title--done { text-decoration: line-through; color: var(--text-3); }
.row__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 10px;
  margin-top: 4px;
  font-size: .82rem;
  color: var(--text-3);
}
.row__meta strong { color: var(--text-2); font-weight: 550; }
.row__side { display: flex; align-items: center; gap: 6px; flex: none; }
.row__actions { display: flex; gap: 2px; flex: none; }

/* ---------------------------------------------------------------- badges */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: .74rem;
  font-weight: 600;
  letter-spacing: .01em;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--surface-3);
  color: var(--text-2);
  border: 1px solid transparent;
  white-space: nowrap;
}
.badge--ok      { background: var(--accent-soft); color: var(--accent-hover); border-color: var(--accent-line); }
.badge--info    { background: var(--info-soft);   color: var(--info); }
.badge--warn    { background: var(--warn-soft);   color: var(--warn); }
.badge--danger  { background: var(--danger-soft); color: var(--danger); }
.badge--muted   { background: var(--surface-3);   color: var(--text-3); }
.badge__dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

.prio { font-variant-numeric: tabular-nums; }

/* -------------------------------------------------------------- formularios */

.field { margin-bottom: 14px; }
.field:last-child { margin-bottom: 0; }
.field > label {
  display: block;
  font-size: .82rem;
  font-weight: 600;
  color: var(--text-2);
  margin-bottom: 5px;
}
.field__hint { font-size: .78rem; color: var(--text-3); margin-top: 5px; }
.field__error { font-size: .78rem; color: var(--danger); margin-top: 5px; font-weight: 500; }

input[type=text], input[type=email], input[type=password], input[type=date],
input[type=number], input[type=search], select, textarea {
  width: 100%;
  font: inherit;
  font-size: .93rem;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  padding: 9px 11px;
  -webkit-appearance: none;
  appearance: none;
}
textarea { resize: vertical; min-height: 78px; line-height: 1.45; }
select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5 6 6.5l5-5' fill='none' stroke='%23838d85' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 11px center;
  padding-right: 32px;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
input.is-invalid, select.is-invalid, textarea.is-invalid {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px var(--danger-soft);
}
input::placeholder, textarea::placeholder { color: var(--text-3); }

.field-row { display: flex; flex-direction: column; gap: 0; }
@media (min-width: 560px) {
  .field-row { flex-direction: row; gap: 12px; }
  .field-row > .field { flex: 1; }
}

.check {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: .92rem;
  cursor: pointer;
}
.check input { width: 18px; height: 18px; accent-color: var(--accent); margin: 0; flex: none; }

/* ----------------------------------------------------------------- modales */

.modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: rgba(27, 27, 27, .45);
  backdrop-filter: blur(2px);
  animation: fade .16s ease;
}
@keyframes fade { from { opacity: 0; } }

.modal__sheet {
  background: var(--surface);
  width: 100%;
  max-height: 92dvh;
  border-radius: var(--r-lg) var(--r-lg) 0 0;
  box-shadow: var(--shadow-3);
  display: flex;
  flex-direction: column;
  animation: rise .22s cubic-bezier(.22, .9, .3, 1);
  padding-bottom: env(safe-area-inset-bottom);
}
@keyframes rise { from { transform: translateY(22px); opacity: .6; } }

.modal__head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 15px 16px 12px;
  border-bottom: 1px solid var(--line);
}
.modal__head h2 { flex: 1; min-width: 0; font-size: 1.02rem; }
.modal__body { padding: 16px; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.modal__foot {
  padding: 12px 16px;
  border-top: 1px solid var(--line);
  display: flex;
  gap: 8px;
  background: var(--surface-2);
  border-radius: 0 0 var(--r-lg) var(--r-lg);
}
.modal__foot .btn { flex: 1; }

@media (min-width: 620px) {
  .modal { align-items: center; padding: 24px; }
  .modal__sheet { max-width: 520px; border-radius: var(--r-lg); max-height: 86dvh; }
  .modal__foot { border-radius: 0 0 var(--r-lg) var(--r-lg); justify-content: flex-end; }
  .modal__foot .btn { flex: none; min-width: 108px; }
  .modal__sheet--wide { max-width: 640px; }
}

/* ------------------------------------------------------------------ avisos */

.toasts {
  position: fixed;
  z-index: 80;
  left: 12px; right: 12px;
  bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 12px);
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}
@media (min-width: 880px) {
  .toasts { left: auto; right: 24px; bottom: 24px; width: 380px; }
}
.toast {
  background: var(--text);
  color: #fff;
  padding: 11px 14px;
  border-radius: var(--r);
  font-size: .89rem;
  box-shadow: var(--shadow-2);
  animation: rise .2s ease;
  pointer-events: auto;
  display: flex;
  gap: 9px;
  align-items: flex-start;
}
.toast--ok    { background: #3f7411; }
.toast--error { background: #9c3a30; }
.toast--warn  { background: #8a5c12; }
.toast__hint { display: block; opacity: .82; font-size: .82rem; margin-top: 2px; }

/* --------------------------------------------------------------- vacíos */

.empty {
  text-align: center;
  padding: 42px 20px;
  color: var(--text-3);
  background: var(--surface);
  border: 1px dashed var(--line-strong);
  border-radius: var(--r);
}
.empty h3 { color: var(--text-2); margin-bottom: 5px; }
.empty p { font-size: .88rem; margin-bottom: 14px; }

.loading { display: grid; place-items: center; padding: 42px; }

.alert {
  border-radius: var(--r-sm);
  padding: 10px 12px;
  font-size: .87rem;
  margin-bottom: 14px;
  border: 1px solid transparent;
}
.alert--error { background: var(--danger-soft); color: var(--danger); border-color: #edc9c4; }
.alert--info  { background: var(--info-soft);   color: var(--info); }
.alert--warn  { background: var(--warn-soft);   color: var(--warn); }
.alert strong { display: block; margin-bottom: 2px; }

/* --------------------------------------------------------------- métricas */

.stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}
@media (min-width: 560px) { .stats { grid-template-columns: repeat(4, 1fr); } }
.stat {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 12px 14px;
}
.stat__n { font-size: 1.5rem; font-weight: 800; letter-spacing: -.02em; line-height: 1.1; }
.stat__k { font-size: .77rem; color: var(--text-3); margin-top: 2px; }

.deflist { display: grid; gap: 10px; grid-template-columns: 1fr; }
@media (min-width: 560px) { .deflist { grid-template-columns: repeat(2, 1fr); } }
.deflist div { min-width: 0; }
.deflist dt { font-size: .77rem; color: var(--text-3); margin-bottom: 1px; }
.deflist dd { margin: 0; font-size: .92rem; font-weight: 500; overflow-wrap: anywhere; }

/* ---------------------------------------------------------------- utilidad */

.stack     { display: flex; flex-direction: column; gap: 8px; }
.inline    { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.spacer    { flex: 1; }
.muted     { color: var(--text-3); }
.small     { font-size: .84rem; }
.mono      { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .85em; }
.center    { text-align: center; }
.hidden    { display: none !important; }
.nowrap    { white-space: nowrap; }
.mt-2      { margin-top: 16px; }
.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.load-more { display: grid; place-items: center; padding: 14px 0 4px; }

/* ------------------------------------------------------------------ login */
/* Pantalla completa sobre la foto del gimnasio de Poblenou. En móvil, el
   mensaje arriba y el formulario abajo; a partir de 880px, lado a lado. */

.login {
  position: relative;
  min-height: 100dvh;
  overflow: hidden;
  background: var(--ink);
  color: #fff;
}

.login__bg {
  position: absolute;
  inset: -4%;
  background:
    linear-gradient(180deg, rgba(27, 27, 27, .6) 0%, rgba(27, 27, 27, .35) 32%, rgba(27, 27, 27, .94) 76%),
    url("../img/energie-poblenou.jpg") center / cover no-repeat;
  animation: kenburns 28s ease-in-out infinite alternate;
  will-change: transform;
}
@keyframes kenburns {
  from { transform: scale(1) translate(0, 0); }
  to   { transform: scale(1.1) translate(-2%, -1.5%); }
}

/* La trama de puntos del logo, a la deriva. */
.login__dots {
  position: absolute;
  top: -60px; right: -80px;
  width: 340px; height: 340px;
  background-image: radial-gradient(circle, rgba(118, 184, 42, .6) 2px, transparent 2.6px);
  background-size: 18px 18px;
  -webkit-mask-image: radial-gradient(closest-side, #000 20%, transparent);
  mask-image: radial-gradient(closest-side, #000 20%, transparent);
  animation: drift 12s linear infinite;
  opacity: .75;
}
@keyframes drift { to { background-position: 36px 36px; } }

.login__inner {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 1180px;
  min-height: 100dvh;
  margin: 0 auto;
  padding: calc(28px + env(safe-area-inset-top)) 20px calc(24px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 32px;
}

.login__hero { animation: rise-in .7s cubic-bezier(.22, .9, .3, 1) both; }
@keyframes rise-in { from { opacity: 0; transform: translateY(24px); } }

.login__logo { width: 190px; height: auto; display: block; margin-bottom: 40px; }

.login__kicker {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--brand);
  margin: 0 0 12px;
}
.login__pulse {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--pink);
  box-shadow: 0 0 0 0 rgba(230, 0, 126, .6);
  animation: pulse 2s ease-out infinite;
}
@keyframes pulse {
  70%  { box-shadow: 0 0 0 10px rgba(230, 0, 126, 0); }
  100% { box-shadow: 0 0 0 0 rgba(230, 0, 126, 0); }
}

.login__title {
  font-size: clamp(2.1rem, 9vw, 4.4rem);
  line-height: .98;
  font-weight: 900;
  letter-spacing: -.03em;
  text-transform: uppercase;
  margin: 0 0 16px;
}
.login__title span { color: var(--brand); }
.login__lead { color: rgba(255, 255, 255, .75); font-size: .98rem; max-width: 34ch; margin: 0; }

.login__panel {
  width: 100%;
  background: rgba(20, 20, 20, .62);
  -webkit-backdrop-filter: blur(18px) saturate(1.2);
  backdrop-filter: blur(18px) saturate(1.2);
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 22px;
  padding: 24px 20px 18px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .45);
  animation: rise-in .7s .12s cubic-bezier(.22, .9, .3, 1) both;
}
.login__heading { font-size: 1.5rem; font-weight: 800; text-transform: uppercase; letter-spacing: -.01em; }
.login__sub { color: rgba(255, 255, 255, .6); font-size: .88rem; margin: 4px 0 20px; }

.login .field > label { color: rgba(255, 255, 255, .75); }
.login input[type=email], .login input[type=password], .login input[type=text] {
  background: rgba(255, 255, 255, .06);
  border-color: rgba(255, 255, 255, .16);
  color: #fff;
  font-size: 1rem;
  padding: 12px 14px;
  border-radius: 12px;
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
.login input::placeholder { color: rgba(255, 255, 255, .35); }
.login input:focus {
  border-color: var(--brand);
  background: rgba(255, 255, 255, .09);
  box-shadow: 0 0 0 3px rgba(118, 184, 42, .25);
}
.login input.is-invalid { border-color: #ff8a7a; box-shadow: 0 0 0 3px rgba(255, 138, 122, .18); }
.login input:-webkit-autofill {
  -webkit-text-fill-color: #fff;
  -webkit-box-shadow: 0 0 0 40px #2b2b2b inset;
  caret-color: #fff;
}
.login .field__error { color: #ff9d90; }

.login__pass { position: relative; }
.login__pass input { padding-right: 48px; }
.login__eye {
  position: absolute;
  right: 6px; top: 50%;
  transform: translateY(-50%);
  width: 36px; height: 36px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: rgba(255, 255, 255, .6);
  display: grid;
  place-items: center;
  cursor: pointer;
}
.login__eye:hover { color: #fff; background: rgba(255, 255, 255, .08); }
.login__eye svg { width: 19px; height: 19px; }

.login__submit {
  margin-top: 8px;
  padding: 13px 18px;
  font-size: .95rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .06em;
  box-shadow: 0 10px 30px rgba(118, 184, 42, .3);
}
.login__submit svg { transition: transform .2s ease; }
.login__submit:hover svg { transform: translateX(4px); }

.login__foot {
  text-align: center;
  font-size: .75rem;
  letter-spacing: .04em;
  color: rgba(255, 255, 255, .4);
  margin: 16px 0 0;
}

@media (min-width: 560px) {
  .login__panel { max-width: 440px; }
}

@media (min-width: 880px) {
  .login__bg {
    background:
      linear-gradient(90deg, rgba(27, 27, 27, .88) 0%, rgba(27, 27, 27, .45) 55%, rgba(27, 27, 27, .72) 100%),
      url("../img/energie-poblenou.jpg") center / cover no-repeat;
  }
  .login__dots { width: 520px; height: 520px; top: -120px; right: -120px; }
  .login__inner {
    flex-direction: row;
    align-items: center;
    padding: 48px 56px;
    gap: 64px;
  }
  .login__hero { flex: 1; max-width: 580px; }
  .login__logo { width: 260px; margin-bottom: 64px; }
  .login__lead { font-size: 1.08rem; }
  .login__panel { flex: 0 0 400px; padding: 32px 30px 22px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
@media (prefers-reduced-motion: reduce) {
  .login__bg, .login__dots, .login__pulse { animation: none !important; }
}
