.account-page {
  padding-block: 0 clamp(3.5rem, 7vw, 5.5rem);
}

/* El título de página se ve desde el primer instante; los paneles de sesión y
   de panel de control aparecen debajo cuando la sesión ya se resolvió. */
.account-page > .page-header {
  padding-bottom: clamp(2rem, 4vw, 2.75rem);
}

/* El formulario de acceso se lee en una columna: estirado a los 76rem del
   contenedor los campos quedaban de un extremo al otro de la pantalla. */
.account-page > .account-card {
  max-width: 36rem;
}

.account-card,
.account-invitation,
.account-profile {
  padding: clamp(1.4rem, 3vw, 2.2rem);
  border: 1px solid var(--line);
  border-radius: 1rem;
  background: #fff;
}

.account-card h2,
.account-heading h2,
.account-profile h2,
.account-list-heading h2,
.account-invitation h2 {
  margin: 0.4rem 0 0;
  font-family: var(--script);
  font-weight: 500;
}

.account-tabs {
  display: flex;
  margin: 1.5rem 0 0;
  gap: 0.5rem;
}

.account-tabs button {
  min-height: 2.6rem;
  padding: 0 1rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  cursor: pointer;
}

.account-tabs button.is-active {
  color: #fff;
  background: var(--wine-dark);
  border-color: var(--wine-dark);
}

.account-form {
  display: grid;
  margin-top: 1.2rem;
  gap: 0.4rem;
}

.account-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.account-dashboard-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(17rem, 20rem);
  align-items: start;
  gap: clamp(1.25rem, 3vw, 2rem);
}

.account-dashboard-main {
  min-width: 0;
}

.account-profile {
  position: sticky;
  top: 6.25rem;
  margin: 0;
  padding: 1.35rem;
  background:
    linear-gradient(135deg, rgba(255, 250, 246, 0.96), rgba(255, 255, 255, 0.98));
  box-shadow: 0 1rem 2.4rem rgba(64, 33, 30, 0.06);
}

.account-profile-identity {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding-bottom: 1.15rem;
  border-bottom: 1px solid var(--line);
}

.account-profile-identity .eyebrow,
.account-profile-identity h2 {
  margin: 0;
}

.account-profile-avatar {
  display: grid;
  width: 3.2rem;
  height: 3.2rem;
  flex: 0 0 3.2rem;
  place-items: center;
  border: 1px solid rgba(185, 147, 86, 0.65);
  border-radius: 50%;
  background: linear-gradient(145deg, #fffdf9, #f4e8dd);
  color: var(--wine-dark);
  font-family: var(--script);
  font-size: 1.3rem;
  font-weight: 600;
  box-shadow: 0 0.5rem 1.2rem rgba(64, 33, 30, 0.08);
}

.account-profile-heading,
.account-list-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.5rem;
}

.account-profile-heading {
  display: block;
  margin-top: 1.2rem;
}

.account-profile-heading > p {
  max-width: 32rem;
  margin: 0;
  color: var(--muted);
  font-size: 1.04rem;
  line-height: 1.55;
}

.account-profile-heading > p {
  margin-top: 0.7rem;
  font-size: 0.9rem;
}

.account-profile-list {
  display: grid;
  margin: 1.5rem 0 0;
  grid-template-columns: 1fr;
  border: 1px solid var(--line);
  border-radius: 0.8rem;
  overflow: hidden;
}

.account-profile-list > div {
  min-width: 0;
  padding: 1rem 1.1rem;
  background: rgba(255, 255, 255, 0.78);
}

.account-profile-list > div + div {
  border-top: 1px solid var(--line);
  border-left: 0;
}

.account-logout {
  width: 100%;
  margin-top: 1rem;
}

