/* ===== 인증 페이지 공통 ===== */

/* ===== Split 레이아웃 (로그인) ===== */
.auth-split {
  display: flex;
  min-height: 100vh;
}

.auth-split__visual {
  flex: 1;
  position: relative;
  overflow: hidden;
}

.auth-split__bg {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.auth-split__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(0, 0, 0, 0.4) 0%, rgba(0, 0, 0, 0.15) 100%);
}

.auth-split__text {
  position: absolute;
  bottom: 60px;
  left: 48px;
  z-index: 2;
}

.auth-split__text h2 {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: var(--weight-semibold);
  color: var(--text-inverse);
  line-height: 1.4;
  letter-spacing: 2px;
  margin-bottom: 12px;
}

.auth-split__text p {
  font-size: var(--text-md);
  color: rgba(255, 255, 255, 0.7);
  font-weight: var(--weight-light);
}

.auth-split__form {
  width: 480px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px;
  background: var(--surface-white);
}

/* 구분선 */
.auth__divider {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 28px 0 20px;
}

.auth__divider::before,
.auth__divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border-subtle);
}

.auth__divider span {
  font-size: var(--text-xs);
  color: var(--text-muted);
  white-space: nowrap;
}

/* 안내 박스 */
.auth__error-box {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: rgba(192, 57, 43, 0.08);
  border: 1px solid rgba(192, 57, 43, 0.2);
  border-radius: var(--radius-md);
  color: #c0392b;
  font-size: var(--text-sm);
  margin-bottom: 16px;
}

.auth__info-box {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px 20px;
  background: var(--surface-off-white);
  border-radius: var(--radius-md);
}

.auth__info-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: var(--text-sm);
  color: var(--text-secondary);
}

.auth__info-item svg {
  flex-shrink: 0;
  color: var(--brand-accent);
}

/* 메인 컨테이너 (회원가입용) */
.auth {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  background: var(--surface-off-white);
}

/* 로고 */
.auth__logo {
  display: block;
  font-family: var(--font-ui);
  font-size: var(--text-lg);
  font-weight: var(--weight-light);
  letter-spacing: 6px;
  text-transform: uppercase;
  color: var(--text-primary);
  text-align: center;
  margin-bottom: 32px;
}

/* 카드 */
.auth__card {
  width: 100%;
  max-width: 400px;
  background: var(--surface-white);
  border-radius: var(--radius-lg);
  padding: 48px 40px;
  box-shadow: var(--shadow-sm);
}

.auth__card--wide {
  max-width: 480px;
}

.auth__title {
  font-family: var(--font-body);
  font-size: var(--text-2xl);
  font-weight: var(--weight-bold);
  color: var(--text-primary);
  text-align: center;
  margin-bottom: 8px;
}

.auth__desc {
  font-size: var(--text-md);
  color: var(--text-muted);
  text-align: center;
  margin-bottom: 36px;
  font-weight: var(--weight-light);
}

