/* Auth / MyPage / Contract — isolated from main app chrome */
.page-auth {
  margin: 0;
  min-height: 100dvh;
  background: #ffffff !important;
  font-family: var(--font, "Pretendard Variable", Pretendard, "Apple SD Gothic Neo", "Noto Sans KR", sans-serif);
  color: #191919;
}

.page-auth .page-shell,
.page-auth .pc-side,
.page-auth .fab,
.page-auth .bottom-nav {
  display: none !important;
}

.auth-shell {
  width: 100%;
  max-width: 430px;
  margin: 0 auto;
  min-height: 100dvh;
  background: #fff;
  display: flex;
  flex-direction: column;
}

/* —— Header —— */
.sub-header {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  height: 52px;
  padding: 0 12px;
  border-bottom: 1px solid #f0f0f0;
  background: #fff;
  flex-shrink: 0;
}

.sub-header h1 {
  margin: 0;
  font-size: 1.0625rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #191919;
  line-height: 1;
}

.back-btn {
  position: absolute;
  left: 4px;
  top: 50%;
  transform: translateY(-50%);
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  color: #191919;
  border-radius: 10px;
  text-decoration: none;
}

.back-btn:hover {
  background: #f5f5f5;
}

.back-btn svg {
  display: block;
}

/* —— Auth body —— */
.auth-main,
.contract-main {
  flex: 1;
  padding: 24px 24px 40px;
  box-sizing: border-box;
}

.mypage-main {
  padding: 20px 16px 120px;
  box-sizing: border-box;
}

.auth-eyebrow {
  margin: 0 0 6px;
  font-size: 0.875rem;
  color: #8e8e8e;
  font-weight: 500;
  letter-spacing: -0.01em;
}

.auth-title {
  margin: 0 0 24px;
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.045em;
  line-height: 1.35;
  color: #191919;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin: 0;
}

.field-label {
  font-size: 0.8125rem;
  color: #666;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.field-input,
.field input,
.field textarea {
  width: 100%;
  box-sizing: border-box;
  height: 50px;
  padding: 0 14px;
  border: 1px solid #e4e4e4;
  border-radius: 10px;
  font: inherit;
  font-size: 0.975rem;
  font-weight: 500;
  color: #191919;
  background: #fff;
  appearance: none;
  -webkit-appearance: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.field textarea {
  height: auto;
  padding: 14px;
  min-height: 100px;
  resize: vertical;
}

.field-input::placeholder,
.field input::placeholder {
  color: #b0b0b0;
  font-weight: 400;
}

.field-input:focus,
.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: #0064ff;
  box-shadow: 0 0 0 3px rgba(0, 100, 255, 0.12);
}

.hint {
  font-size: 0.75rem;
  color: #999;
  font-weight: 500;
}

.auth-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: -2px;
  font-size: 0.8125rem;
}

.check {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #666;
  cursor: pointer;
  user-select: none;
}

.check input {
  width: 16px;
  height: 16px;
  accent-color: #0064ff;
  margin: 0;
}

.link-muted {
  color: #8e8e8e;
  text-decoration: none;
  font-size: 0.8125rem;
}

.link-muted:hover {
  text-decoration: underline;
  text-underline-offset: 2px;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 50px;
  margin-top: 6px;
  border: none !important;
  border-radius: 10px;
  background: #0064ff !important;
  color: #fff !important;
  font: inherit;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  cursor: pointer;
  transition: background 0.15s;
}

.btn-primary:hover {
  background: #0052d4 !important;
}

.btn-primary:active {
  background: #0047b8 !important;
}

.btn-block {
  margin: 8px 0 20px;
}

.btn-ghost {
  margin-left: auto;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid #e5e5e5;
  background: #fff;
  font: inherit;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  color: #191919;
}

.form-error {
  margin: 0;
  color: #e11d48;
  font-size: 0.875rem;
  font-weight: 600;
}

/* —— Divider —— */
.sns-divider {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 28px 0 16px;
  color: #b0b0b0;
  font-size: 0.75rem;
  font-weight: 500;
}

.sns-divider::before,
.sns-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: #ececec;
}

.sns-divider span {
  flex-shrink: 0;
}

/* —— Kakao button (official layout) ——
   Icon fixed left · label centered in full width · #FEE500 */
