/* auth.css — login / signup pages and member-only article gate.
   Light-only, aligned with the site design tokens in global.css. */

.auth-shell {
  max-width: 480px;
  margin: 0 auto;
  padding: clamp(2rem, 6vw, 4rem) 1.25rem 4rem;
}

.auth-shell--split {
  width: min(var(--max-w), calc(100% - 48px));
  max-width: 1120px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 430px);
  gap: clamp(2rem, 6vw, 5rem);
  align-items: center;
  padding: clamp(3rem, 7vw, 5.5rem) 0 clamp(4rem, 8vw, 6rem);
}

.auth-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: clamp(1.5rem, 4vw, 2.5rem);
  box-shadow: var(--shadow-md);
  color: var(--text);
}

.auth-shell--split .auth-card {
  width: 100%;
  justify-self: end;
}

.auth-card h1 {
  margin: 0 0 0.5rem;
  color: var(--navy);
  font-size: clamp(1.5rem, 4vw, 2rem);
}

.auth-lead {
  margin: 0 0 1.75rem;
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.6;
}

.auth-form {
  display: grid;
  gap: 1.1rem;
}

.auth-field {
  display: grid;
  gap: 0.4rem;
}

.auth-field label {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text);
}

.auth-field--spaced {
  margin-bottom: 1.1rem;
}

.auth-field input {
  width: 100%;
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  font-size: 1rem;
  font-family: inherit;
  background: var(--white);
  color: var(--text);
}

.auth-field input:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 1px;
  border-color: var(--gold);
}

.auth-submit {
  width: 100%;
  justify-content: center;
}

.auth-submit[disabled] {
  opacity: 0.6;
  cursor: not-allowed;
}

.auth-alt {
  margin-top: 1.5rem;
  font-size: 0.9rem;
  text-align: center;
  color: var(--text-muted);
}

.auth-alt a {
  font-weight: 700;
  color: var(--navy-mid);
  text-decoration: underline;
}

.auth-alt + .auth-alt {
  margin-top: 0.5rem;
}

/* Status / error / success messages (aria-live region). */
.auth-message {
  margin: 0 0 0.25rem;
  padding: 0.75rem 0.9rem;
  border-radius: var(--r-sm);
  font-size: 0.9rem;
  line-height: 1.55;
}

.auth-message[hidden] {
  display: none;
}

.auth-message--error {
  background: #fdecea;
  color: #8a1c12;
  border: 1px solid #f5c2bd;
}

.auth-message--success {
  background: #eaf6ec;
  color: #1c5b28;
  border: 1px solid #bfe0c6;
}

.auth-message--info {
  background: #eef2fb;
  color: #22355f;
  border: 1px solid #c8d5f0;
}

.auth-intro {
  min-width: 0;
}

.auth-intro__copy {
  max-width: 620px;
}

.auth-intro__copy .eyebrow {
  margin-bottom: 0.75rem;
}

.auth-intro__copy h2 {
  margin: 0;
  font-family: var(--font-serif);
  font-size: clamp(2rem, 4.2vw, 3.15rem);
  font-weight: 700;
  line-height: 1.22;
  color: var(--navy);
}

.auth-intro__lead {
  max-width: 35rem;
  margin-top: 1.25rem;
  color: var(--text-muted);
  font-size: 1.02rem;
  line-height: 1.9;
}

.auth-intro__benefits {
  width: min(100%, 620px);
  margin-top: clamp(2rem, 5vw, 3rem);
  padding: clamp(1.25rem, 3vw, 1.75rem);
  border: 1px solid rgba(201, 165, 94, 0.34);
  border-radius: var(--r-lg);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.78), rgba(245, 234, 212, 0.38));
  box-shadow: var(--shadow-sm);
}

.auth-intro__benefits-title {
  margin: 0 0 1.1rem;
  color: var(--navy);
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.5;
}

.auth-intro__features {
  display: grid;
  gap: 1rem;
}

.auth-intro__feature {
  display: grid;
  grid-template-columns: 2.5rem minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
  padding: 1rem;
  border: 1px solid rgba(13, 32, 53, 0.1);
  border-radius: var(--r-md);
  background: rgba(255, 255, 255, 0.68);
}

