/* dashboard.css — 내 구독관리 페이지 전용 스타일 */

.hidden {
  display: none !important;
}

/* 1. 기본 레이아웃 및 바디 */
body {
  font-family: "SUIT", sans-serif;
}

.dashboard-main {
  background-color: rgba(241, 245, 249, 0.5);
  min-height: 100vh;
  box-sizing: border-box;
}

/* 헤더/푸터 제거된 단독 페이지 — common.css의 헤더 높이 보정 무효화 */
.dashboard {
  min-height: 100vh;
}

.dashboard-inner {
  max-width: 1120px;
  margin: 0 auto 20px auto;
  padding: 0 20px;
  box-sizing: border-box;
}

.dashboard-title {
  margin-bottom: 4px;
  font-size: 28px;
  font-weight: 700;
  color: #0f172a;
}

.dashboard-hello {
  font-size: 14px;
  color: #64748b;
}

.dashboard-hello strong {
  color: #0f172a;
}

.money-dashboard-card {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 20px;
  box-sizing: border-box;
}

.dashboard-card {
  width: 100%;
  background: #ffffff;
  border-radius: 24px;
  border: 1px solid rgba(226, 232, 240, 0.8);
  overflow: hidden;
  min-height: 580px;
  display: grid;
  grid-template-columns: 1fr;
  box-shadow:
    0 20px 25px -5px rgba(0, 0, 0, 0.05),
    0 10px 10px -5px rgba(0, 0, 0, 0.02);
  position: relative;
  color: #1e293b;
}

@media (min-width: 768px) {
  .dashboard-card {
    grid-template-columns: repeat(12, minmax(0, 1fr));
  }
}

/* 2. 좌측 사이드바 */
.dashboard-sidebar {
  background-color: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  padding: 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 24px;
}

@media (min-width: 768px) {
  .dashboard-sidebar {
    grid-column: span 3 / span 3;
    border-bottom: none;
    border-right: 1px solid #e2e8f0;
  }
}

.sidebar-brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--color-primary);
  font-weight: 800;
  font-size: 18px;
  letter-spacing: -0.5px;
  text-decoration: none;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 24px;
  font-size: 12px;
  font-weight: 500;
}

.sidebar-nav-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  text-align: left;
  transition: all 0.2s ease;
  background: transparent;
  border: none;
  cursor: pointer;
  font-family: inherit;
}

.sidebar-nav-btn.inactive {
  color: #64748b;
}

.sidebar-nav-btn.inactive:hover {
  background-color: #f1f5f9;
  color: #1e293b;
}

.sidebar-nav-btn.active {
  background-color: var(--color-primary-soft);
  color: var(--color-primary);
  font-weight: 700;
}

.sidebar-profile {
  padding-top: 16px;
  border-top: 1px solid #e2e8f0;
  font-size: 12px;
  color: #94a3b8;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-profile-label {
  display: block;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  color: #94a3b8;
  margin-bottom: 2px;
}

.sidebar-profile-email {
  color: #475569;
  font-weight: 500;
}

/* 사이드바 하단 계정 액션 (로그아웃 / 회원탈퇴) */
.sidebar-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 14px;
}

.sidebar-logout-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  background-color: #ffffff;
  color: #475569;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
}

.sidebar-logout-btn:hover {
  background-color: #f1f5f9;
  color: #1e293b;
}

.sidebar-withdraw-btn {
  background: transparent;
  border: none;
  font-size: 10px;
  color: #94a3b8;
  cursor: pointer;
  transition: color 0.2s;
  font-family: inherit;
}

.sidebar-withdraw-btn:hover {
  color: #e11d48;
  text-decoration: underline;
}

/* 3. 우측 콘텐츠 영역 */
.dashboard-content {
  padding: 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 24px;
}

@media (min-width: 768px) {
  .dashboard-content {
    grid-column: span 9 / span 9;
    padding: 40px;
  }
}