.btn-kakao {
  position: relative;
  display: block;
  width: 100%;
  height: 50px;
  padding: 0 50px;
  border: none !important;
  border-radius: 10px;
  background: #fee500 !important;
  color: rgba(0, 0, 0, 0.85) !important;
  font: inherit;
  font-size: 0.975rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 50px;
  text-align: center;
  cursor: pointer;
  box-shadow: none;
  transition: filter 0.12s, transform 0.08s;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

.btn-kakao:hover {
  filter: brightness(0.97);
}

.btn-kakao:active {
  filter: brightness(0.93);
  transform: scale(0.992);
}

.btn-kakao__icon {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.btn-kakao__icon svg {
  display: block;
  width: 18px;
  height: 18px;
}

.btn-kakao__label {
  display: block;
  width: 100%;
  text-align: center;
  color: rgba(0, 0, 0, 0.85);
  font-weight: 700;
  line-height: 50px;
}

.sns-note {
  margin: 10px 0 0;
  text-align: center;
  font-size: 0.75rem;
  color: #aaa;
  line-height: 1.4;
}

.auth-signup-link {
  display: block;
  text-align: center;
  margin-top: 28px;
  font-size: 0.9rem;
  color: #8e8e8e;
  text-decoration: none;
  letter-spacing: -0.01em;
}

.auth-signup-link strong {
  color: #0064ff;
  font-weight: 700;
}

.auth-signup-link:hover strong {
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* MyPage */
.profile-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 20px 18px;
  background: linear-gradient(135deg, #eff6ff 0%, #e8f0fe 100%);
  border: 1px solid #dbeafe;
  border-radius: 16px;
  margin-bottom: 28px;
}

.profile-avatar {
  flex-shrink: 0;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #fff;
  display: grid;
  place-items: center;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.08);
}

.profile-meta {
  flex: 1;
  min-width: 0;
}

.profile-name {
  font-size: 1.2rem;
  font-weight: 800;
  margin: 0;
  letter-spacing: -0.02em;
  color: #111;
}

.profile-id {
  font-size: 0.875rem;
  color: #64748b;
  margin: 4px 0 0;
  font-weight: 500;
}

.mp-section {
  margin-bottom: 32px;
}

.mp-title {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin: 0 0 6px;
  color: #111;
}

.mp-desc {
  font-size: 0.9rem;
  color: #64748b;
  margin: 0 0 14px;
  line-height: 1.5;
}

.mypage-page .btn-block {
  display: flex;
  margin: 0 0 16px;
  text-decoration: none;
}

.mp-menu {
  display: flex;
  flex-direction: column;
  border: 1px solid #eceef2;
  border-radius: 14px;
  overflow: hidden;
  background: #fff;
}

.mp-menu a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  border-bottom: 1px solid #f0f1f4;
  font-weight: 700;
  font-size: 0.95rem;
  color: #191919;
  text-decoration: none;
}

.mp-menu a:last-child {
  border-bottom: none;
}

.mp-menu a:hover {
  background: #f8fafc;
}

.mp-arrow {
  color: #c0c4cc;
  font-size: 1.2rem;
  font-weight: 400;
}

.contract-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.contract-item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  padding: 16px;
  border: 1px solid #eceef2;
  border-radius: 14px;
  background: #fff;
}

.contract-item strong {
  font-size: 1rem;
  font-weight: 800;
  color: #111;
}

.contract-item p {
  font-size: 0.85rem;
  color: #64748b;
  margin: 4px 0 0;
  line-height: 1.4;
}

.contract-item .muted {
  color: #94a3b8;
}

.badge {
  align-self: flex-start;
  padding: 5px 10px;
  border-radius: 999px;
  background: #dbeafe;
  color: #1e40af;
  font-size: 0.72rem;
  font-weight: 800;
  white-space: nowrap;
}

.contract-empty {
  text-align: center;
  padding: 28px 16px;
  color: #64748b;
  background: #f8fafc;
  border: 1px dashed #e2e8f0;
  border-radius: 14px;
  line-height: 1.6;
  list-style: none;
  font-size: 0.9rem;
}

.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 0 0 28px;
  padding: 0;
  list-style: none;
}

.steps li {
  text-align: center;
  padding: 10px 6px;
  border-radius: 10px;
  background: #f4f6f8;
  font-size: 0.78rem;
  font-weight: 700;
  color: #64748b;
}