.account-profile-list dt {
  color: var(--muted);
  font-size: 0.83rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* Correo y teléfono son datos: se leen mejor en la serif. */
.account-profile-list dd {
  margin: 0.35rem 0 0;
  overflow-wrap: anywhere;
  color: var(--wine-dark);
  font-family: var(--legible);
  font-style: normal;
  font-weight: 700;
}

.account-list-heading {
  margin: 0 0 1rem;
}

.account-list-heading .text-link {
  color: var(--wine);
  font-weight: 700;
}

/* Las invitaciones ya no bajan en una sola columna: se acomodan en cuadritos
   parejos y cada uno se lee de un vistazo. */
.account-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(21rem, 100%), 1fr));
  align-items: start;
  gap: 1rem;
}

.account-invitation a {
  color: var(--wine);
}

/* Cada tarjeta lleva el color de su estado y, de fondo, la portada de su
   plantilla en marca de agua: se reconoce el diseño antes de leer el nombre. */
.account-invitation {
  --state: var(--wine);
  --state-soft: rgba(148, 59, 67, 0.12);

  position: relative;
  display: grid;
  align-content: start;
  overflow: hidden;
  padding: 1.25rem 1.3rem 1.35rem;
  border-top: 3px solid var(--state);
  box-shadow: 0 1rem 2.4rem rgba(64, 33, 30, 0.06);
}

.account-invitation.is-published {
  --state: #3f6a45;
  --state-soft: rgba(63, 106, 69, 0.13);
}

.account-invitation.is-draft {
  --state: #a97722;
  --state-soft: rgba(169, 119, 34, 0.14);
}

.account-invitation.is-pending {
  --state: #943b43;
  --state-soft: rgba(148, 59, 67, 0.12);
}

/* La portada de la plantilla cubre toda la tarjeta, desenfocada: aporta el
   color y el aire del diseño sin que su tipografía compita con la de aquí.
   El encuadre va al centro porque ahí vive el motivo de cada invitación; el
   borde superior de estas portadas suele ser papel liso. */
