.pc-auth-section {
  --auth-navy: #1c2237;
  --auth-paper: #f4f0e6;
  --auth-ink: #252b40;
  --auth-muted: #616052;
  --auth-line: #d5cfc0;
  --auth-accent: #5148b8;
  padding: clamp(4rem, 8vw, 7rem) 2rem;
  background: var(--auth-navy);
  scroll-margin-top: 100px;
  color: var(--auth-paper);
}

.pc-auth-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 510px);
  align-items: center;
  gap: clamp(2rem, 6vw, 6rem);
  max-width: 1120px;
  margin-inline: auto;
}

.pc-auth-intro { position: relative; isolation: isolate; }

.pc-auth-intro::before {
  content: '';
  position: absolute;
  z-index: -1;
  top: 50%;
  left: 50%;
  width: min(100%, 420px);
  aspect-ratio: 640 / 608;
  transform: translate(-50%, -50%);
  background: var(--auth-paper);
  opacity: 0.085;
  -webkit-mask: url('../img/icons/brands/pioneer-class-laurel.png') center / contain no-repeat;
  mask: url('../img/icons/brands/pioneer-class-laurel.png') center / contain no-repeat;
  pointer-events: none;
}

.pc-auth-intro h2 {
  margin: 0 0 1.5rem;
  color: var(--auth-paper);
  font-size: clamp(2.5rem, 4.5vw, 4rem);
  font-weight: 700;
  line-height: 1.09;
  letter-spacing: -0.035em;
  text-wrap: balance;
}

.pc-auth-intro h2 em {
  display: inline-block;
  margin-top: 0.3em;
  color: #d6c7a6;
  font-family: Georgia, 'Times New Roman', serif;
  font-weight: 400;
  letter-spacing: -0.025em;
}

.pc-auth-intro > p {
  max-width: 36ch;
  margin: 0;
  color: #c3c5d0;
  font-size: 1.05rem;
  line-height: 1.8;
}

