@layer pages {
.auth-body {
  display: flex;
  flex: 1;
  align-items: center;
  justify-content: center;
}

.auth-content {
  position: relative;
  width: 100%;
  min-width: 0;
  max-width: 440px;
}

.auth-feedback {
  display: grid;
  padding-bottom: 16px;
  align-content: end;
  gap: 8px;
}

.auth-feedback:empty {
  display: none;
}

.auth-feedback > .form-error,
.auth-feedback > .form-notice,
.auth-feedback > .email-code-notice {
  position: static;
  margin: 0;
}

.auth-content-wide {
  max-width: 720px;
}

.social-login {
  display: grid;
  gap: 10px;
}

.auth-button {
  display: block;
  width: 100%;
  min-height: 40px;
  padding: 8px 12px;
  border: 1px solid var(--border-strong);
  border-radius: 4px;
  background: var(--surface-raised);
  color: var(--text);
  font: inherit;
  font-weight: 600;
  text-align: center;
  cursor: pointer;
}

.auth-button:hover {
  background: var(--accent-soft);
  color: var(--accent);
}

/* Keep Google's official light treatment in both site themes. Its dark fill is
   almost indistinguishable from this site's dark surface and looks transparent. */
.provider-google,
.identity-provider-logo-google {
  --provider-fill: #fff;
  --provider-stroke: #747775;
  --provider-label: #1f1f1f;
  --provider-state: rgba(31, 31, 31, 0.08);
}

.provider-naver,
.identity-provider-logo-naver {
  --provider-fill: #03a94d;
  --provider-stroke: #03a94d;
  --provider-label: #fff;
  --provider-state: rgba(0, 0, 0, 0.08);
}

.provider-kakao,
.identity-provider-logo-kakao {
  --provider-fill: #fee500;
  --provider-stroke: #fee500;
  --provider-label: rgba(0, 0, 0, 0.85);
  --provider-symbol: #000;
  --provider-state: rgba(0, 0, 0, 0.08);
}

.provider-button {
  display: flex;
  align-items: center;
  justify-content: center;
  /* Naver requires 8px between a centred logo and label. Google and Kakao both
     allow the same centred arrangement; 8px keeps the three buttons aligned. */
  gap: 8px;
  border-color: var(--provider-stroke);
  background: var(--provider-fill);
  color: var(--provider-label);
  text-decoration: none;
}

.provider-button:hover {
  /* A state layer keeps each provider's designated colours unchanged while still
     giving the button a hover affordance. */
  border-color: var(--provider-stroke);
  background: var(--provider-fill);
  box-shadow: inset 0 0 0 999px var(--provider-state);
  color: var(--provider-label);
}

.provider-logo {
  color: var(--provider-symbol, currentColor);
  object-fit: contain;
}

/* Google's standard button uses an 18px G. Kakao's speech bubble sits in the
   same 18px box so its official path and padding stay intact. Naver's full
   button type specifies a 16px N. */
.provider-logo-google,
.provider-logo-kakao {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
}

.provider-logo-naver {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
}

.auth-separator {
  display: flex;
  margin: 16px 0;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 13px;
}

.auth-separator::before,
.auth-separator::after {
  height: 1px;
  flex: 1;
  background: var(--border);
  content: "";
}

.auth-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 9px;
}

.auth-form label {
  font-weight: 600;
}

.auth-form input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]) {
  width: 100%;
  min-width: 0;
  min-height: 40px;
  padding: 7px 10px;
  border: 1px solid var(--border-strong);
  border-radius: 4px;
  background: var(--input);
  color: var(--text);
  font: inherit;
}

.auth-form .auth-button {
  margin-top: 4px;
}

.account-setup-form {
  gap: 16px;
}

.auth-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 7px;
}

.password-input {
  position: relative;
}

.auth-form .password-input input {
  padding-right: 44px;
}