.tab-content {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.tab-content.hidden {
  display: none !important;
}

.tab-header {
  border-bottom: 1px solid #f1f5f9;
  padding-bottom: 16px;
}

.tab-title {
  font-size: 20px;
  font-weight: 700;
  color: #0f172a;
}

.tab-subtitle {
  font-size: 12px;
  color: #64748b;
  margin-top: 4px;
}

/* 4. 내 계정 설정 탭 */
.account-form-wrapper {
  max-width: 448px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.form-section-title {
  font-size: 11px;
  font-weight: 700;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 12px;
}

.form-section-password {
  border-top: 1px solid #f1f5f9;
  padding-top: 16px;
}

.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: #475569;
  margin-bottom: 6px;
}

.form-control {
  width: 100%;
  padding: 10px 14px;
  font-size: 12px;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  color: #1e293b;
  background: #ffffff;
  transition: border-color 0.2s;
  box-sizing: border-box;
}

.form-control:focus {
  outline: none;
  border-color: var(--color-primary);
}

.form-control:disabled {
  background-color: #f8fafc;
  color: #94a3b8;
  cursor: not-allowed;
}

.form-control.is-invalid {
  border-color: #ef4444 !important;
}

.form-row-2col {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.field-error-text {
  color: #ef4444;
  font-size: 10px;
  margin-top: 4px;
}

/* 5. 구독 정보 탭 */
.status-card-banner {
  border-radius: 16px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: flex-start;
  transition: all 0.3s;
}

@media (min-width: 768px) {
  .status-card-banner {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }
}

.status-card-banner.active {
  border: 1px solid var(--color-primary-line);
  background-color: var(--color-primary-faint);
}

.status-card-banner.warning {
  border: 1px solid #fde68a;
  background-color: rgba(254, 243, 199, 0.4);
}

.status-card-banner.canceled {
  border: 1px solid #fecdd3;
  background-color: rgba(255, 241, 242, 0.4);
}

.banner-title-area {
  display: flex;
  align-items: center;
  gap: 8px;
}

.status-banner-title {
  font-size: 16px;
  color: #1e293b;
  font-weight: 700;
}

.status-banner-desc {
  font-size: 12px;
  color: #64748b;
  margin-top: 4px;
}

.status-badge {
  font-size: 10px;
  font-weight: 700;
  color: #ffffff;
  padding: 2px 8px;
  border-radius: 4px;
  display: inline-block;
}

.status-badge.active {
  background-color: var(--color-primary);
}

.status-badge.warning {
  background-color: #d97706;
}

.status-badge.canceled {
  background-color: #e11d48;
}

.banner-price-box {
  text-align: left;
}

@media (min-width: 768px) {
  .banner-price-box {
    text-align: right;
  }
}

.banner-price-val {
  font-size: 20px;
  font-weight: 800;
  color: var(--color-primary);
}

.banner-price-period {
  font-size: 12px;
  color: #64748b;
  font-weight: 400;
}

.banner-price-date {
  font-size: 11px;
  color: #94a3b8;
  margin-top: 2px;
}

/* 결제 수단 요약 박스 */
.payment-summary-box {
  background-color: #f8fafc;
  border: 1px solid rgba(226, 232, 240, 0.6);
  border-radius: 16px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.payment-summary-title {
  font-size: 12px;
  font-weight: 700;
  color: #334155;
}

.payment-summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
}

.payment-summary-card-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.pay-method-value {
  font-weight: 500;
  color: #334155;
}

.summary-expiry-val {
  color: #94a3b8;
}

.card-chip-badge {
  width: 32px;
  height: 20px;
  background-color: #1e293b;
  color: #ffffff;
  font-weight: 700;
  font-size: 9px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* 혜택 안내 */
.benefits-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.benefits-title {
  font-size: 12px;
  font-weight: 700;
  color: #334155;
}

.benefits-grid {
  display: grid;
  grid-template-columns: repeat(1, minmax(0, 1fr));
  gap: 8px;
  font-size: 12px;
  color: #475569;
}

@media (min-width: 640px) {
  .benefits-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.benefit-item {
  display: flex;
  align-items: center;
  gap: 8px;
}

.benefit-icon {
  color: var(--color-primary);
}

/* 결제 카드 목록 */
.card-section {
  padding-top: 16px;
  border-top: 1px solid #f1f5f9;
}

.card-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.card-section-title-text {
  font-size: 11px;
  font-weight: 700;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.card-count-text {
  font-size: 11px;
  color: #94a3b8;
}

.card-list-box {
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  overflow: hidden;
  background-color: #ffffff;
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

.card-list-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px;
  gap: 16px;
  border-bottom: 1px solid #f1f5f9;
  transition: background-color 0.2s;
}

.card-list-item:last-child {
  border-bottom: none;
}

.card-list-item:hover {
  background-color: rgba(248, 250, 252, 0.4);
}

.card-list-item.primary {
  background-color: var(--color-primary-faint);
}

.card-brand-badge {
  width: 40px;
  height: 24px;
  color: #ffffff;
  font-weight: 700;
  font-size: 9px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.card-item-details {
  display: flex;
  align-items: center;
  gap: 12px;
}

.card-info-title {
  font-weight: 700;
  color: #1e293b;
  font-size: 12px;
  display: flex;
  align-items: center;
}

.card-primary-label {
  margin-left: 8px;
  background-color: var(--color-primary-soft);
  color: var(--color-primary-hover);
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 4px;
}

.card-info-subtext {
  font-size: 10px;
  color: #94a3b8;
  margin-top: 2px;
}

.card-item-actions {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-shrink: 0;
}

.card-btn-link {
  background: transparent;
  border: none;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: color 0.2s;
}

.card-btn-link.primary-set {
  color: var(--color-primary);
}

.card-btn-link.primary-set:hover {
  color: var(--color-primary-hover);
}

.card-btn-link.delete {
  color: #ef4444;
}

.card-btn-link.delete:hover {
  color: #dc2626;
}

.card-empty-placeholder {
  text-align: center;
  padding: 32px 16px;
  border: 1px dashed #e2e8f0;
  border-radius: 16px;
  background-color: rgba(248, 250, 252, 0.4);
  color: #94a3b8;
}

.card-empty-icon {
  font-size: 24px;
  margin-bottom: 8px;
  display: block;
  color: #cbd5e1;
}

/* 6. 결제 내역 탭 */
.history-table-container {
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  overflow: hidden;
  background-color: #ffffff;
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  max-height: 220px;
  overflow-y: auto;
}

.history-table {
  width: 100%;
  font-size: 12px;
  text-align: left;
  border-collapse: collapse;
}

.history-thead {
  position: sticky;
  top: 0;
  background-color: #f8fafc;
  z-index: 10;
}

.history-tr-head {
  border-bottom: 1px solid #e2e8f0;
  color: #64748b;
  font-weight: 600;
}

.history-th {
  padding: 16px;
  background-color: #f8fafc;
}

.history-th-center {
  text-align: center;
}

.history-td {
  padding: 16px;
  border-bottom: 1px solid #f1f5f9;
}

.history-tr-body:last-child .history-td {
  border-bottom: none;
}

.history-tr-body:hover {
  background-color: rgba(248, 250, 252, 0.5);
  transition: background-color 0.2s;
}

.history-badge {
  background-color: #ecfdf5;
  color: #047857;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 10px;
}

.history-badge.is-fail {
  background-color: #fef2f2;
  color: #b91c1c;
}

.history-btn-view {
  background: transparent;
  border: none;
  color: var(--color-primary);
  cursor: pointer;
  font-weight: 500;
  font-family: inherit;
}

.history-btn-view:hover {
  text-decoration: underline;
}

/* 7. 공통 버튼 바 및 메시지 영역 */
.tab-footer-bar {
  padding-top: 24px;
  border-top: 1px solid #f1f5f9;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* 구독 탭 외(내 계정·결제 내역)에서는 버튼 바 숨김 — JS가 hidden 클래스를 토글 */
.tab-footer-bar.hidden {
  display: none !important;
}

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

.btn-primary-custom {
  padding: 10px 20px;
  background-color: var(--color-primary);
  color: #ffffff;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 700;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 6px -1px rgba(47, 93, 159, 0.15);
  transition: background-color 0.2s;
  font-family: inherit;
}

.btn-primary-custom:hover {
  background-color: var(--color-primary-hover);
}

.btn-secondary-custom {
  padding: 8px 16px;
  border: 1px solid #e2e8f0;
  background-color: transparent;
  color: #475569;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 0.2s;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
}

.btn-secondary-custom:hover {
  background-color: #f8fafc;
  color: #1e293b;
}

.btn-danger-text {
  background: transparent;
  border: none;
  font-size: 12px;
  color: #94a3b8;
  cursor: pointer;
  transition: color 0.2s;
  font-family: inherit;
}

.btn-danger-text:hover {
  color: #e11d48;
}

.message-box {
  margin-top: 16px;
}

.sub-message {
  font-size: 12px;
}

.sub-message.is-info {
  color: var(--color-primary);
}

.sub-message.is-danger {
  color: #ef4444;
}

/* ===== 단독 페이지 (account.html / subscription.html) =====
   대시보드의 사이드바 그리드를 쓰지 않는, 헤더+푸터 사이의 카드 레이아웃 */
.solo-page {
  background-color: rgba(241, 245, 249, 0.5);
  min-height: calc(100vh - 68px); /* 68px = 헤더 높이 */
  padding: 48px 20px 72px;
  box-sizing: border-box;
}

.solo-card {
  max-width: 960px;
  margin: 0 auto;
  background: #ffffff;
  border-radius: 0;
  border: 1px solid rgba(226, 232, 240, 0.8);
  box-shadow:
    0 20px 25px -5px rgba(0, 0, 0, 0.05),
    0 10px 10px -5px rgba(0, 0, 0, 0.02);
  padding: 32px 24px;
  box-sizing: border-box;
  color: #1e293b;
}

.solo-card + .solo-card {
  margin-top: 24px;
}

@media (min-width: 768px) {
  .solo-card {
    padding: 40px;
  }
}

.solo-page .dashboard-note {
  max-width: 960px;
  margin: 16px auto 0;
}

/* 회원탈퇴 — 기능은 유지하되 카드 하단 구석의 절제된 텍스트 링크로 */
.withdraw-row {
  margin-top: 32px;
  text-align: right;
}

.withdraw-link-btn {
  background: none;
  border: none;
  padding: 0;
  font-size: 12px;
  color: #94a3b8;
  text-decoration: underline;
  cursor: pointer;
  font-family: inherit;
}

.withdraw-link-btn:hover {
  color: #e11d48;
}

/* 9. 이용약관/정책 페이지 (terms.html) */
.terms-content {
  max-width: 720px;
  margin: 0 auto;
}

.terms-notice {
  background-color: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 12px;
  padding: 14px 16px;
  font-size: 12.5px;
  color: #b91c1c;
  line-height: 1.6;
  margin-bottom: 28px;
}

.terms-article {
  margin-top: 28px;
}

.terms-h2 {
  font-size: 17px;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 10px;
}

.terms-h3 {
  font-size: 14px;
  font-weight: 700;
  color: #1e293b;
  margin-top: 16px;
  margin-bottom: 6px;
}

.terms-body {
  font-size: 13.5px;
  color: #334155;
  line-height: 1.7;
  margin-bottom: 8px;
}

.terms-list {
  padding-left: 20px;
  margin-bottom: 8px;
}

.terms-list li {
  font-size: 13.5px;
  color: #334155;
  line-height: 1.7;
  margin-bottom: 4px;
}

.terms-table {
  width: 100%;
  border-collapse: collapse;
  margin: 12px 0 16px;
  font-size: 12.5px;
}

.terms-table th,
.terms-table td {
  border: 1px solid #e2e8f0;
  padding: 10px 12px;
  text-align: left;
  vertical-align: top;
  line-height: 1.55;
}

.terms-table th {
  background-color: #f8fafc;
  color: #0f172a;
  font-weight: 700;
}

.terms-effective {
  margin-top: 32px;
  padding-top: 16px;
  border-top: 1px solid #e2e8f0;
  font-size: 12.5px;
  color: #94a3b8;
}
