/* 그란데클립 메일 서명 만들기 — 단일 화면 스타일 */

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: #FAFAF8;
  font-family: "Pretendard Variable", "Pretendard", -apple-system, sans-serif;
  color: #0A0A0A;
  -webkit-font-smoothing: antialiased;
}

.page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 16px;
}

.card {
  width: 100%;
  max-width: 560px;
  background: #fff;
  border-radius: 16px;
  padding: 36px 36px 32px;
  box-shadow: 0 2px 24px rgba(0,0,0,0.05);
}

/* 제목 줄: 좌측 제목 + 우측 '정보 다시 입력하기'(매칭 시에만) */
.card-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 28px;
}

.title {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0;
}

.reset-link {
  font-size: 12px;
  color: #999;
  text-decoration: underline;
  white-space: nowrap;
}
.reset-link:hover { color: #2A2A2A; }

/* 로그인(본인 확인) 화면 */
.login-head { margin-bottom: 24px; }
.login-title {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.login-sub {
  margin-top: 8px;
  font-size: 13px;
  color: #888;
  line-height: 1.5;
}
/* 로그인 카드의 본인 확인 버튼: 폼 아래 전체폭 */
.login-head ~ .btn-primary { width: 100%; margin-top: 8px; }

/* 모달 내 접이식 섹션 토글 (주소·연결 링크 등 부가 항목). 텍스트 버튼 + 셰브론. */
.section-toggle {
  margin-top: 4px;
  padding: 0;
  border: 0;
  background: none;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  color: #5A5A5A;
  cursor: pointer;
}
.section-toggle:hover { color: #0A0A0A; }
.section-fields { margin-top: 12px; }

.subtitle {
  font-size: 13px;
  color: #7A7A7A;
  margin: 0 0 24px;
  line-height: 1.6;
}

.form-row {
  margin-bottom: 14px;
}

.form-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: #2A2A2A;
  margin-bottom: 6px;
  letter-spacing: -0.01em;
}

.form-input {
  width: 100%;
  padding: 12px 14px;
  font-size: 14px;
  font-family: inherit;
  border: 1px solid #E0E0DC;
  border-radius: 8px;
  background: #fff;
  color: #0A0A0A;
  outline: none;
  transition: border-color 0.15s;
}

.form-input:focus {
  border-color: #0A0A0A;
}

.form-input::placeholder {
  color: #B8B8B8;
}

/* 접두/접미가 붙는 입력 — 전화 "+82 10", 이메일 "@bongnsul.com". 테두리는 래퍼에 줘서 한 입력처럼 보이게. */
.input-affix {
  display: flex;
  align-items: center;
  border: 1px solid #E0E0DC;
  border-radius: 8px;
  background: #fff;
  transition: border-color 0.15s;
}
.input-affix:focus-within { border-color: #0A0A0A; }
.input-affix .form-input { border: none; flex: 1 1 auto; min-width: 0; }
.input-affix .affix { flex: 0 0 auto; color: #0A0A0A; font-size: 14px; white-space: nowrap; }  /* +82 10 / @bongnsul.com — 입력값처럼 진하게 */
.input-affix .affix-prefix { padding-left: 14px; }
.input-affix .affix-prefix + .form-input { padding-left: 8px; }
.input-affix .affix-suffix { padding-right: 14px; }
.input-affix .form-input:not(:last-child) { padding-right: 2px; }  /* 뒤에 접미(@도메인)가 붙는 경우 */
.input-affix .email-local { flex: 0 1 auto; min-width: 3ch; }      /* 아이디 길이만큼만 차지 → @도메인이 바로 옆에 붙음 */
/* 전화: 접두(+82 10, 검정 실제값) + 가입자(8자리, 비면 회색 0000 0000). 한 번호처럼 붙여서. */
.input-affix .phone-prefix { flex: 0 0 auto; width: auto; padding-right: 0; }
.input-affix .phone-sub { flex: 1 1 auto; padding-left: 6px; }

.radio-group {
  display: flex;
  gap: 6px;
  flex-wrap: nowrap;
}

.radio-chip {
  display: inline-flex;
  align-items: center;
  padding: 9px 12px;
  border: 1px solid #E0E0DC;
  border-radius: 999px;
  background: #fff;
  font-size: 13px;
  font-weight: 500;
  color: #2A2A2A;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
  user-select: none;
  white-space: nowrap;
}

.radio-chip:hover { border-color: #2A2A2A; }

.radio-chip input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  width: 0;
  height: 0;
}

.radio-chip.is-selected {
  border-color: #0A0A0A;
  background: #0A0A0A;
  color: #fff;
}

.error {
  font-size: 12px;
  color: #C0392B;
  margin: 8px 0 0;
}

.divider {
  height: 1px;
  background: #EFEEEA;
  margin: 24px 0 20px;
}

/* 이름 / 영문명처럼 한 줄에 두 input을 나란히 두는 컨테이너 */
.form-row-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 14px;
}

.form-row-pair .form-row { margin-bottom: 0; }

/* 라벨 텍스트 우측에 콘텐츠(라디오 칩 등)를 한 줄로 두는 변형 */
.form-row-inline {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.form-row-inline > .form-label {
  margin-bottom: 0;
  white-space: nowrap;
}

.preview-box {
  background: #FAFAF8;
  border: 1px solid #EFEEEA;
  border-radius: 10px;
  padding: 30px 28px;
  margin-bottom: 16px;
  /* 미리보기는 콘텐츠 fit(inline-block + nowrap). 박스도 콘텐츠 폭에 맞춰 자동 줄어듦. */
  width: fit-content;
  max-width: 100%;
}

.actions {
  display: flex;
  gap: 10px;
  margin-top: 12px;
}

.btn {
  flex: 1;
  padding: 16px 22px;
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.05s;
  letter-spacing: -0.01em;
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: #0A0A0A;
  color: #fff;
}

.btn-primary:hover { opacity: 0.85; }
.btn-primary:disabled {
  background: #D4D6DB;
  color: #fff;
  cursor: not-allowed;
  opacity: 1;
}

.btn-ghost {
  background: transparent;
  color: #2A2A2A;
  border: 1px solid #E0E0DC;
}

.btn-ghost:hover { background: #F4F0E6; }

/* form-row-inline 안에서 우측 끝에 붙는 컴팩트 인라인 버튼.
   반드시 .btn 정의 뒤에 와야 flex/padding override가 먹는다. */
.btn-inline {
  flex: 0 0 auto;
  margin-left: auto;
  padding: 11px 20px;
  font-size: 13px;
}

.toast {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  background: #0A0A0A;
  color: #fff;
  padding: 12px 22px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: -0.01em;
  box-shadow: 0 6px 20px rgba(0,0,0,0.2);
  z-index: 100;
  animation: toast-in 0.2s ease-out;
}

@keyframes toast-in {
  from { opacity: 0; transform: translate(-50%, 10px); }
  to   { opacity: 1; transform: translate(-50%, 0); }
}

.help {
  font-size: 13px;
  color: #5A5A5A;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid #EFEEEA;
  line-height: 1.5;
}

.help b { color: #0A0A0A; font-weight: 600; }
.help a { color: #1C46F3; font-weight: 600; text-decoration: none; }
.help a:hover { text-decoration: underline; }
.help a .ext-arrow { margin-left: 2px; font-size: 0.85em; }
.help ol { padding-left: 18px; margin: 6px 0 0; }
.help li { margin: 3px 0; }

/* 편집 모달 */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 10, 10, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 200;
  animation: fade-in 0.15s ease-out;
}

.modal {
  background: #fff;
  border-radius: 14px;
  width: 100%;
  max-width: 600px;
  max-height: calc(100vh - 48px);
  overflow: auto;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18);
  animation: modal-pop 0.18s ease-out;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 14px 14px 0;
}

.modal-close {
  background: transparent;
  border: none;
  font-size: 24px;
  line-height: 1;
  color: #7A7A7A;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
}
.modal-close:hover { background: #F4F0E6; color: #0A0A0A; }

.modal-body {
  padding: 8px 26px 4px;
}

.modal-footer {
  padding: 12px 26px 22px;
  display: flex;
  justify-content: flex-end;
}
.modal-footer .btn { flex: 0 0 auto; padding: 10px 22px; }

@keyframes fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes modal-pop {
  from { opacity: 0; transform: scale(0.97) translateY(6px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

/* 매칭 카드는 콘텐츠에 맞게 줄어듦(fit-content) + 최대 960px. 고정 960px이면 좌측 미리보기 폭이
   사람마다 달라질 때 우측(도움말)이 남는 폭을 먹어 폭이 들쭉날쭉해진다. 카드를 콘텐츠에 맞추고
   우측을 고정폭으로 두면 누구나 동일한 우측 레이아웃이 된다. (페이지가 가운데 정렬) */
.card-wide { max-width: 960px; width: fit-content; }

.two-col {
  display: grid;
  /* 좌측: 미리보기 콘텐츠 폭(max-content)에 맞추되 최소 baseline(400px) 보장.
     - 기본 서울 주소 = 박스 ~399px이 가장 흔한 케이스 → 이를 baseline으로.
     - 김봉진 싱가포르처럼 영문 주소 줄이 짧은 사람은 박스가 baseline까지 늘어나 카드 폭이 동일.
     - FnB처럼 주소가 더 긴 사람은 max-content로 그대로 커짐(잘림 없음).
     이렇게 하면 누구를 조회해도 카드/우측 폭이 출렁이지 않는다.
     우측: 고정 320px — 미리보기 폭과 무관하게 모든 구성원이 동일한 도움말 레이아웃. */
  grid-template-columns: minmax(400px, max-content) 320px;
  gap: 36px;
  align-items: start;
}
/* two-col 안에선 박스가 좌측 그리드 컬럼(baseline 400px ~ max-content)을 꽉 채우게 —
   전역 .preview-box의 fit-content를 덮어, 짧은 주소(김봉진 싱가포르)도 박스 폭이 동일.
   서명 콘텐츠는 박스 안에서 좌측 정렬 그대로. */
.two-col .preview-box { margin-bottom: 0; width: 100%; }

/* col-right는 버튼이 맨 위 → 상단 여백 제거. help는 구분선 없이 여백만으로 버튼과 분리 */
.col-right .actions {
  margin-top: 0;
}
.col-right .help {
  margin-top: 22px;
  padding-top: 0;
  border-top: none;
}

/* '정보 다시 입력하기' — 도움말 아래(4번 저장 우측) 우측정렬 */
.footer-action {
  margin-top: 14px;
  text-align: right;
}

@media (max-width: 720px) {
  .two-col { grid-template-columns: 1fr; gap: 16px; }
  .card-wide { max-width: 560px; width: 100%; }  /* 모바일은 단일 컬럼 — 카드 전체폭 유지(fit-content 해제) */
}

@media (max-width: 600px) {
  .card { padding: 28px 22px 24px; border-radius: 12px; }
  .title { font-size: 19px; }
}