/* ===== OAuth 버튼 ===== */
.auth__buttons {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.auth__oauth {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  height: 52px;
  border-radius: var(--radius-md);
  font-size: var(--text-md);
  font-weight: var(--weight-medium);
  letter-spacing: 0.3px;
  transition: all var(--ease-base);
  cursor: pointer;
  border: none;
}

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

.auth__oauth-icon {
  flex-shrink: 0;
}

/* 카카오 */
.auth__oauth--kakao {
  background: var(--oauth-kakao);
  color: var(--oauth-kakao-text);
}

.auth__oauth--kakao:hover {
  background: var(--oauth-kakao-hover);
}

/* 네이버 */
.auth__oauth--naver {
  background: var(--oauth-naver);
  color: var(--text-inverse);
}

.auth__oauth--naver:hover {
  background: var(--oauth-naver-hover);
}

/* 안내 문구 */
.auth__notice {
  margin-top: 24px;
  font-size: var(--text-sm);
  color: var(--text-muted);
  text-align: center;
  font-weight: var(--weight-light);
}

/* 하단 링크 */
.auth__footer {
  margin-top: 24px;
}

.auth__footer a {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: var(--text-sm);
  color: var(--text-muted);
  transition: color var(--ease-fast);
}

.auth__footer a:hover {
  color: var(--text-primary);
}

/* ===== 추가정보 폼 ===== */
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.auth-form__group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.auth-form__label {
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 6px;
}

.auth-form__required {
  font-size: 11px;
  color: var(--brand-danger);
  font-weight: var(--weight-regular);
}

.auth-form__input {
  height: 46px;
  padding: 0 16px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  font-size: var(--text-md);
  font-family: var(--font-body);
  color: var(--text-primary);
  background: var(--surface-white);
  transition: border-color var(--ease-fast), box-shadow var(--ease-fast);
  -webkit-user-select: text;
  user-select: text;
}

.auth-form__input:focus {
  border-color: var(--brand-accent);
  box-shadow: 0 0 0 3px rgba(201, 168, 124, 0.15);
}

.auth-form__input::placeholder {
  color: var(--text-muted);
  font-weight: var(--weight-light);
}

.auth-form__input--readonly {
  background: var(--surface-light);
  color: var(--text-secondary);
  cursor: default;
}

.auth-form__input--error {
  border-color: var(--brand-danger);
  box-shadow: 0 0 0 3px rgba(192, 57, 43, 0.1);
}

.auth-form__error {
  font-size: var(--text-xs);
  color: var(--brand-danger);
  min-height: 0;
  transition: min-height var(--ease-fast);
}

.auth-form__error:not(:empty) {
  min-height: 16px;
}

/* 구분선 */
.auth-form__divider {
  height: 1px;
  background: var(--border-subtle);
  margin: 4px 0;
}

/* 주소 검색 */
.auth-form__address {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.auth-form__address-row {
  display: flex;
  gap: 8px;
}

.auth-form__address-row .auth-form__input {
  flex: 1;
}

.auth-form__btn-address {
  flex-shrink: 0;
  height: 46px;
  padding: 0 20px;
  background: var(--brand-primary);
  color: var(--text-inverse);
  border: none;
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  cursor: pointer;
  transition: background var(--ease-fast);
  white-space: nowrap;
}

.auth-form__btn-address:hover {
  background: var(--brand-secondary);
}

/* 제출 버튼 */
.auth-form__submit {
  height: 52px;
  margin-top: 8px;
  background: var(--brand-primary);
  color: var(--text-inverse);
  border: none;
  border-radius: var(--radius-md);
  font-size: var(--text-lg);
  font-weight: var(--weight-medium);
  letter-spacing: 1px;
  cursor: pointer;
  transition: all var(--ease-base);
}

.auth-form__submit:hover {
  background: var(--brand-secondary);
}

.auth-form__submit:active {
  transform: scale(0.98);
}

/* ===== 약관 동의 ===== */
.auth-form__agreements {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.auth-form__agree {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  cursor: pointer;
}

.auth-form__agree input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--brand-accent);
  flex-shrink: 0;
  cursor: pointer;
}

.auth-form__agree-text {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  flex: 1;
}

.auth-form__agree-text--bold {
  font-size: var(--text-md);
  font-weight: var(--weight-medium);
  color: var(--text-primary);
}

.auth-form__agree-list {
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--border-subtle);
  padding-left: 4px;
}

.auth-form__agree-list .auth-form__agree {
  padding: 8px 0;
  border-bottom: 1px solid var(--border-subtle);
}

.auth-form__agree-view {
  font-size: var(--text-xs);
  color: var(--text-muted);
  background: none;
  border: none;
  cursor: pointer;
  text-decoration: underline;
  flex-shrink: 0;
  padding: 4px;
}

.auth-form__agree-view:hover {
  color: var(--text-primary);
}

.auth-form__submit:disabled {
  background: var(--border-subtle);
  color: var(--text-muted);
  cursor: not-allowed;
}

.auth-form__submit:disabled:hover {
  background: var(--border-subtle);
}

/* ===== 약관 모달 ===== */
.terms-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: var(--z-overlay);
}

.terms-modal-overlay--active {
  display: block;
}

.terms-modal {
  display: none;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 520px;
  max-width: 90vw;
  max-height: 80vh;
  background: var(--surface-white);
  border-radius: var(--radius-lg);
  z-index: var(--z-modal);
  flex-direction: column;
  overflow: hidden;
}

.terms-modal--active {
  display: flex;
}

.terms-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-subtle);
  flex-shrink: 0;
}