.auth-intro__feature-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  background: var(--navy);
  color: var(--gold-light);
  font-family: var(--font-mono);
  font-size: 0.76rem;
  font-weight: 700;
  line-height: 1;
}

.auth-intro__feature h3 {
  margin: 0 0 0.25rem;
  color: var(--navy);
  font-size: 1rem;
  line-height: 1.5;
}

.auth-intro__feature p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.92rem;
  line-height: 1.75;
}

/* --- My page (account settings) --- */

.mypage-shell {
  max-width: 920px;
}

/* Hero */
.mypage-hero {
  text-align: center;
  margin-bottom: 2rem;
}

.mypage-hero h1 {
  margin: 0;
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: clamp(2.1rem, 7vw, 2.9rem);
  color: var(--navy);
  line-height: 1.1;
}

/* Card grid */
.mypage-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem;
}

.mypage-card {
  position: relative;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  padding: clamp(1.35rem, 3.5vw, 1.9rem);
  transition: box-shadow 220ms, transform 220ms;
}

.mypage-card:hover {
  box-shadow: var(--shadow-md);
}

.mypage-card--wide {
  grid-column: 1 / -1;
}

.mypage-card-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
}

.mypage-card-heading h2 {
  margin-bottom: 0.75rem;
}

.mypage-text-link {
  flex: 0 0 auto;
  color: var(--navy-mid);
  font-size: 0.86rem;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.mypage-card__label {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 0.5rem;
}

.mypage-card h2 {
  margin: 0 0 1.1rem;
  font-size: 1.2rem;
  color: var(--navy);
}

.mypage-card p.mypage-hint {
  margin: -0.5rem 0 1rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* Account identity */
.mypage-identity {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.mypage-avatar {
  flex: 0 0 auto;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--gold-light), var(--gold));
  color: var(--navy);
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 1.6rem;
  text-transform: uppercase;
  box-shadow: 0 6px 18px rgba(201, 165, 94, 0.3);
}

.mypage-identity__email {
  margin: 0 0 0.35rem;
  font-weight: 700;
  color: var(--text);
  word-break: break-all;
}

.mypage-identity__badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: var(--r-pill);
  background: rgba(201, 165, 94, 0.16);
  color: #7a5f1f;
  border: 1px solid rgba(201, 165, 94, 0.4);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.03em;
}

/* Toggle row */
.mypage-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem 1.1rem;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--cream);
}

.mypage-toggle-label {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
}

.switch {
  position: relative;
  display: inline-flex;
  flex: 0 0 auto;
  width: 52px;
  height: 30px;
}

.switch input {
  position: absolute;
  opacity: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  cursor: pointer;
}

.switch .track {
  flex: 1;
  border-radius: var(--r-pill);
  background: rgba(13, 32, 53, 0.22);
  transition: background 180ms;
}

.switch .thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--white);
  box-shadow: 0 1px 3px rgba(13, 32, 53, 0.35);
  transition: transform 180ms;
}

.switch input:checked ~ .track {
  background: var(--gold);
}

.switch input:checked ~ .thumb {
  transform: translateX(22px);
}

