:root {
  --paper: #fbfaf7;
  --ink: #111110;
  --muted: #746f67;
  --line: #bdb7ae;
  --soft-line: #ded8cf;
  --accent: #bd5537;
  --success: #4e6b55;
  --error: #a13d2d;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--paper);
}

body {
  min-height: 100vh;
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Helvetica Neue", Arial, "Pretendard", "Noto Sans KR", sans-serif;
  letter-spacing: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select {
  font: inherit;
}

button,
a,
label {
  -webkit-tap-highlight-color: transparent;
}

[hidden] {
  display: none !important;
}

.site-header {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 74px;
  padding: 0 32px;
}

.wordmark {
  font-family: "Bodoni 72", Didot, "Bodoni MT", "Times New Roman", serif;
  font-size: 37px;
  line-height: 1;
  letter-spacing: -0.02em;
}

.back-link {
  padding-bottom: 4px;
  border-bottom: 1px solid var(--ink);
  font-size: 12px;
}

.edit-page {
  position: relative;
  min-height: calc(100vh - 74px);
  padding: 58px 24px 80px;
}

.edit-panel {
  width: min(620px, 100%);
  margin: 0 auto;
}

.edit-heading {
  text-align: center;
}

.edit-heading > p {
  margin: 0;
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.edit-heading h1 {
  margin: 16px 0 0;
  font-family: Georgia, "Noto Serif KR", "Times New Roman", serif;
  font-size: 39px;
  line-height: 1.15;
  font-weight: 400;
}

.edit-heading > span {
  display: block;
  margin-top: 13px;
  color: var(--muted);
  font-size: 11px;
}

.page-marker {
  position: absolute;
  top: 41px;
  right: clamp(26px, 4vw, 64px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 10px;
  writing-mode: vertical-rl;
}

.page-marker i {
  width: 1px;
  height: 65px;
  background: var(--line);
}

form {
  margin-top: 52px;
}

.form-section {
  padding: 0 0 41px;
  border-top: 1px solid var(--ink);
}

.section-heading {
  display: flex;
  align-items: baseline;
  gap: 18px;
  margin: 17px 0 31px;
}

.section-heading span {
  color: var(--accent);
  font-size: 10px;
  font-weight: 700;
}

.section-heading h2 {
  margin: 0;
  font-family: Georgia, "Noto Serif KR", serif;
  font-size: 21px;
  font-weight: 400;
}

.field {
  margin-bottom: 27px;
}

.field > label,
.identity-type legend {
  display: block;
  margin-bottom: 8px;
  font-size: 12px;
  font-weight: 500;
}

.inline-field-label {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.inline-field-label small {
  color: var(--muted);
  font-size: 10px;
  font-weight: 400;
}

.inline-field-label small span {
  margin-left: 4px;
}

.line-control {
  position: relative;
  min-height: 44px;
  border-bottom: 1px solid #89847d;
}

.line-control input {
  width: 100%;
  height: 43px;
  padding: 0 2px;
  border: 0;
  border-radius: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-size: 14px;
}

.line-control input::placeholder {
  color: #a6a097;
}

.line-control:focus-within {
  border-bottom-color: var(--ink);
}

.line-control.invalid {
  border-bottom-color: var(--error);
}

.line-control.invalid input {
  color: var(--error);
}

.line-control.valid {
  border-bottom-color: var(--success);
}

.action-control {
  padding-right: 128px;
}

.outline-button {
  position: absolute;
  right: 0;
  bottom: 0;
  display: grid;
  place-items: center;
  min-width: 114px;
  height: 38px;
  padding: 0 13px;
  border: 1px solid var(--ink);
  border-radius: 0;
  background: var(--paper);
  color: var(--ink);
  cursor: pointer;
  font-size: 12px;
  white-space: nowrap;
}

.outline-button:hover:not(:disabled) {
  background: var(--ink);
  color: #fff;
}

button:disabled {
  cursor: default;
  opacity: 0.38;
}

.verification-code {
  display: none;
}

.verification-code.visible {
  display: block;
}

.code-control {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 52px 114px 54px;
  gap: 13px;
  align-items: end;
}

.code-control input {
  height: 43px;
  padding: 0 2px;
  border: 0;
  border-bottom: 1px solid #89847d;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-size: 14px;
}

.code-control .outline-button,
.code-control .text-button {
  position: static;
}

.timer {
  align-self: center;
  color: var(--accent);
  font-size: 12px;
  text-align: center;
}

.text-button {
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 11px;
  text-decoration: underline;
  text-underline-offset: 3px;
  white-space: nowrap;
}

.birth-selects {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.birth-picker {
  position: relative;
}

.birth-native {
  position: absolute;
  inset: 0;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.birth-picker-button {
  width: 100%;
  height: 44px;
  padding: 0 12px;
  border: 1px solid var(--soft-line);
  border-radius: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  font-size: 13px;
  text-align: left;
}

.birth-picker-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.birth-picker-button::after {
  width: 7px;
  height: 7px;
  border-right: 1px solid var(--muted);
  border-bottom: 1px solid var(--muted);
  content: "";
  transform: rotate(45deg) translateY(-2px);
  transition: transform 180ms ease;
}

.birth-picker-button:focus,
.birth-picker.is-open .birth-picker-button {
  border-color: var(--ink);
}

.birth-picker.is-open .birth-picker-button::after {
  transform: rotate(225deg) translate(-2px, -1px);
}

.birth-picker-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  left: 0;
  z-index: 20;
  max-height: 184px;
  overflow-y: auto;
  border: 1px solid var(--ink);
  background: var(--paper);
  box-shadow: 0 16px 34px rgba(17, 17, 16, 0.12);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-8px);
  transition:
    opacity 190ms ease,
    transform 190ms ease,
    visibility 190ms ease;
  visibility: hidden;
}

.birth-picker.is-open .birth-picker-menu {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
  visibility: visible;
}

.birth-picker-option {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 36px;
  padding: 0 12px;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 12px;
  text-align: left;
}

.birth-picker-option:hover,
.birth-picker-option.is-selected {
  background: #f0ede7;
  color: var(--ink);
}

.birth-picker-option.is-selected {
  color: var(--accent);
}

.password-control {
  padding-right: 45px;
}

.password-toggle {
  position: absolute;
  right: 0;
  bottom: 8px;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.password-toggle:hover,
.password-toggle:focus-visible {
  color: var(--ink);
}

.password-toggle:focus-visible {
  outline: 1px solid var(--ink);
  outline-offset: 2px;
}

.eye-icon {
  width: 20px;
  height: 20px;
}

.eye-slash.is-hidden {
  display: none;
}

.message {
  min-height: 15px;
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.5;
}

.message:empty {
  min-height: 0;
  margin-top: 0;
}

.message.error,
.form-message.error {
  color: var(--error);
}

.message.success,
.form-message.success {
  color: var(--success);
}

.identity-type {
  margin: 0 0 24px;
  padding: 0;
  border: 0;
}

.identity-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  border-bottom: 1px solid var(--line);
}

.identity-options.is-single {
  grid-template-columns: 1fr;
}

.identity-options label {
  cursor: pointer;
}

.identity-options label[hidden] {
  display: none;
}

.identity-options input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.identity-options span {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  height: 45px;
  color: var(--muted);
  font-size: 12px;
}

.identity-options span i {
  width: 15px;
  height: 15px;
  border: 1px solid var(--ink);
  border-radius: 50%;
}

.identity-options input:checked + span {
  color: var(--ink);
}

.identity-options input:checked + span i {
  border: 4px solid var(--paper);
  background: var(--accent);
  outline: 1px solid var(--accent);
}

.locked-identity-section .line-control input[readonly] {
  cursor: default;
}

.locked-identity-section .line-control:focus-within {
  border-bottom-color: #89847d;
}

.locked-identity-section .identity-options label,
.locked-identity-section .birth-picker-button,
.locked-identity-section .upload-box {
  cursor: default;
}

.locked-identity-section .identity-options input:disabled + span,
.locked-identity-section .birth-picker-button:disabled {
  opacity: 1;
}

.locked-identity-section .birth-picker-button:disabled {
  color: var(--ink);
}

.locked-identity-section .identity-options.is-single span {
  justify-content: flex-start;
  gap: 0;
  padding: 0 2px;
}

.locked-identity-section .identity-options.is-single span i {
  display: none;
}

.locked-identity-section .upload-box:hover {
  border-color: #cfc8bd;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.7), rgba(243, 241, 236, 0.8)),
    #f3f1ec;
}

.grade-select {
  z-index: 4;
}

.grade-select-button {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  height: 43px;
  padding: 0 28px 0 2px;
  border: 0;
  background: transparent;
  color: #a6a097;
  cursor: pointer;
  font-size: 14px;
  text-align: left;
}

.grade-select-button::after {
  position: absolute;
  top: 16px;
  right: 2px;
  width: 7px;
  height: 7px;
  border-right: 1px solid var(--muted);
  border-bottom: 1px solid var(--muted);
  content: "";
  transform: rotate(45deg);
  transition: transform 180ms ease;
}

.grade-select.is-open .grade-select-button::after {
  transform: translateY(4px) rotate(225deg);
}

.grade-select.has-value .grade-select-button {
  color: var(--ink);
}

.grade-select-options {
  position: absolute;
  z-index: 8;
  top: calc(100% + 8px);
  right: 0;
  left: 0;
  overflow: hidden;
  max-height: 0;
  border: 1px solid var(--soft-line);
  background: #fffefa;
  box-shadow: 0 18px 36px rgba(34, 30, 25, 0.08);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-10px);
  transition:
    max-height 320ms cubic-bezier(0.22, 1, 0.36, 1),
    opacity 200ms ease,
    transform 280ms cubic-bezier(0.22, 1, 0.36, 1);
}

.grade-select.is-open .grade-select-options {
  max-height: 250px;
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.grade-option {
  display: block;
  width: 100%;
  height: 42px;
  padding: 0 14px;
  border: 0;
  border-bottom: 1px solid #eee8df;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  font-size: 13px;
  text-align: left;
}

.grade-option:last-child {
  border-bottom: 0;
}

.grade-option:hover,
.grade-option.is-selected {
  background: #f4f0ea;
  color: var(--accent);
}

.personal-fields {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  margin-bottom: 8px;
}

.identity-upload {
  position: relative;
}

.upload-copy-head {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 5px;
}

.upload-copy strong {
  font-size: 13px;
  font-weight: 500;
}

.identity-guide-toggle {
  display: inline-grid;
  flex: 0 0 auto;
  place-items: center;
  width: 20px;
  height: 20px;
  border: 0;
  background: transparent;
  color: #8a8278;
  cursor: pointer;
  padding: 0;
  transition:
    color 180ms ease,
    transform 180ms ease;
}

.identity-guide-toggle:hover {
  color: #6d655d;
}

.guide-icon {
  display: block;
  width: 20px;
  height: 20px;
  overflow: visible;
  stroke: currentColor;
  stroke-width: 2.1;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.guide-icon-chevron {
  transform-origin: 12px 12px;
  transition: transform 180ms ease;
}

.identity-guide-toggle.is-open .guide-icon-chevron {
  transform: rotate(180deg);
}

.identity-guide-panel {
  position: absolute;
  z-index: 5;
  top: 43px;
  right: 0;
  left: 0;
  margin: 0;
  overflow: hidden;
  border: 1px solid #d8d2c9;
  border-radius: 24px;
  background: #fffefa;
  box-shadow: 0 18px 45px rgba(34, 30, 25, 0.1);
}

.identity-guide-panel::before,
.identity-guide-panel::after {
  position: absolute;
  left: 112px;
  width: 22px;
  height: 22px;
  content: "";
  transform: translateY(-50%) rotate(45deg);
}

.identity-guide-panel::before {
  top: 0;
  border-top: 1px solid #d8d2c9;
  border-left: 1px solid #d8d2c9;
  background: #fffefa;
}

.identity-guide-panel::after {
  top: 1px;
  background: #fffefa;
}

.identity-guide-panel:not([hidden]) {
  animation: guidePanelOpen 180ms ease both;
}

.identity-guide-page {
  position: relative;
  z-index: 1;
  min-height: 255px;
  max-height: 360px;
  overflow-y: auto;
  padding: 28px 24px 24px;
}

@keyframes guidePanelOpen {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.upload-copy p {
  margin: 7px 0 15px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.6;
}

.upload-box {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  min-height: 188px;
  overflow: hidden;
  border: 1px solid #cfc8bd;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.7), rgba(243, 241, 236, 0.8)),
    #f3f1ec;
  cursor: pointer;
  transition:
    border-color 180ms ease,
    background 180ms ease;
}

.upload-box:hover {
  border-color: var(--ink);
  background: #f8f6f1;
}

.upload-box img {
  display: block;
  width: 100%;
  height: 220px;
  object-fit: contain;
  background: #efede7;
}

.upload-box img[hidden] {
  display: none;
}

.upload-empty {
  display: grid;
  place-items: center;
  min-height: 188px;
  padding: 28px 20px;
  color: var(--muted);
  text-align: center;
}

.upload-empty span {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid #a99f92;
  border-radius: 50%;
  color: var(--ink);
  font-family: Georgia, serif;
  font-size: 30px;
  font-weight: 300;
  line-height: 1;
}

.upload-empty strong {
  margin-top: 15px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 500;
}

.upload-empty p {
  margin: 6px 0 0;
  font-size: 10px;
}

.upload-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 13px;
}

#identity-image {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
}

.file-button {
  display: grid;
  place-items: center;
  min-width: 104px;
  height: 40px;
  padding: 0 16px;
  border: 1px solid var(--ink);
  cursor: pointer;
  font-size: 11px;
}

.file-button:hover {
  background: var(--ink);
  color: #fff;
}

.remove-image {
  padding: 5px 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 11px;
  text-decoration: underline;
  text-underline-offset: 3px;
}

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

.form-actions a,
.form-actions button {
  display: flex;
  align-items: center;
  height: 55px;
  padding: 0 20px;
  border: 1px solid var(--ink);
  border-radius: 0;
  cursor: pointer;
  font-size: 13px;
}

.form-actions a {
  justify-content: center;
}

.form-actions button {
  justify-content: space-between;
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.form-actions button span {
  font-size: 25px;
}

.form-message {
  min-height: 17px;
  margin: 10px 0 0;
  font-size: 11px;
  text-align: center;
}

.account-danger-zone {
  margin-top: 34px;
  padding-top: 23px;
  border-top: 1px solid var(--soft-line);
  text-align: center;
}

.account-danger-zone > span {
  display: block;
  color: var(--muted);
  font-size: 10px;
}

.delete-account-link {
  display: inline-flex;
  margin-top: 12px;
  padding-bottom: 3px;
  border-bottom: 1px solid rgba(161, 61, 45, 0.55);
  color: var(--error);
  font-size: 12px;
  font-weight: 700;
}

.delete-account-link:hover {
  border-bottom-color: var(--error);
}

.account-danger-zone p {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.6;
}

@media (max-width: 720px) {
  .page-marker {
    display: none;
  }
}

@media (max-width: 560px) {
  .site-header {
    height: 64px;
    padding: 0 18px;
  }

  .wordmark {
    font-size: 30px;
  }

  .edit-page {
    min-height: calc(100vh - 64px);
    padding: 38px 20px 58px;
  }

  .edit-heading h1 {
    font-size: 34px;
  }

  form {
    margin-top: 43px;
  }

  .identity-options {
    gap: 4px;
  }

  .identity-options span {
    gap: 7px;
  }

  .personal-fields {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .upload-box {
    min-height: 172px;
  }

  .upload-box img {
    height: 190px;
  }

  .form-actions {
    grid-template-columns: 1fr;
  }
}