.terms-modal__title {
  font-size: var(--text-lg);
  font-weight: var(--weight-bold);
  color: var(--text-primary);
}

.terms-modal__close {
  background: none;
  border: none;
  font-size: 24px;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0;
  line-height: 1;
}

.terms-modal__close:hover {
  color: var(--text-primary);
}

.terms-modal__body {
  padding: 24px;
  overflow-y: auto;
  flex: 1;
  font-size: var(--text-sm);
  color: var(--text-secondary);
  line-height: 1.8;
}

.terms-modal__body h4 {
  font-size: var(--text-md);
  font-weight: var(--weight-medium);
  color: var(--text-primary);
  margin: 16px 0 8px;
}

.terms-modal__body h4:first-child {
  margin-top: 0;
}

.terms-modal__body ul {
  padding-left: 20px;
  margin: 8px 0;
}

.terms-modal__body li {
  list-style: disc;
  margin-bottom: 4px;
}

.terms-modal__footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border-subtle);
  text-align: right;
  flex-shrink: 0;
}

.terms-modal__btn {
  padding: 10px 32px;
  background: var(--brand-primary);
  color: var(--text-inverse);
  border: none;
  border-radius: var(--radius-md);
  font-size: var(--text-md);
  font-weight: var(--weight-medium);
  cursor: pointer;
  transition: background var(--ease-fast);
}

.terms-modal__btn:hover {
  background: var(--brand-secondary);
}

/* ===== 반응형 ===== */
@media (max-width: 768px) {
  .auth-split {
    flex-direction: column;
  }

  .auth-split__visual {
    height: 200px;
    flex: none;
  }

  .auth-split__text {
    bottom: 24px;
    left: 24px;
  }

  .auth-split__text h2 {
    font-size: var(--text-xl);
  }

  .auth-split__form {
    width: 100%;
    padding: 32px 20px;
  }
}

@media (max-width: 480px) {
  .auth__card {
    padding: 36px 24px;
    border-radius: var(--radius-md);
  }

  .auth__title {
    font-size: var(--text-xl);
  }

  .auth__desc {
    font-size: var(--text-sm);
    margin-bottom: 28px;
  }

  .auth__oauth {
    height: 48px;
    font-size: var(--text-sm);
  }

  .auth-form__input {
    height: 44px;
    font-size: var(--text-sm);
  }

  .auth-form__btn-address {
    height: 44px;
    padding: 0 14px;
    font-size: var(--text-xs);
  }

  .auth-form__submit {
    height: 48px;
    font-size: var(--text-md);
  }
}

/* ===== 약관 동의 ===== */
.agree-list {
  display: flex;
  flex-direction: column;
}
.agree-item-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid #f2f0ed;
}
.agree-item-row:last-child { border-bottom: none; }
.agree-item-row--all { padding: 12px 0; }
.agree-item-row--all .agree-label { font-size: 14px; font-weight: 600; color: #1a1a1a; }

.agree-check {
  width: 18px;
  height: 18px;
  accent-color: #c9a87c;
}
.agree-label {
  font-size: 13px;
  color: #666;
  flex: 1;
}
.agree-view {
  font-size: 12px;
  color: #999;
  background: none;
  border: none;
  cursor: pointer;
  text-decoration: underline;
}

/* ===== 약관 모달 ===== */
.terms-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 9998;
}
.terms-modal {
  display: none;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%,-50%);
  width: 520px;
  max-width: 90vw;
  max-height: 80vh;
  background: #fff;
  border-radius: 12px;
  z-index: 9999;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 8px 30px rgba(0,0,0,0.12);
}
.terms-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid #f2f0ed;
  flex-shrink: 0;
}
.terms-modal__title {
  font-size: 16px;
  font-weight: 700;
  color: #1a1a1a;
}
.terms-modal__close {
  background: none;
  border: none;
  font-size: 24px;
  color: #999;
  cursor: pointer;
  line-height: 1;
}
.terms-modal__body {
  padding: 24px;
  overflow-y: auto;
  flex: 1;
  font-size: 13px;
  color: #666;
  line-height: 1.8;
}
.terms-modal__footer {
  padding: 16px 24px;
  border-top: 1px solid #f2f0ed;
  text-align: right;
  flex-shrink: 0;
}
.terms-modal__confirm {
  padding: 10px 32px;
  background: #1a1a1a;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
}