.switch input:focus-visible ~ .track {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

.mypage-actions {
  margin-top: 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.mypage-card--danger {
  background: linear-gradient(180deg, rgba(138, 28, 18, 0.045), rgba(138, 28, 18, 0.01));
  border-color: rgba(138, 28, 18, 0.22);
}

.mypage-card--danger .mypage-card__label,
.mypage-card--danger h2 {
  color: #8a1c12;
}

.mypage-article-list {
  display: grid;
  gap: 0.85rem;
}

.mypage-article-item {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 0.95rem;
  align-items: center;
  padding: 0.75rem;
  border: 1px solid rgba(13, 32, 53, 0.09);
  border-radius: var(--r-md);
  background: rgba(249, 245, 236, 0.44);
}

.mypage-article-thumb {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 96px;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: var(--r-sm);
  background: var(--cream-dark);
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 700;
  text-decoration: none;
}

.mypage-article-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.mypage-article-copy {
  min-width: 0;
}

.mypage-article-title {
  display: block;
  color: var(--navy);
  font-weight: 700;
  line-height: 1.45;
  text-decoration: none;
}

.mypage-article-title:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.mypage-article-meta,
.mypage-article-excerpt {
  margin: 0.25rem 0 0;
  color: var(--text-muted);
  line-height: 1.55;
}

.mypage-article-meta {
  font-size: 0.78rem;
  font-weight: 700;
}

.mypage-article-excerpt {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  font-size: 0.84rem;
}

/* Higher specificity (.button.button-*) so the border wins over `.button { border: none }`
   regardless of stylesheet load order, and a background so it always reads as a button. */
.button.button-ghost {
  background: var(--white);
  border: 1.5px solid rgba(13, 32, 53, 0.25);
  color: var(--text);
}

.button.button-ghost:hover {
  background: var(--cream);
}

.button.button-danger {
  background: var(--white);
  border: 1.5px solid #e0a49d;
  color: #8a1c12;
}

.button.button-danger:hover {
  background: #fdecea;
}

/* --- Member-only article gate --- */

.member-gate {
  margin: 1.5rem 0;
  padding: clamp(1.5rem, 4vw, 2.25rem);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: linear-gradient(180deg, rgba(201, 165, 94, 0.08), rgba(201, 165, 94, 0.02));
  text-align: center;
}

.member-gate__badge {
  display: inline-block;
  margin-bottom: 0.75rem;
  padding: 0.25rem 0.75rem;
  border-radius: var(--r-pill);
  background: var(--gold);
  color: var(--navy);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.member-gate__title {
  margin: 0 0 0.5rem;
  color: var(--navy);
  font-size: clamp(1.15rem, 3vw, 1.4rem);
}

.member-gate__text {
  margin: 0 auto 1.25rem;
  max-width: 34rem;
  color: var(--text-muted);
  line-height: 1.7;
  font-size: 0.95rem;
}

.member-gate__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
}

.member-gate[hidden],
.member-body[hidden] {
  display: none;
}

.member-gate__spinner {
  display: inline-block;
  width: 1.1rem;
  height: 1.1rem;
  border: 2px solid rgba(13, 32, 53, 0.2);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: member-gate-spin 0.7s linear infinite;
  vertical-align: -0.2rem;
  margin-right: 0.4rem;
}

@keyframes member-gate-spin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 900px) {
  .auth-shell--split {
    width: min(var(--max-w), calc(100% - 32px));
    grid-template-columns: minmax(0, 1fr);
    gap: 2.5rem;
    padding-top: 2.5rem;
  }

  .auth-shell--split .auth-card {
    max-width: 480px;
    justify-self: center;
  }

  .auth-intro {
    display: grid;
    justify-items: center;
    text-align: center;
  }

  .auth-intro__lead {
    margin-inline: auto;
  }

  .auth-intro__benefits {
    max-width: 620px;
  }
}

@media (max-width: 640px) {
  .auth-shell--split {
    width: calc(100% - 24px);
    gap: 2rem;
    padding-top: 2rem;
  }

  .auth-intro__copy h2 {
    font-size: clamp(1.8rem, 9vw, 2.35rem);
  }

  .auth-intro__lead {
    font-size: 0.94rem;
    line-height: 1.75;
  }

  .auth-intro__features {
    gap: 1rem;
    text-align: left;
  }

  .auth-intro__feature {
    grid-template-columns: 2.25rem minmax(0, 1fr);
    gap: 0.85rem;
    padding: 0.9rem;
  }

  .auth-intro__feature-label {
    width: 2.25rem;
    height: 2.25rem;
  }

  .mypage-grid {
    grid-template-columns: 1fr;
  }

  .mypage-card-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.25rem;
  }

  .mypage-article-item {
    grid-template-columns: 78px minmax(0, 1fr);
    padding: 0.65rem;
  }

  .mypage-article-thumb {
    width: 78px;
  }
}