.steps li.is-active {
  background: #0064ff;
  color: #fff;
}

.section-desc.wide {
  margin: -16px 0 28px;
  text-align: left;
  padding: 0;
  color: #64748b;
  font-size: 0.95rem;
  line-height: 1.5;
}

/* —— Info / 이용안내 (sajangpay-style) —— */
.info-page .main,
.info-main {
  padding: 20px 16px 120px;
  box-sizing: border-box;
}

.info-hero__title {
  margin: 0 0 8px;
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: #111;
}

.info-hero__desc {
  margin: 0 0 18px;
  font-size: 0.925rem;
  color: #888;
  line-height: 1.5;
}

.info-steps {
  list-style: none;
  margin: 0;
  padding: 4px 0;
  background: #fff;
  border: 1px solid #eceef2;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(15, 23, 42, 0.04);
}

.info-step {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 18px 16px;
  border-bottom: 1px solid #f0f1f4;
}

.info-step:last-child {
  border-bottom: none;
}

.info-step__num {
  flex-shrink: 0;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  margin-top: 2px;
  border-radius: 50%;
  background: #0064ff;
  color: #fff;
  font-size: 0.85rem;
  font-weight: 800;
}

.info-step__body {
  flex: 1;
  min-width: 0;
}

.info-step__body h2 {
  margin: 0 0 4px;
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #191919;
}

.info-step__body p {
  margin: 0;
  font-size: 0.875rem;
  color: #888;
  line-height: 1.5;
}

.info-step__icon {
  flex-shrink: 0;
  color: #d0d4dc;
  margin-top: 2px;
}

.info-faq {
  margin-top: 36px;
}

.info-faq__title {
  margin: 0 0 16px;
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: #111;
}

.faq-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.faq-group {
  background: #fff;
  border: 1px solid #eceef2;
  border-radius: 14px;
  overflow: hidden;
}

.faq-group__sum {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 16px;
  cursor: pointer;
  list-style: none;
  font-size: 1rem;
  font-weight: 800;
  color: #191919;
  user-select: none;
}

.faq-group__sum::-webkit-details-marker {
  display: none;
}

.faq-count {
  display: inline-grid;
  place-items: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 999px;
  background: #eef4ff;
  color: #0064ff;
  font-size: 0.75rem;
  font-weight: 800;
  font-style: normal;
}

.faq-chev {
  margin-left: auto;
  width: 18px;
  height: 18px;
  position: relative;
}

.faq-chev::before,
.faq-chev::after {
  content: "";
  position: absolute;
  background: #999;
  transition: transform 0.2s;
}

.faq-chev::before {
  left: 3px;
  top: 8px;
  width: 12px;
  height: 2px;
}

.faq-chev::after {
  left: 8px;
  top: 3px;
  width: 2px;
  height: 12px;
}

.faq-group[open] > .faq-group__sum .faq-chev::after {
  transform: scaleY(0);
}

.faq-group__body {
  border-top: 1px solid #f0f1f4;
  padding: 4px 8px 10px;
}

.faq-item {
  border-bottom: 1px solid #f5f5f7;
}

.faq-item:last-child {
  border-bottom: none;
}

.faq-item > summary {
  padding: 14px 10px;
  cursor: pointer;
  list-style: none;
  font-size: 0.925rem;
  font-weight: 600;
  color: #333;
  position: relative;
  padding-right: 28px;
}

.faq-item > summary::-webkit-details-marker {
  display: none;
}

.faq-item > summary::after {
  content: "+";
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: #aaa;
  font-size: 1.1rem;
  font-weight: 500;
}

.faq-item[open] > summary::after {
  content: "−";
}

.faq-item > p {
  margin: 0 10px 14px;
  padding: 12px 14px;
  background: #f7f8fa;
  border-radius: 10px;
  font-size: 0.875rem;
  color: #555;
  line-height: 1.65;
}

.faq-more {
  display: block;
  margin: 18px auto 8px;
  text-align: center;
  font-size: 0.9rem;
  font-weight: 700;
  color: #0064ff;
  text-decoration: none;
}

.info-footer {
  margin-top: 32px;
  padding-top: 8px;
}

/* —— Pay / 계약·결제 관리 —— */
.pay-main {
  padding: 20px 16px 120px;
  box-sizing: border-box;
}

.pay-title {
  margin: 0 0 6px;
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: #111;
}

