.portal-body {
  min-height: 100vh;
  background: linear-gradient(180deg, #f4eef4 0%, #efe8f5 100%);
}

.returning-family-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 2rem;
  width: min(940px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 1.4rem 1.6rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
}

.returning-family-card h2,
.returning-family-card p {
  margin-bottom: .35rem;
}

.portal-login-wrap {
  padding: clamp(3rem, 8vw, 7rem) 1rem;
}

.portal-login-card {
  width: min(540px, 100%);
  margin: 0 auto;
  padding: clamp(1.5rem, 4vw, 2.5rem);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.portal-login-card form {
  display: grid;
  gap: 1.2rem;
  margin-top: 1.5rem;
}

.portal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 2rem;
  padding: 2rem clamp(1rem, 5vw, 4rem);
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.portal-header h1 {
  margin-bottom: 0;
  font-size: clamp(1.7rem, 4vw, 3rem);
}

.portal-header-actions,
.confirmation-actions,
.dialog-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
}

.portal-main {
  width: min(1100px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 2rem 0 5rem;
}

.portal-section {
  margin-bottom: 2.5rem;
}

.portal-section-heading {
  margin-bottom: 1rem;
}

.portal-section-heading h2 {
  margin-bottom: .3rem;
}

.portal-message {
  padding: .8rem 1rem;
  border-radius: 10px;
  font-weight: 700;
}

.portal-message-success {
  color: #285c34;
  background: #e8f5eb;
  border: 1px solid #acd0b3;
}

.portal-message-error {
  color: #7a2020;
  background: #fff0f0;
  border: 1px solid #e1aaaa;
}

.family-photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1rem;
}

.family-photo-card {
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 10px 28px rgba(62, 45, 41, .10);
}

.family-photo-card > img,
.photo-preview-unavailable {
  width: 100%;
  aspect-ratio: 1.2;
  object-fit: cover;
}

.photo-preview-unavailable {
  display: grid;
  place-items: center;
  padding: 1rem;
  color: var(--muted);
  background: var(--soft);
  text-align: center;
}

.family-photo-card-body {
  display: grid;
  justify-items: start;
  gap: .75rem;
  padding: 1rem;
}

.family-photo-card-body h3 {
  margin: 0;
  overflow-wrap: anywhere;
  font-size: 1rem;
}

.portal-status {
  display: inline-flex;
  padding: .32rem .65rem;
  border-radius: 999px;
  font-size: .82rem;
  font-weight: 700;
}

.portal-status-pending {
  background: #fff1cf;
}

.portal-status-approved {
  background: #e3f2e6;
}

.portal-status-rejected,
.portal-status-withdrawn {
  background: #f6dddd;
}

.removal-request-state {
  width: 100%;
  padding: .8rem;
  border-radius: 10px;
}

.removal-request-state p {
  margin: .35rem 0 0;
}

.removal-pending {
  background: #fff1cf;
}

.removal-approved {
  background: #e3f2e6;
}

.removal-denied {
  background: #f6dddd;
}

.removal-dialog {
  width: min(560px, calc(100% - 2rem));
  padding: 0;
  border: 0;
  border-radius: 18px;
  box-shadow: 0 30px 90px rgba(0,0,0,.3);
}

.removal-dialog::backdrop {
  background: rgba(30, 23, 24, .72);
}

.removal-dialog form {
  display: grid;
  gap: 1rem;
  padding: 1.5rem;
}

.access-code-panel {
  margin: 1.2rem 0;
  padding: 1.2rem;
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 14px;
}

.access-code-panel code {
  display: block;
  width: fit-content;
  margin: .7rem 0;
  padding: .7rem 1rem;
  color: var(--accent-dark);
  background: white;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: clamp(1.05rem, 4vw, 1.45rem);
  font-weight: 700;
  letter-spacing: .08em;
}

@media (max-width: 720px) {
  .returning-family-card,
  .portal-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .returning-family-card .button {
    width: 100%;
  }
}


/* Keep the returning-family panel aligned with the RSVP cards. */
.returning-family-card {
  width: min(940px, calc(100% - 2rem));
  margin: clamp(1.25rem, 3vw, 2rem) auto 0;
}