.password-visibility {
  position: absolute;
  inset-block: 0;
  right: 0;
  display: grid;
  width: 42px;
  padding: 0;
  place-items: center;
  border: 0;
  border-left: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.password-visibility:hover {
  color: var(--text);
}

.password-visibility svg {
  display: block;
  width: 18px;
  height: 18px;
}

.password-visibility-hide,
.password-visibility[aria-pressed="true"] .password-visibility-show {
  display: none;
}

.password-visibility[aria-pressed="true"] .password-visibility-hide {
  display: block;
}

.field-status {
  min-height: 20px;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

span.field-help-enhanced {
  display: block;
}

.field-help-motion {
  box-sizing: border-box;
  min-height: 0;
  overflow: hidden;
}

.field-status[data-state="pending"]::before {
  display: inline-block;
  box-sizing: border-box;
  width: 12px;
  height: 12px;
  margin-right: 7px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  vertical-align: -1px;
  animation: field-status-spin 0.65s linear infinite;
  content: "";
}

.field-status[data-state="success"] {
  color: #5ebd83;
}

.field-status[data-state="success"]::before {
  display: inline-block;
  width: 14px;
  height: 14px;
  margin-right: 5px;
  vertical-align: -2px;
  content: "";
  background-color: currentColor;
  -webkit-mask: var(--icon-check) center / contain no-repeat;
  mask: var(--icon-check) center / contain no-repeat;
}

.field-status[data-state="error"] {
  color: #e36b6b;
}

.field-status[data-state="error"]::before {
  display: inline-block;
  width: 14px;
  height: 14px;
  margin-right: 5px;
  vertical-align: -2px;
  content: "";
  background-color: currentColor;
  -webkit-mask: var(--icon-x) center / contain no-repeat;
  mask: var(--icon-x) center / contain no-repeat;
}

@keyframes field-status-spin {
  to {
    transform: rotate(360deg);
  }
}

.auth-form input[aria-invalid="true"] {
  border-color: #b84b4b;
}

.password-requirements {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px 16px;
  margin: 0;
  padding: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
  list-style: none;
}

.password-requirements li::before {
  display: inline-block;
  width: 14px;
  height: 14px;
  margin-right: 4px;
  vertical-align: -2px;
  content: "";
  background-color: currentColor;
  -webkit-mask: var(--icon-circle) center / contain no-repeat;
  mask: var(--icon-circle) center / contain no-repeat;
}

.password-requirements li.is-valid {
  color: #5ebd83;
}

.password-requirements li.is-valid::before {
  -webkit-mask-image: var(--icon-check);
  mask-image: var(--icon-check);
}

.password-requirements li[data-state="pending"]::before {
  box-sizing: border-box;
  width: 12px;
  height: 12px;
  margin-right: 6px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  vertical-align: -1px;
  animation: field-status-spin 0.65s linear infinite;
  content: "";
  -webkit-mask: none;
  mask: none;
  background: transparent;
}

.password-requirements li[data-state="compromised"] {
  color: #e36b6b;
}

.password-requirements li[data-state="compromised"]::before {
  -webkit-mask-image: var(--icon-x);
  mask-image: var(--icon-x);
}

.password-requirements li[data-state="unavailable"]::before {
  -webkit-mask-image: var(--icon-warning);
  mask-image: var(--icon-warning);
}

.email-code-intro {
  margin: 0 0 22px;
  text-align: center;
}

.email-code-notice {
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.email-code-intro p {
  margin: 0;
  line-height: 1.55;
}

.email-code-intro strong {
  overflow-wrap: anywhere;
}

.email-code-intro p + p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 13px;
}

.email-code-form {
  gap: 12px;
}

.email-code-fieldset {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.email-code-fields {
  display: grid;
  width: min(100%, 360px);
  margin: 0 auto;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
}

.auth-form .email-code-digit {
  min-width: 0;
  height: 54px;
  min-height: 54px;
  padding: 0;
  border-color: var(--border-strong);
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 23px;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  text-align: center;
}

.auth-form .email-code-digit:focus {
  border-color: var(--muted);
  outline: 1px solid var(--muted);
  outline-offset: 1px;
}

.email-code-resend {
  display: flex;
  margin-top: 17px;
  align-items: baseline;
  justify-content: center;
  flex-wrap: wrap;
  gap: 3px 7px;
  color: var(--muted);
  font-size: 13px;
}

.email-code-resend p {
  margin: 0;
}

.email-code-resend form {
  margin: 0;
}

.email-code-resend-button {
  padding: 0;
  font-size: 13px;
  font-weight: 600;
}

.email-code-resend-button:disabled {
  color: var(--muted);
  cursor: default;
  opacity: 0.8;
}

.auth-button:disabled,
.auth-button:disabled:hover {
  border-color: var(--border-strong);
  background: var(--surface-raised);
  color: var(--muted);
  cursor: not-allowed;
  opacity: 0.72;
}

.auth-links {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 5px;
  font-size: 14px;
}

.auth-links:has(> a:only-child) {
  justify-content: flex-start;
}

.form-notice {
  margin: 0 0 16px;
  padding: 10px 12px;
  border-left: 3px solid var(--accent);
  background: var(--accent-soft);
  color: var(--text);
}

.cf-turnstile {
  width: fit-content;
  max-width: 100%;
  min-height: 65px;
  margin: 4px auto;
  justify-self: center;
  line-height: 0;
}

.cf-turnstile > div {
  /* The hosted widget paints an uneven bright edge inside its closed frame.
     Trim the border and its antialiasing, without fixing the challenge's height or
     touching its controls. Remove when the upstream border is corrected. */
  clip-path: inset(2px round 2px);
}

.cf-turnstile:focus-within {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

@media (max-height: 800px) {
  .content-frame:has(> .auth-body > .auth-content:not(.auth-content-wide)) > .document-header {
    min-height: 76px;
    padding-block: 16px;
  }

  .auth-body:has(> .auth-content:not(.auth-content-wide)) {
    padding-block: 16px;
  }
}

.settings-section h2 {
  margin: 0 0 12px;
  font-size: 18px;
}

.settings-section-separated {
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.profile-settings-form {
  gap: 10px;
}

.profile-avatar-setting {
  display: flex;
  margin-bottom: 4px;
  align-items: center;
  gap: 16px;
}

.profile-avatar-setting > img {
  width: 72px;
  height: 72px;
  flex: 0 0 auto;
  border: 1px solid var(--border-strong);
  object-fit: cover;
}

.profile-avatar-setting > div {
  display: grid;
  min-width: 0;
  gap: 6px;
}

.profile-avatar-setting input[type="file"] {
  min-height: 0;
  padding: 6px;
}

.registration-avatar-setting {
  margin-bottom: 0;
  justify-content: center;
}

.registration-avatar-setting > img {
  transform: translateY(-2px);
}

.registration-avatar-setting .field-status:empty {
  display: none;
}

.registration-policy-agreement {
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr);
  align-items: start;
  gap: 8px;
  font-size: 13px;
  line-height: 1.55;
}

.auth-form .registration-policy-agreement input {
  width: 16px;
  height: 16px;
  min-height: 0;
  margin: 2px 0 0;
  padding: 0;
  accent-color: var(--accent);
}

.auth-form .registration-policy-agreement label {
  font-weight: 400;
}

.field-hint {
  color: var(--muted);
  font-size: 13px;
}

.auth-form .setting-check {
  display: flex;
  width: fit-content;
  align-items: center;
  gap: 8px;
  font-weight: 400;
}

.auth-form .setting-check input {
  width: auto;
  min-height: 0;
  margin: 0;
}

.auth-form .settings-save {
  width: auto;
  min-width: 88px;
  justify-self: end;
}

.identity-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.identity-list li {
  display: flex;
  min-height: 46px;
  padding: 10px 0;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--border);
}

.identity-list li:last-child {
  border-bottom: 0;
}

.identity-provider {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

/* Connected accounts are listed, not signed into, so each provider mark is shown
   at icon size against a 26px circle. Google's G and Kakao's bubble keep the
   same 18px-to-40px ratio as the buttons; Naver's N stays near 38% of the disc. */
.identity-provider-logo {
  display: inline-grid;
  width: 26px;
  height: 26px;
  flex: 0 0 26px;
  place-items: center;
  border: 1px solid var(--provider-stroke);
  border-radius: 50%;
  background: var(--provider-fill);
  color: var(--provider-label);
}

.identity-provider-logo .provider-logo {
  display: block;
}

.identity-provider-logo .provider-logo-google,
.identity-provider-logo .provider-logo-kakao {
  width: 12px;
  height: 12px;
}

.identity-provider-logo .provider-logo-naver {
  width: 10px;
  height: 10px;
}

.identity-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.identity-actions form {
  margin: 0;
}

.identity-actions .text-button {
  padding-right: 0;
}

.settings-sessions {
  margin: 0;
  padding: 0;
  list-style: none;
}

.settings-session {
  padding: 14px 0;
  border-top: 1px solid var(--border);
}

.settings-session-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.settings-session-heading form {
  margin: 0;
}

.settings-session-details {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 16px;
  margin: 10px 0 0;
}

.settings-session-details > div {
  min-width: 0;
}

.settings-session-details dt {
  color: var(--muted);
  font-size: 12px;
}

.settings-session-details dd {
  margin: 2px 0 0;
  overflow-wrap: anywhere;
}

.settings-session-details time {
  white-space: normal;
}

.settings-section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.settings-section-heading .field-hint {
  margin: -4px 0 12px;
}

.settings-section-heading form {
  margin: 0;
}

.identity-state {
  color: var(--muted);
  font-size: 13px;
}

.identity-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}

.identity-status-complete {
  color: #48b875;
}

.account-withdrawal-summary p,
.account-withdrawal-content p {
  line-height: 1.65;
}

.account-withdrawal-content h2 {
  margin: 0 0 16px;
  font-size: 20px;
}

.withdrawal-details {
  margin: 14px 0 18px;
  padding-left: 22px;
  line-height: 1.8;
}

.withdrawal-actions {
  display: grid;
  gap: 10px;
  margin-top: 22px;
}

.withdrawal-actions > a:last-child {
  justify-self: center;
}

.withdrawal-acknowledgement {
  margin: 8px 0 4px;
  line-height: 1.55;
}

.danger-text-link {
  color: #e5484d;
}

.danger-button {
  border-color: #c9343a;
  background: #c9343a;
  color: #fff;
}

.danger-button:hover {
  border-color: #e5484d;
  background: #e5484d;
}

.danger-outline-button {
  border-color: #c9343a;
  background: transparent;
  color: #e5484d;
}

.danger-outline-button:hover {
  border-color: #e5484d;
  background: rgba(229, 72, 77, 0.1);
  color: #f2555a;
}

:root[data-theme="light"] .field-status[data-state="success"],
:root[data-theme="light"] .password-requirements li.is-valid,
:root[data-theme="light"] .identity-status-complete {
  color: #237a43;
}

:root[data-theme="light"] .field-status[data-state="error"] {
  color: #b3262d;
}

:root[data-theme="light"] .password-requirements li[data-state="compromised"] {
  color: #b3262d;
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme]) .field-status[data-state="success"],
  :root:not([data-theme]) .password-requirements li.is-valid,
  :root:not([data-theme]) .identity-status-complete {
    color: #237a43;
  }

  :root:not([data-theme]) .field-status[data-state="error"] {
    color: #b3262d;
  }

  :root:not([data-theme]) .password-requirements li[data-state="compromised"] {
    color: #b3262d;
  }
}

@media (prefers-reduced-motion: reduce) {
  .field-status[data-state="pending"]::before,
  .password-requirements li[data-state="pending"]::before {
    animation: none;
  }
}

@media (max-width: 420px) {
  .auth-links {
    flex-direction: column;
    gap: 8px;
  }

  .identity-list li,
  .identity-actions {
    align-items: flex-start;
    flex-direction: column;
  }

  .settings-section-heading {
    flex-direction: column;
  }

  .settings-section-heading {
    gap: 4px;
  }

  .profile-avatar-setting {
    align-items: flex-start;
  }
}
}