.pay-desc {
  margin: 0 0 18px;
  font-size: 0.9rem;
  color: #64748b;
}

.pay-page .btn-block {
  display: flex;
  text-decoration: none;
  margin-bottom: 16px;
}

.pay-filter {
  margin: 0 0 12px;
  padding: 10px 14px;
  border-radius: 12px;
  background: #eff6ff;
  color: #334155;
  font-size: 0.875rem;
}

.pay-filter a {
  color: #0064ff;
  font-weight: 800;
  text-decoration: none;
}

/* —— Contract add wizard (sajangpay-style) —— */
.page-contract {
  margin: 0;
  min-height: 100dvh;
  background: #f4f6f8 !important;
}

.contract-shell {
  background: #f4f6f8;
}

.contract-main {
  padding: 16px 16px 40px;
  box-sizing: border-box;
}

.ca-steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  list-style: none;
  margin: 0 0 16px;
  padding: 0;
}

.ca-steps li {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  font-size: 0.7rem;
  font-weight: 700;
  color: #94a3b8;
}

.ca-steps li span {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #e2e8f0;
  color: #64748b;
  font-size: 0.75rem;
  font-weight: 800;
}

.ca-steps li.is-active,
.ca-steps li.is-done {
  color: #0064ff;
}

.ca-steps li.is-active span,
.ca-steps li.is-done span {
  background: #0064ff;
  color: #fff;
}

.ca-panel {
  display: none;
}

.ca-panel.is-active {
  display: block;
}

.ca-card {
  background: #fff;
  border: 1px solid #eceef2;
  border-radius: 16px;
  padding: 20px 16px;
  box-shadow: 0 2px 12px rgba(15, 23, 42, 0.04);
}

.ca-card__title {
  margin: 0 0 6px;
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: #111;
}

.ca-card__hint {
  margin: 0 0 18px;
  font-size: 0.875rem;
  color: #888;
  line-height: 1.5;
}

.ca-card .field {
  margin-bottom: 14px;
}

.ca-type-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.ca-type {
  padding: 14px 8px;
  border-radius: 12px;
  border: 1.5px solid #e5e7eb;
  background: #fff;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  color: #334155;
  cursor: pointer;
}

.ca-type.is-selected {
  border-color: #0064ff;
  background: #eff6ff;
  color: #0064ff;
}

.btn-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 48px;
  margin-top: 4px;
  border: 1.5px solid #d1d5db;
  border-radius: 12px;
  background: #fff;
  color: #334155;
  font: inherit;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
}

.ca-doc-guide {
  margin-bottom: 16px;
  padding: 12px 14px;
  border-radius: 12px;
  background: #f8fafc;
  border: 1px solid #eef0f4;
}

.ca-doc-guide__title {
  margin: 0 0 8px;
  font-size: 0.85rem;
  font-weight: 800;
  color: #111;
}

.ca-doc-guide ul {
  margin: 0;
  padding-left: 18px;
  color: #64748b;
  font-size: 0.85rem;
  line-height: 1.6;
}

.ca-doc-list {
  list-style: none;
  margin: 14px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ca-doc-list li {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px;
  border-radius: 10px;
  background: #f8fafc;
  border: 1px solid #eef0f4;
  font-size: 0.875rem;
}

.ca-doc-list strong {
  color: #0064ff;
  font-size: 0.8rem;
}

.ca-doc-list span {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #334155;
}

.ca-doc-list button {
  flex-shrink: 0;
  padding: 4px 8px;
  border-radius: 6px;
  background: #fee2e2;
  color: #b91c1c;
  font-size: 0.75rem;
  font-weight: 700;
}

.ca-actions {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}

.ca-actions .btn-outline,
.ca-actions .btn-primary {
  flex: 1;
  margin-top: 0;
}

.ca-actions .is-hidden {
  display: none !important;
}

@media (min-width: 1024px) {
  .page-contract {
    background: #f0f2f5 !important;
    padding: 32px 0;
  }

  .contract-shell {
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(15, 23, 42, 0.08);
    overflow: hidden;
    background: #f4f6f8;
  }

  .page-auth {
    background: #f0f2f5 !important;
    padding: 32px 0;
  }

  .auth-shell {
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(15, 23, 42, 0.08);
    min-height: calc(100dvh - 64px);
    overflow: hidden;
  }
}