.pc-auth-note { margin-top: 3rem; }
.pc-auth-note-line { display: block; width: 48px; height: 1px; margin-bottom: 1rem; background: #817f96; }
.pc-auth-note p { max-width: 30ch; margin: 0; color: #c3c5d0; font-size: 0.875rem; line-height: 1.65; }
.pc-auth-book { position: relative; z-index: 1; min-width: 0; perspective: 1600px; scroll-margin-top: 104px; }
.pc-auth-flipper { display: grid; gap: 2rem; }
.pc-auth-leaf { min-width: 0; }
.pc-auth-book-toolbar, .pc-auth-story { display: none; }

.pc-auth-paper {
  position: relative;
  box-sizing: border-box;
  min-width: 0;
  padding: clamp(1.5rem, 3vw, 1.75rem);
  border: 1px solid #e5dfd0;
  border-radius: 6px;
  background: var(--auth-paper);
  color: var(--auth-ink);
  box-shadow: 0 26px 64px rgba(6, 10, 24, 0.24), 0 3px 9px rgba(6, 10, 24, 0.12);
}

.pc-auth-paper-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.3rem; padding-bottom: 1rem; border-bottom: 1px solid var(--auth-line); }
.pc-auth-brand { display: inline-flex; align-items: center; gap: 0.5rem; color: var(--auth-ink); font-size: 0.95rem; font-weight: 700; letter-spacing: -0.02em; }
.pc-auth-brand img { object-fit: contain; }
.pc-auth-paper-mark { color: #747060; font-size: 1.5rem; line-height: 1; }
.pc-auth-face { display: flex; flex-direction: column; scroll-margin-top: 104px; }
.pc-auth-paper h3 { margin: 0; color: var(--auth-ink); font-family: Georgia, 'Times New Roman', serif; font-size: clamp(1.65rem, 2.5vw, 2rem); font-weight: 400; line-height: 1.15; letter-spacing: -0.025em; }
.pc-auth-subtitle { margin: 0.65rem 0 1.2rem; color: var(--auth-muted); font-size: 0.875rem; line-height: 1.6; }
.pc-auth-form { display: grid; gap: 1rem; }
.pc-auth-form--signup { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.95rem 1rem; }
.pc-auth-field { min-width: 0; }
.pc-auth-field--full, .pc-auth-form--signup > .pc-auth-submit, .pc-auth-terms { grid-column: 1 / -1; }
.pc-auth-field label { display: block; margin-bottom: 0.4rem; color: var(--auth-ink); font-size: 0.8rem; font-weight: 600; line-height: 1.5; }
.pc-auth-field label span { color: var(--auth-muted); font-size: 0.7rem; font-weight: 400; }

.pc-auth-field input {
  display: block;
  width: 100%;
  min-height: 46px;
  padding: 0.7rem 0.8rem;
  border: 1px solid var(--auth-line);
  border-radius: 3px;
  background: #faf7f0;
  color: var(--auth-ink);
  font: inherit;
  font-size: 0.875rem;
  line-height: 1.4;
}

.pc-auth-field input::placeholder { color: #6c695c; opacity: 1; }
.pc-auth-field input:-webkit-autofill { -webkit-text-fill-color: var(--auth-ink); caret-color: var(--auth-ink); }
.pc-auth-field input:focus-visible { outline: 2px solid var(--auth-accent); outline-offset: 2px; }
.pc-auth-password { position: relative; }
.pc-auth-password input { padding-right: 2.85rem; }
.pc-auth-password button { position: absolute; inset: 1px 1px 1px auto; display: grid; place-items: center; width: 44px; padding: 0; border: 0; border-radius: 2px; background: transparent; color: #615d50; cursor: pointer; font-size: 1.15rem; }
.pc-auth-phone { position: relative; }
.pc-auth-field .pc-auth-phone input { padding-left: 4rem; }
.pc-auth-phone-prefix { position: absolute; inset: 1px auto 1px 1px; display: flex; align-items: center; padding-inline: 0.8rem; border-right: 1px solid var(--auth-line); color: var(--auth-muted); font-size: 0.875rem; font-weight: 600; pointer-events: none; }
.pc-auth-options { display: flex; align-items: center; justify-content: space-between; gap: 1rem; font-size: 0.8rem; }
.pc-auth-check { display: flex; align-items: center; gap: 0.5rem; margin: 0; color: var(--auth-muted); font-size: 0.8rem; line-height: 1.5; cursor: pointer; }
.pc-auth-check input { flex-shrink: 0; width: 16px; height: 16px; margin: 0; accent-color: var(--auth-accent); }
.pc-auth-terms { align-items: flex-start; margin-block: 0.3rem; font-size: 0.75rem; }
.pc-auth-terms input { margin-top: 0.12rem; }
.pc-auth-paper a { color: var(--auth-accent); font-weight: 600; text-underline-offset: 3px; }
.pc-auth-paper a:hover { text-decoration: underline; }
.pc-auth-paper a:focus-visible, .pc-auth-paper button:focus-visible, .pc-auth-check input:focus-visible { outline: 2px solid var(--auth-accent); outline-offset: 4px; }

.pc-auth-paper .pc-auth-submit {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  width: 100%;
  min-height: 48px;
  padding: 0.8rem 1rem;
  border: 1px solid var(--auth-ink);
  border-radius: 3px;
  background: var(--auth-ink);
  color: var(--auth-paper);
  font: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
}

.pc-auth-paper .pc-auth-submit:hover { background: #343b54; border-color: #343b54; text-decoration: none; }
.pc-auth-paper .pc-auth-submit:disabled { cursor: wait; opacity: 0.65; }
.pc-auth-submit i { font-size: 1.25rem; }
.pc-auth-switch { margin: 1.3rem 0 0; color: var(--auth-muted); text-align: center; font-size: 0.85rem; }
.pc-auth-switch a { margin-left: 0.2rem; }
.pc-auth-paper-footnote { margin: auto 0 0; padding-top: 1.2rem; color: var(--auth-muted); text-align: center; font-size: 0.73rem; line-height: 1.6; }
.pc-auth-error { margin: 0 0 1.2rem; padding: 0.8rem; border: 1px solid #bf9b91; border-radius: 3px; background: #f1e2d9; color: #7d2e23; font-size: 0.85rem; line-height: 1.5; }
.pc-auth-signed-in h3 { margin-top: 2rem; }
.pc-auth-signed-in > p { margin: 1rem 0 2rem; color: var(--auth-muted); line-height: 1.7; }

.pc-auth-section[data-enhanced="true"] .pc-auth-layout { position: relative; display: block; }
.pc-auth-section[data-enhanced="true"] .pc-auth-intro { position: absolute; z-index: 0; top: 50%; left: 0; width: 42%; transform: translateY(-50%); }
.pc-auth-book-toolbar { height: 32px; margin-bottom: 0.5rem; text-align: right; }
.pc-auth-section[data-enhanced="true"] .pc-auth-book-toolbar { display: block; }
.pc-auth-book-toolbar button { padding: 0; border: 0; background: none; color: #c3c5d0; font: inherit; font-size: 0.8rem; cursor: pointer; visibility: hidden; }
.pc-auth-book-toolbar button span { margin-left: 0.75rem; font-size: 1.2rem; }
.pc-auth-section[data-open="true"] .pc-auth-book-toolbar button { visibility: visible; }
.pc-auth-section button:focus-visible { outline: 2px solid #a79ce1; outline-offset: 4px; }
.pc-auth-section[data-enhanced="true"] .pc-auth-flipper {
  position: relative;
  display: block;
  gap: 0;
  transform-style: preserve-3d;
}

.pc-auth-section[data-enhanced="true"] .pc-auth-leaf {
  position: absolute;
  top: 0;
  left: 50%;
  width: 50%;
  height: 100%;
  z-index: 2;
  transform-origin: left center;
  transform-style: preserve-3d;
  transition: transform 850ms ease-in-out;
}

.pc-auth-section[data-enhanced="true"] .pc-auth-leaf > .pc-auth-paper {
  position: absolute;
  inset: 0;
  width: 100%;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.pc-auth-section[data-enhanced="true"] .pc-auth-face { border-radius: 3px; }
.pc-auth-section[data-enhanced="true"] .pc-auth-face--login { transform: rotateY(0deg); background: linear-gradient(to right, #e2dbcc, transparent 6%), var(--auth-paper); }
.pc-auth-section[data-enhanced="true"] .pc-auth-face--signup { transform: rotateY(180deg); background: linear-gradient(to left, #e2dbcc, transparent 6%), var(--auth-paper); }
.pc-auth-section[data-enhanced="true"] .pc-auth-story { position: absolute; inset: 0 0 0 auto; display: flex; flex-direction: column; width: 50%; border-radius: 3px; background: linear-gradient(to right, #e2dbcc, transparent 6%), var(--auth-paper); }
.pc-auth-memories {
  display: grid;
  flex: 1;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-template-rows: repeat(2, minmax(0, 1fr));
  place-items: center;
  container-type: size;
  gap: 8px 10px;
  box-sizing: border-box;
  min-width: 0;
  min-height: 0;
  width: 100%;
  padding: 10px 3px 4px;
  margin: 0;
}

.pc-auth-memory {
  position: relative;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  min-width: 0;
  min-height: 0;
  width: min(100%, calc((100cqh - 22px) * 0.45));
  aspect-ratio: 9 / 10;
  margin: 0;
  padding: 4px 4px 8px;
  border: 1px solid #e2dbcd;
  background: #fffdf7;
  box-shadow: 2px 7px 12px rgba(58, 47, 27, 0.12), 0 1px 2px rgba(58, 47, 27, 0.1);
}

.pc-auth-memory--first { transform: rotate(-3deg); }
.pc-auth-memory--second { transform: rotate(2.5deg); }
.pc-auth-memory--third { transform: rotate(2deg); }
.pc-auth-memory--fourth { transform: rotate(-2deg); }
.pc-auth-memory--fifth { transform: rotate(-2.5deg); }
.pc-auth-memory--sixth { transform: rotate(3deg); }

.pc-auth-memory::before {
  content: '';
  position: absolute;
  z-index: 1;
  top: -7px;
  left: 50%;
  width: 54px;
  height: 16px;
  border: 1px solid rgba(194, 171, 119, 0.16);
  background: repeating-linear-gradient(100deg, rgba(229, 213, 170, 0.68) 0 3px, rgba(218, 199, 154, 0.64) 3px 4px);
  transform: translateX(-50%) rotate(3deg);
  clip-path: polygon(0 5%, 96% 0, 100% 93%, 3% 100%);
  pointer-events: none;
}

.pc-auth-memory--second::before { width: 48px; transform: translateX(-50%) rotate(-5deg); }
.pc-auth-memory-mat { position: relative; display: grid; flex: none; place-items: center; min-width: 0; min-height: 0; width: 100%; aspect-ratio: 1 / 1; overflow: hidden; background: #e5dfd2; color: #696252; }
.pc-auth-memory-mat img { position: absolute; inset: 0; display: block; width: 100%; height: 100%; object-fit: cover; }
.pc-auth-memory--first .pc-auth-memory-mat img { object-position: center bottom; }
.pc-auth-memory--second .pc-auth-memory-mat img { object-position: 20% center; }
.pc-auth-memory--sixth .pc-auth-memory-mat img { object-position: 10% center; }
.pc-auth-memory-mat > i { font-size: 1.25rem; }
.pc-auth-story-invite { flex: none; margin: 12px 0 0; color: var(--auth-ink); font-family: Georgia, 'Times New Roman', serif; font-size: clamp(1rem, 1.5vw, 1.25rem); font-style: italic; line-height: 1.4; text-align: center; text-wrap: balance; }
.pc-auth-section[data-enhanced="true"][data-open="true"] .pc-auth-leaf { transform: rotateY(-180deg); }
.pc-auth-face::after { position: absolute; bottom: 0.65rem; color: #938c7c; font-size: 0.65rem; }
.pc-auth-face--login::after { content: '01'; left: 1.75rem; }
.pc-auth-face--signup::after { content: '02'; left: 1.75rem; }
.pc-auth-page-content { padding-bottom: 1rem; }

@media (min-width: 992px) {
  .pc-auth-section { box-sizing: border-box; display: grid; align-items: center; min-height: calc(100svh - 100px); padding: 16px 2rem; }
  .pc-auth-layout { width: 100%; }
  .pc-auth-intro h2 { margin-bottom: 1rem; font-size: clamp(2.5rem, 3.8vw, 3.2rem); }
  .pc-auth-intro > p { font-size: 0.95rem; line-height: 1.7; }
  .pc-auth-note { margin-top: 1.5rem; }
  .pc-auth-paper { padding: 20px 24px; }
  .pc-auth-paper-header { margin-bottom: 12px; padding-bottom: 10px; }
  .pc-auth-paper h3 { font-size: 28px; }
  .pc-auth-subtitle { margin: 6px 0 12px; }
  .pc-auth-form, .pc-auth-form--signup { gap: 10px 1rem; }
  .pc-auth-field label { margin-bottom: 4px; }
  .pc-auth-field input { min-height: 42px; padding: 9px 12px; }
  .pc-auth-password input { padding-right: 2.85rem; }
  .pc-auth-paper .pc-auth-submit { min-height: 44px; padding: 10px 1rem; }
  .pc-auth-terms { margin-block: 0; }
  .pc-auth-switch { margin-top: 12px; }
  .pc-auth-paper-footnote { padding-top: 10px; }
  .pc-auth-page-content { padding-bottom: 12px; }
  .pc-auth-face--login .pc-auth-subtitle { margin: 12px 0 22px; }
  .pc-auth-face--login .pc-auth-form { gap: 18px; }
  .pc-auth-face--login .pc-auth-switch { margin-top: 18px; }
  .pc-auth-book-toolbar { height: 24px; margin-bottom: 4px; }
.pc-auth-section[data-enhanced="true"] .pc-auth-flipper { min-height: min(560px, calc(100svh - 180px)); }
}

@media (min-width: 992px) and (max-height: 700px) {
  .pc-auth-paper { padding-block: 16px; }
  .pc-auth-paper-header { margin-bottom: 10px; padding-bottom: 8px; }
  .pc-auth-paper h3 { font-size: 26px; }
  .pc-auth-subtitle { margin-bottom: 10px; }
  .pc-auth-form, .pc-auth-form--signup { gap: 8px 1rem; }
  .pc-auth-switch { margin-top: 8px; }
  .pc-auth-page-content { padding-bottom: 8px; }
  .pc-auth-face--signup { padding-block: 12px; }
  .pc-auth-face--signup .pc-auth-paper-header { margin-bottom: 8px; padding-bottom: 6px; }
  .pc-auth-face--signup .pc-auth-subtitle { margin-bottom: 8px; }
}

@media (min-width: 992px) {
  .pc-auth-face--signup .pc-auth-paper-header { margin-bottom: 24px; }
  .pc-auth-face--signup .pc-auth-form--signup { gap: 18px 1rem; }
  .pc-auth-face--signup .pc-auth-field input { min-height: 48px; padding-block: 12px; }
  .pc-auth-face--signup .pc-auth-switch { margin-top: 18px; }
}

@media (max-width: 991px) {
  .pc-auth-section { padding: 4rem 1.5rem; }
  .pc-auth-layout { grid-template-columns: minmax(0, 1fr); max-width: 510px; gap: 2.5rem; }
  .pc-auth-intro h2 { font-size: 2.8rem; }
  .pc-auth-intro > p { max-width: 45ch; font-size: 0.95rem; }
  .pc-auth-note { display: none; }
  .pc-auth-section[data-enhanced="true"] .pc-auth-intro { position: relative; width: auto; transform: none; margin-bottom: 2rem; }
  .pc-auth-intro::before { width: min(75%, 260px); }
  .pc-auth-section[data-enhanced="true"][data-open="true"] .pc-auth-intro { display: none; }
  .pc-auth-section[data-enhanced="true"] .pc-auth-flipper { display: grid; gap: 1rem; transform-style: flat; }
  .pc-auth-section[data-enhanced="true"] .pc-auth-leaf { position: relative; left: auto; width: 100%; height: auto; transform-style: flat; transition: none; }
  .pc-auth-section[data-enhanced="true"] .pc-auth-leaf > .pc-auth-paper { position: relative; }
  .pc-auth-section[data-enhanced="true"] .pc-auth-face--login,
  .pc-auth-section[data-enhanced="true"] .pc-auth-face--signup { display: none; position: relative; width: 100%; transform: none; background: var(--auth-paper); }
  .pc-auth-section[data-enhanced="true"] .pc-auth-face--login { display: block; transition: none; }
  .pc-auth-section[data-enhanced="true"][data-open="true"] .pc-auth-face--login { display: none; }
  .pc-auth-section[data-enhanced="true"][data-open="true"] .pc-auth-leaf { transform: none; }
  .pc-auth-section[data-enhanced="true"][data-open="true"] .pc-auth-face--signup { display: block; }
  .pc-auth-section[data-enhanced="true"] .pc-auth-story { display: none; position: relative; width: 100%; }
  .pc-auth-section[data-enhanced="true"][data-open="true"] .pc-auth-story { display: flex; }
  .pc-auth-memories { flex: none; container-type: normal; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: repeat(3, auto); }
  .pc-auth-memory { width: 100%; max-width: 11rem; }
}

@media (max-width: 575px) {
  .pc-auth-section { padding: 3rem 1rem; scroll-margin-top: 135px; }
  .pc-auth-book { scroll-margin-top: 135px; }
  .pc-auth-face { scroll-margin-top: 135px; }
  .pc-auth-intro h2 { font-size: 2.2rem; }
  .pc-auth-paper { padding: 1.4rem; }
  .pc-auth-paper-header { margin-bottom: 1.5rem; }
  .pc-auth-form--signup { grid-template-columns: minmax(0, 1fr); }
  .pc-auth-field input { font-size: 1rem; }
  .pc-auth-options { gap: 0.5rem; }
}

@media (prefers-reduced-motion: reduce) {
  .pc-auth-section[data-enhanced="true"] .pc-auth-leaf,
  .pc-auth-section[data-enhanced="true"] .pc-auth-face--login,
  .pc-auth-section[data-enhanced="true"] .pc-auth-intro { transition: none; }
}
