:root {
  color-scheme: light;
  --ink: #211b4f;
  --muted: #625e7b;
  --purple: #6d42c7;
  --purple-dark: #4d2e9c;
  --lavender: #e5ddf7;
  --lavender-mid: #bcb0db;
  --lavender-soft: #f7f4fc;
  --page: #f4f2f9;
  --white: #fff;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

body.auth-page {
  min-height: 100vh;
  margin: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background:
    radial-gradient(circle at 12% 10%, rgba(109,66,199,.09), transparent 30%),
    radial-gradient(circle at 88% 90%, rgba(38,117,83,.07), transparent 28%),
    var(--page);
  color: var(--ink);
}

body.profile-page { background: var(--page); }

.auth-card {
  width: min(100%, 560px);
  padding: clamp(26px, 6vw, 38px);
  border: 1px solid var(--lavender);
  border-radius: 22px;
  background: var(--white);
  box-shadow: 0 18px 50px rgba(43,31,91,.11);
}

.auth-card-narrow { width: min(100%, 440px); }

.auth-mark {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  margin-bottom: 22px;
  border-radius: 0;
  background: transparent;
  color: var(--coral);
  font-size: 1.15rem;
  font-weight: 900;
}
.auth-mark img { width: 100%; height: 100%; display: block; object-fit: contain; }

.eyebrow {
  margin: 0 0 8px;
  color: var(--purple-dark);
  font-size: .76rem;
  font-weight: 800;
  letter-spacing: .075em;
  text-transform: uppercase;
}

h1 {
  margin: 0 0 10px;
  font-size: clamp(1.75rem, 6vw, 2.25rem);
  line-height: 1.12;
  letter-spacing: -.035em;
}

p, li { color: var(--muted); line-height: 1.55; }

label {
  display: block;
  margin: 18px 0 7px;
  color: var(--ink);
  font-size: .88rem;
  font-weight: 750;
}

input, select {
  width: 100%;
  min-height: 48px;
  padding: 10px 12px;
  border: 1px solid var(--lavender-mid);
  border-radius: 10px;
  background: var(--white);
  color: var(--ink);
  font: inherit;
}

input:focus, select:focus, button:focus-visible {
  outline: 3px solid var(--purple);
  outline-offset: 2px;
  border-color: var(--purple);
}

button {
  min-height: 46px;
  padding: 9px 16px;
  border: 0;
  border-radius: 10px;
  background: var(--purple);
  color: var(--white);
  font: inherit;
  font-weight: 750;
  cursor: pointer;
}

button:hover { background: var(--purple-dark); }
.auth-card-narrow form > button { width: 100%; margin-top: 22px; }

.error {
  margin: 14px 0 0;
  padding: 11px 12px;
  border: 1px solid #efbdc5;
  border-radius: 9px;
  background: #fff0f2;
  color: #a33d4d;
  font-weight: 700;
}

.privacy { margin: 20px 0 0; font-size: .86rem; }

.permission {
  margin: 22px 0;
  padding: 17px 19px;
  border-left: 4px solid var(--purple);
  border-radius: 0 12px 12px 0;
  background: var(--lavender-soft);
}

.permission strong { display: block; margin-bottom: 6px; }
.permission ul { margin: 7px 0 0; padding-left: 21px; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.actions button[value="deny"] { border: 1px solid var(--lavender); background: var(--white); color: var(--purple-dark); }
.actions button[value="deny"]:hover { background: var(--lavender-soft); }
.auth-note { display: block; margin-top: 20px; color: var(--muted); line-height: 1.45; }

.profile-shell {
  width: min(100%, 1080px);
  margin: auto;
  padding: clamp(28px, 6vw, 64px) 20px;
  text-align: center;
}

.profile-brand { display: inline-flex; align-items: center; gap: 12px; margin-bottom: clamp(38px, 8vw, 74px); text-align: left; }
.profile-brand .auth-mark { width: 42px; height: 42px; margin: 0; border-radius: 12px; }
.profile-brand strong, .profile-brand small { display: block; }
.profile-brand strong { font-size: 1.08rem; }
.profile-brand small { color: var(--muted); font-size: .8rem; }
.profile-heading h1 { font-size: clamp(2rem, 6vw, 3.25rem); }
.profile-heading p { margin: 0 auto; font-size: 1.05rem; }
.profile-grid { display: flex; flex-wrap: wrap; justify-content: center; gap: clamp(28px, 5vw, 58px); margin: 46px auto 38px; }
.profile-option { margin: 0; display: grid; justify-items: center; }
.profile-option .profile-select {
  width: 174px;
  min-height: 0;
  padding: 0;
  display: grid;
  justify-items: center;
  gap: 7px;
  border: 0;
  background: transparent;
  color: var(--ink);
}
.profile-option .profile-select:hover { background: transparent; }
.profile-avatar {
  width: 160px;
  height: 170px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--lavender-mid);
  border-radius: 18px;
  background: #f7f4ff;
  color: var(--purple-dark);
  font-size: 3.4rem;
  font-weight: 850;
  transition: transform .16s ease, border-color .16s ease;
}
.profile-avatar img { width: 100%; height: 100%; display: block; object-fit: cover; }
.profile-option .profile-select:hover .profile-avatar, .profile-option .profile-select:focus-visible .profile-avatar { transform: translateY(-2px); border-color: var(--purple); }
.profile-option .profile-select:focus-visible { outline: 0; }
.profile-option strong { font-size: 1rem; }
.profile-option small { color: var(--muted); font-size: .78rem; }
.profile-edit-photo { margin-top: 3px; padding: 2px 4px; border: 0; color: var(--purple-dark); background: transparent; font-size: .76rem; font-weight: 700; }
.profile-edit-photo:hover { background: transparent; text-decoration: underline; text-underline-offset: 3px; }
.add-profile { width: min(100%, 430px); margin: 18px auto 0; border-top: 1px solid var(--lavender); text-align: left; }
.add-profile summary { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 22px 14px 12px; cursor: pointer; list-style: none; }
.add-profile summary::-webkit-details-marker { display: none; }
.add-profile summary strong, .add-profile summary small { display: block; }
.add-profile summary small { color: var(--muted); font-size: .8rem; }
.add-profile-mark { width: 38px; height: 38px; display: grid; place-items: center; border: 1px dashed var(--lavender-mid); border-radius: 12px; color: var(--purple-dark); font-size: 1.5rem; }
.add-profile form { margin: 0 auto; padding: 8px 0 18px; }
.add-profile form button { width: 100%; margin-top: 14px; }
.profile-signout { display: inline-block; margin-top: 24px; color: var(--muted); font-size: .88rem; font-weight: 700; }
.photo-help { display: block; margin-top: 5px; color: var(--muted); font-size: .76rem; }

.profile-photo-dialog { position: fixed; inset: 36px 36px 36px auto; width: min(460px, calc(100vw - 28px)); max-height: calc(100dvh - 72px); margin: 0; padding: 0; overflow: auto; border: 1px solid var(--lavender); border-radius: 16px; color: var(--ink); background: white; box-shadow: 0 24px 70px rgba(35,25,75,.16); }
.profile-photo-dialog::backdrop { background: rgba(31,27,76,.07); }
.profile-photo-dialog form { padding: 28px; }
.profile-dialog-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.profile-dialog-head .eyebrow { margin-bottom: 3px; }
.profile-photo-dialog h2 { margin: 0; font-size: 1.45rem; }
.profile-photo-dialog h2:focus { outline: none; }
.profile-dialog-copy { max-width: 340px; margin: 11px 0 0; color: var(--muted); font-size: .88rem; line-height: 1.45; }
.profile-dialog-close { width: 34px; height: 34px; min-height: 0; flex: none; padding: 0 0 2px; border: 0; border-radius: 8px; color: var(--muted); background: transparent; font-size: 1.55rem; line-height: 1; }
.profile-dialog-close:hover { color: var(--purple-dark); background: var(--lavender-soft); }
.profile-fields { margin-top: 24px; }
.profile-fields label:first-child { margin-top: 0; }
.profile-photo-field { margin-top: 26px; padding-top: 22px; border-top: 1px solid var(--lavender); }
.profile-photo-field h3 { margin: 0 0 2px; font-size: 1rem; }
.profile-photo-field h3 small { margin-left: 5px; color: var(--muted); font-size: .72rem; font-weight: 650; }
.profile-photo-field p { margin: 0; font-size: .82rem; }
.profile-photo-preview-wrap { display: grid; justify-items: start; gap: 7px; margin: 16px 0 14px; }
.profile-photo-preview-wrap > small { max-width: 300px; min-height: 18px; overflow: hidden; color: var(--muted); font-size: .76rem; text-align: center; text-overflow: ellipsis; white-space: nowrap; }
.profile-photo-preview-wrap > small.photo-error { color: #a33d4d; font-weight: 700; }
.profile-photo-preview { width: 112px; height: 112px; display: grid; place-items: center; overflow: hidden; border: 1px solid var(--lavender-mid); border-radius: 14px; color: var(--purple-dark); background: #f7f4ff; font-size: 2.7rem; font-weight: 850; }
.profile-photo-preview img { width: 100%; height: 100%; object-fit: cover; }
.profile-photo-actions { display: flex; align-items: center; gap: 12px; }
.profile-photo-picker { flex: 1; display: block; margin: 0; }
.profile-photo-picker input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.profile-photo-picker span { width: 100%; min-height: 44px; display: grid; place-items: center; padding: 9px 13px; border: 1px solid var(--purple); border-radius: 9px; color: var(--purple-dark); background: white; font-size: .88rem; font-weight: 760; cursor: pointer; }
.profile-photo-picker:hover span { background: var(--lavender-soft); }
.profile-remove-photo { min-height: 40px; padding: 6px 2px; color: #95404e; background: transparent; font-size: .8rem; font-weight: 720; }
.profile-remove-photo:hover { color: #792f3c; background: transparent; text-decoration: underline; text-underline-offset: 3px; }
.profile-remove-photo[hidden] { display: none; }
.profile-photo-dialog .photo-help { margin-top: 7px; }
.profile-dialog-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--lavender); }
.profile-dialog-actions button:disabled { color: #8d879d; background: #ebe8f1; cursor: not-allowed; }
.profile-dialog-actions button:last-child { color: var(--purple-dark); background: white; border: 1px solid var(--lavender-mid); }

@media (max-width: 520px) {
  body.auth-page { padding: 10px; }
  .auth-card { padding: 24px 20px; border-radius: 17px; }
  .actions { display: grid; }
  .profile-shell { padding-inline: 12px; }
  .profile-brand { margin-bottom: 38px; }
  .profile-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px 10px; margin-top: 34px; }
  .profile-option .profile-select { width: 100%; }
  .profile-avatar { width: 118px; height: 126px; border-radius: 15px; font-size: 2.5rem; }
  .profile-photo-dialog { inset: 10px; width: auto; max-height: calc(100dvh - 20px); }
  .profile-photo-dialog form { padding: 21px 18px; }
  .profile-photo-actions { align-items: stretch; flex-direction: column; gap: 3px; }
  .profile-remove-photo { align-self: center; }
}

/* Editorial family profile experience. */
:root {
  --ink: #2d1835;
  --muted: #70646a;
  --purple: #4d2756;
  --purple-dark: #301637;
  --lavender: #e3d9d0;
  --lavender-mid: #c9b9b3;
  --lavender-soft: #f2eae4;
  --page: #f8f3ea;
  --white: #fffdf8;
  --accent: #b45118;
  --accent-dark: #963f10;
  --accent-bright: #e87532;
  --accent-soft: #fbe8da;
  --coral: var(--accent);
  --display: "Iowan Old Style", Baskerville, Georgia, "Times New Roman", serif;
}

body.auth-page { background: var(--page); }
.auth-card { border-radius: 8px; background: rgba(255,253,248,.78); box-shadow: 0 20px 60px rgba(54,34,39,.1); }
.auth-mark { border-radius: 0; background: transparent; font-weight: 600; }
h1 { font-family: var(--display); font-weight: 400; letter-spacing: -.02em; }
label, button { font-weight: 600; }
button { border-radius: 5px; background: var(--coral); }
button:hover { background: var(--accent-dark); }
input:focus, select:focus, button:focus-visible { outline-color: var(--accent-bright); border-color: var(--accent); }

.profile-shell { width: min(100%, 1120px); padding-top: clamp(30px, 5vw, 58px); }
.profile-brand { margin-bottom: clamp(44px, 7vw, 68px); }
.profile-brand .auth-mark { width: 40px; height: 40px; color: #d7ad73; background: transparent; font-family: var(--display); font-size: 0; font-weight: 400; }
.profile-brand strong { font-family: var(--display); font-size: 1.35rem; font-weight: 400; }
.profile-heading h1 { font-size: clamp(2.25rem, 3.8vw, 3rem); font-weight: 400; }
.profile-heading p { font-size: 1rem; }
.profile-grid { gap: clamp(32px, 5vw, 62px); margin-top: 50px; }
.profile-option .profile-select { width: 176px; gap: 8px; }
.profile-avatar { width: 156px; height: 156px; border-color: var(--lavender-mid); border-radius: 50%; background: var(--white); box-shadow: 0 8px 26px rgba(54,34,39,.08); }
.profile-option .profile-select:hover .profile-avatar, .profile-option .profile-select:focus-visible .profile-avatar { border-color: var(--accent-bright); transform: translateY(-3px); }
.profile-option strong { font-family: var(--display); font-size: 1.2rem; font-weight: 400; }
.profile-option small { font-size: .78rem; font-weight: 500; }
.profile-edit-photo { color: var(--coral); font-weight: 550; }
.add-profile { border-color: var(--lavender); }
.add-profile-mark { border-color: var(--lavender-mid); border-radius: 50%; color: var(--coral); }
.profile-signout { font-weight: 500; }

.profile-photo-dialog { inset: 20px 20px 20px auto; max-height: calc(100dvh - 40px); border-color: var(--lavender); border-radius: 8px; background: var(--white); box-shadow: 0 24px 70px rgba(54,34,39,.14); }
.profile-photo-dialog::backdrop { background: rgba(45,20,52,.12); }
.profile-photo-dialog form { padding: 24px; }
.profile-photo-dialog h2 { font-family: var(--display); font-size: 1.75rem; font-weight: 400; }
.profile-fields { margin-top: 18px; }
.profile-photo-field { margin-top: 20px; padding-top: 18px; }
.profile-photo-field { display: grid; grid-template-columns: 112px minmax(0, 1fr); column-gap: 18px; align-items: start; }
.profile-photo-field > div:first-child { grid-column: 1 / -1; }
.profile-photo-preview-wrap { grid-column: 1; margin-bottom: 0; }
.profile-photo-preview { border-radius: 50%; background: var(--page); }
.profile-photo-actions { grid-column: 2; align-self: center; align-items: stretch; flex-direction: column; gap: 4px; }
.profile-photo-picker span { border-color: var(--coral); border-radius: 5px; color: var(--purple-dark); font-weight: 550; }
.profile-remove-photo { align-self: center; }
.profile-photo-field > .photo-help { grid-column: 2; margin-top: -2px; }
.profile-dialog-actions { margin-top: 14px; padding-top: 14px; }
.profile-dialog-actions button:last-child { color: var(--purple-dark); background: transparent; }

@media (max-width: 520px) {
  .profile-heading h1 { font-size: 2.25rem; }
  .profile-option .profile-select { width: 100%; }
  .profile-avatar { width: 116px; height: 116px; border-radius: 50%; }
  .profile-option:last-child:nth-child(odd) { grid-column: 1 / -1; }
  .profile-photo-field { display: block; }
  .profile-photo-preview-wrap { margin-bottom: 14px; }
  .profile-photo-actions { align-items: stretch; }
  .profile-photo-field > .photo-help { margin-top: 7px; }
}