.account-invitation-art {
  position: absolute;
  z-index: 0;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 32%;
  opacity: 0.62;
  filter: blur(10px) saturate(1.2) brightness(1.08);
  transform: scale(1.22);
  -webkit-mask-image: linear-gradient(180deg, #000 0%, rgba(0, 0, 0, 0.72) 55%, rgba(0, 0, 0, 0.4) 100%);
  mask-image: linear-gradient(180deg, #000 0%, rgba(0, 0, 0, 0.72) 55%, rgba(0, 0, 0, 0.4) 100%);
  pointer-events: none;
}

/* Encima, papel translúcido con un rastro del color del estado: deja pasar el
   fondo pero devuelve el contraste que necesita el texto. */
.account-invitation:has(.account-invitation-art)::after {
  position: absolute;
  z-index: 0;
  inset: 0;
  background: linear-gradient(
    180deg,
    color-mix(in srgb, var(--state) 8%, rgba(255, 255, 255, 0.22)),
    rgba(255, 255, 255, 0.52) 55%,
    rgba(255, 255, 255, 0.66)
  );
  content: '';
  pointer-events: none;
}

.account-invitation > *:not(.account-invitation-art) {
  position: relative;
  z-index: 1;
}

/* Dentro del cuadrito el estado va arriba, en su propia línea: al costado del
   título dejaba el nombre del evento en un hilo de dos palabras por renglón. */
.account-invitation-heading {
  display: grid;
  gap: 0.15rem;
  justify-items: start;
}

.account-invitation-heading > div {
  min-width: 0;
}

.account-invitation-heading .checkout-status {
  order: -1;
  margin: 0 0 0.35rem;
  background: var(--state-soft);
  color: var(--state);
}

.account-invitation h2 {
  font-size: 1.45rem;
}

.account-invitation .eyebrow {
  font-size: 0.72rem;
}

.account-order-number {
  margin: 0.45rem 0 0;
  color: var(--muted);
  font-family: var(--legible);
  font-style: normal;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.account-invitation-copy {
  margin: 0.85rem 0 0;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.5;
}

/* Botones en dos columnas: en un cuadrito angosto el envoltorio libre dejaba
   un botón solo y desalineado al final de cada fila. */
.account-invitation-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(8.5rem, 1fr));
  gap: 0.5rem;
  margin-top: 1rem;
}

.account-invitation-actions .button {
  min-height: 2.7rem;
  padding-inline: 0.85rem;
  font-size: 0.92rem;
  text-align: center;
}

.account-invitation-actions .button:not(.button-outline) {
  color: #fff;
}

/* Una acción de nombre largo ocupa la fila entera antes que partirse en dos
   renglones dentro de media columna. */
.account-action-wide {
  grid-column: 1 / -1;
}

/* Enlace para compartir: se muestra completo y en cifra monoespaciada, para
   que se pueda leer y dictar, no solo copiar a ciegas. */
.account-share-link {
  display: grid;
  margin: 0.85rem 0 0;
  padding: 0.6rem 0.75rem;
  gap: 0.2rem;
  border: 1px solid rgba(185, 147, 86, 0.42);
  border-radius: 0.6rem;
  background: rgba(255, 255, 255, 0.6);
}

.account-share-link span {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.account-share-link code {
  overflow-wrap: anywhere;
  color: var(--wine-dark);
  font-family: var(--legible);
  font-style: normal;
  font-size: 0.92rem;
}

/* El panel de confirmaciones se comparte con quien lleva la lista, así que su
   enlace se distingue del que reciben los invitados. */
.account-guest-link {
  border-color: rgba(148, 59, 67, 0.4);
  border-style: dashed;
}

/* Quién confirmó: el bloque que el cliente abre después de compartir. */
.account-rsvp {
  margin-top: 1.1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}

.account-rsvp-title {
  margin: 0;
  color: var(--wine);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.account-rsvp-pending {
  margin: 0.6rem 0 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.5;
}

.account-rsvp-counters {
  display: grid;
  margin-top: 0.75rem;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.4rem;
}

.account-rsvp-count {
  display: grid;
  padding: 0.55rem 0.6rem;
  gap: 0.1rem;
  border: 1px solid var(--line);
  border-radius: 0.55rem;
  background: rgba(255, 255, 255, 0.62);
  text-align: center;
}

.account-rsvp-count strong {
  color: var(--wine-dark);
  font-family: var(--text);
  font-size: 1.5rem;
  font-weight: 600;
  line-height: 1;
}

.account-rsvp-count span {
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  line-height: 1.25;
  text-transform: uppercase;
}

/* Los nombres se abren a pedido: el cuadrito conserva su altura hasta que el
   cliente quiere ver la lista. */
.account-rsvp-details {
  margin-top: 0.8rem;
}

.account-rsvp-details > summary {
  color: var(--wine);
  cursor: pointer;
  font-size: 0.88rem;
  font-weight: 700;
  list-style: none;
  text-decoration: underline;
  text-underline-offset: 0.2rem;
}

.account-rsvp-details > summary::-webkit-details-marker {
  display: none;
}

.account-rsvp-details > summary::before {
  display: inline-block;
  margin-right: 0.4rem;
  content: '▸';
  text-decoration: none;
  transition: transform 0.18s ease;
}

.account-rsvp-details[open] > summary::before {
  content: '▾';
}

.account-rsvp-filters {
  display: flex;
  flex-wrap: wrap;
  margin-top: 1rem;
  gap: 0.45rem;
}

.account-rsvp-filters button {
  min-height: 2.3rem;
  padding: 0 0.85rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 700;
}

.account-rsvp-filters button.is-active {
  border-color: var(--wine);
  background: var(--wine);
  color: #fffaf6;
}

.account-rsvp-list {
  display: grid;
  max-height: 22rem;
  margin-top: 0.7rem;
  gap: 0.5rem;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: color-mix(in srgb, var(--wine) 42%, transparent) transparent;
}

.account-rsvp-row {
  padding: 0.75rem 0.9rem;
  border: 1px solid var(--line);
  border-left: 3px solid var(--line);
  border-radius: 0.5rem;
  background: rgba(255, 255, 255, 0.62);
}

.account-rsvp-row[hidden] {
  display: none;
}

.account-rsvp-row.is-yes {
  border-left-color: #4f7854;
}

.account-rsvp-row.is-no {
  border-left-color: #a86b6b;
}

.account-rsvp-row.is-maybe {
  border-left-color: var(--gold);
}

.account-rsvp-row-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.8rem;
}

.account-rsvp-name {
  color: var(--ink);
  font-size: 1.02rem;
}

.account-rsvp-badge {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.is-yes .account-rsvp-badge {
  color: #3f6a45;
}

.is-no .account-rsvp-badge {
  color: #8f5252;
}

.account-rsvp-meta {
  margin: 0.35rem 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.account-rsvp-message {
  margin: 0.45rem 0 0;
  color: #554b45;
  font-family: var(--legible);
  font-size: 0.99rem;
  font-style: italic;
  line-height: 1.5;
}

.account-empty p {
  margin: 0 0 0.7rem;
}

.account-empty p:last-child {
  margin: 1rem 0 0;
}

.text-button {
  margin-top: 0.6rem;
  padding: 0;
  border: 0;
  background: none;
  color: var(--wine);
  text-align: left;
  text-decoration: underline;
  cursor: pointer;
}

.account-empty {
  margin: 0;
  padding: 1.6rem;
  border: 1px dashed var(--line);
  border-radius: 0.9rem;
  background: rgba(255, 255, 255, 0.58);
  color: var(--muted);
}

@media (max-width: 34rem) {
  .account-rsvp-row-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
  }
}

@media (max-width: 50rem) {
  .account-heading {
    flex-direction: column;
  }

  .account-profile-heading,
  .account-list-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .account-profile-list {
    grid-template-columns: 1fr;
  }

  .account-profile-list > div + div {
    border-top: 1px solid var(--line);
    border-left: 0;
  }
}

@media (max-width: 66rem) {
  .account-dashboard-layout {
    grid-template-columns: 1fr;
  }

  .account-profile {
    position: static;
  }
}

/* Nombres de quienes vienen con el invitado. Son opcionales: un pase de
   cuatro puede traer dos nombres, y eso no es un error. */
.account-rsvp-guests {
  margin: 0.35rem 0 0;
  color: #554b45;
  font-size: 0.94rem;
  line-height: 1.5;
}

/* Álbum de fotos de los invitados: QR a la izquierda, estado a la derecha. */
.account-photos-body {
  display: flex;
  align-items: center;
  margin-top: 0.8rem;
  gap: 1rem;
}

.account-photos-qr {
  flex: none;
  width: 8.5rem;
  height: 8.5rem;
  padding: 0.35rem;
  border: 1px solid var(--line);
  border-radius: 0.6rem;
  background: #fff;
}

.account-photos-info {
  display: grid;
  min-width: 0;
  gap: 0.3rem;
}

.account-photos-info p,
.account-photos-note,
.account-photos-warning,
.account-photos-error {
  margin: 0;
  line-height: 1.45;
}

.account-photos-note {
  margin-top: 0.5rem;
  color: var(--muted);
  font-size: 0.84rem;
  overflow-wrap: anywhere;
}

.account-photos-info .account-photos-note {
  margin-top: 0;
}

.account-photos-state {
  color: var(--muted);
  font-weight: 700;
}

.account-photos-state::before {
  display: inline-block;
  width: 0.55rem;
  height: 0.55rem;
  margin-right: 0.45rem;
  border-radius: 50%;
  background: var(--gold);
  content: '';
}

.account-photos-state.is-on {
  color: #3f7a52;
}

.account-photos-state.is-on::before {
  background: #3f7a52;
}

.account-photos-count {
  color: var(--wine-dark);
  font-size: 0.95rem;
}

.account-photos-warning,
.account-photos-error {
  margin-top: 0.6rem;
  color: #a3322f;
  font-size: 0.9rem;
}

.account-photos-banner {
  margin: 0 0 1rem;
  padding: 0.8rem 1rem;
  border: 1px solid rgba(63, 122, 82, 0.4);
  border-radius: 0.7rem;
  background: rgba(63, 122, 82, 0.09);
  color: #2f5c3e;
  line-height: 1.5;
}

.account-photos-banner.is-error {
  border-color: rgba(163, 50, 47, 0.4);
  background: rgba(163, 50, 47, 0.08);
  color: #8a2a28;
}

@media (max-width: 30rem) {
  .account-photos-body {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* Cada bloque de la tarjeta (confirmaciones, fotos) se presenta con su icono,
   su nombre y una línea que dice para qué sirve. */
.account-section-head {
  display: flex;
  align-items: center;
  margin-bottom: 0.9rem;
  gap: 0.8rem;
}

.account-section-icon {
  display: grid;
  flex: none;
  width: 2.6rem;
  height: 2.6rem;
  place-items: center;
  border: 1px solid var(--blush-deep);
  border-radius: 50%;
  background: var(--blush);
  color: var(--wine);
}

.account-section-icon svg {
  width: 1.3rem;
  height: 1.3rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.account-section-head h3 {
  margin: 0;
  color: var(--wine-dark);
  font-family: var(--script);
  font-size: 1.45rem;
  font-style: italic;
  font-weight: 600;
  line-height: 1.1;
}

.account-section-head p {
  margin: 0.2rem 0 0;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.35;
}

/* El álbum de fotos es una función aparte: va en su propio recuadro. */
.account-photos {
  margin-top: 1.3rem;
  padding: 1.1rem;
  border: 1px solid rgba(185, 147, 86, 0.5);
  border-radius: 0.9rem;
  background: linear-gradient(180deg, rgba(247, 235, 231, 0.75), rgba(255, 255, 255, 0.65));
}

.account-photos-copy {
  margin: 0;
  color: #4d4540;
  font-size: 0.92rem;
  line-height: 1.55;
}

/* Aviso del permiso de Drive: Google deja desmarcarlo y sin él no hay fotos. */
.account-photos-permission {
  margin-top: 0.9rem;
  padding: 0.8rem 0.9rem;
  border: 2px solid var(--gold);
  border-radius: 0.7rem;
  background: #fff8ec;
}

.account-photos-permission strong {
  display: block;
  color: var(--wine-dark);
  font-size: 0.92rem;
}

.account-photos-permission p {
  margin: 0.3rem 0 0.6rem;
  color: #4d4540;
  font-size: 0.86rem;
  line-height: 1.45;
}

.account-photos-permission-sample {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  padding: 0.6rem;
  border: 1px solid var(--line);
  border-radius: 0.5rem;
  background: #fff;
  color: #4d4540;
  font-size: 0.8rem;
  line-height: 1.4;
}

.account-photos-check {
  display: grid;
  flex: none;
  width: 1.2rem;
  height: 1.2rem;
  place-items: center;
  border-radius: 0.22rem;
  background: #1a73e8;
  color: #fff;
  font-size: 0.8rem;
  font-weight: 700;
}

/* Captura real de Google con el casillero señalado. */
.account-photos-shot {
  position: relative;
  max-width: 19rem;
  margin: 0;
  overflow: hidden;
  border: 2px solid var(--gold);
  border-radius: 0.6rem;
  background: #1f1f1f;
}

.account-photos-shot img {
  display: block;
  width: 100%;
  height: auto;
}

.account-photos-ring {
  position: absolute;
  top: 50%;
  left: 92.2%;
  width: 2.2rem;
  height: 2.2rem;
  border: 3px solid #ffc94d;
  border-radius: 50%;
  transform: translate(-50%, -50%);
}
