/**
 * Settings Page — v2 Aesthetic Overrides
 * Scoped under .settings-page to avoid affecting other pages.
 * Matches the clean, minimal billing tab / marketing v2 style.
 */

/* ── Cards: remove heavy borders, use subtle dividers ── */
.settings-page .card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  box-shadow: none;
}

.settings-page .card:hover {
  transform: none;
  box-shadow: none;
  background: rgba(255, 255, 255, 0.025);
}

.settings-page .card + .card {
  margin-top: 12px;
}

/* ── Card Header: lighter, no heavy separator ── */
.settings-page .card-header,
.settings-page .card > .hd {
  padding: 20px 24px 12px;
  border-bottom: none;
}

.settings-page .card-title {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0;
  color: var(--color-text-primary, #e2e8f0);
}

.settings-page .card-subtitle {
  font-size: 12px;
  font-weight: 300;
  color: rgba(226, 232, 240, 0.4);
  margin-top: 2px;
}

/* ── Card Body: tighter padding ── */
.settings-page .card-body,
.settings-page .card > .bd {
  padding: 8px 24px 20px;
}

/* ── Setting Group: cleaner spacing ── */
.settings-page .setting-group {
  margin-bottom: 8px;
}

.settings-page .setting-group__heading {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: rgba(6, 182, 212, 0.6);
  margin-bottom: 10px;
  margin-top: 4px;
}

.settings-page .setting-label {
  font-size: 13px;
  font-weight: 500;
  color: rgba(226, 232, 240, 0.7);
  margin-bottom: 6px;
}

.settings-page .setting-hint {
  font-size: 11px;
  font-weight: 300;
  color: rgba(226, 232, 240, 0.35);
  margin-top: 4px;
  line-height: 1.5;
}

/* ── Inputs: subtler ── */
.settings-page .setting-input,
.settings-page .form-input,
.settings-page .form-select,
.settings-page .form-textarea,
.settings-page select,
.settings-page textarea,
.settings-page input[type="text"],
.settings-page input[type="email"] {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 8px;
  font-size: 13px;
  font-weight: 400;
  padding: 10px 14px;
  color: var(--color-text-primary, #e2e8f0);
  transition: border-color 0.2s;
}

.settings-page .setting-input:focus,
.settings-page .form-input:focus,
.settings-page .form-select:focus,
.settings-page .form-textarea:focus,
.settings-page select:focus,
.settings-page textarea:focus,
.settings-page input[type="text"]:focus,
.settings-page input[type="email"]:focus {
  border-color: rgba(6, 182, 212, 0.3);
  outline: none;
  box-shadow: 0 0 0 2px rgba(6, 182, 212, 0.08);
}

/* ── Toggle Switches: already fine, just minor refinements ── */
.settings-page .switch-label {
  font-size: 13px;
  font-weight: 400;
  color: rgba(226, 232, 240, 0.65);
}

.settings-page .setting-switch input:checked ~ .switch-label {
  color: rgba(226, 232, 240, 0.9);
}

/* ── Section Borders: lighter ── */
.settings-page [style*="border-top: 1px solid var(--border)"] {
  border-top-color: rgba(255, 255, 255, 0.05) !important;
}

/* ── Buttons: use standard .btn from cards.css ── */
.settings-page .form-actions .btn {
  font-size: 13px;
  font-weight: 500;
  padding: 10px 20px;
  border-radius: 8px;
}

/* ── Integration Cards: cleaner grid ── */
.settings-page .integrations-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  overflow: hidden;
}

.settings-page .integration-card {
  background: var(--bg-surface, #0f172a);
  border: none;
  border-radius: 0;
  padding: 14px 16px;
  transition: background 0.2s;
}

.settings-page .integration-card:hover {
  background: rgba(255, 255, 255, 0.03);
}

.settings-page .integration-name {
  font-size: 13px;
  font-weight: 500;
}

.settings-page .integration-status {
  font-size: 11px;
  font-weight: 300;
}

/* ── Telegram Section (in its own tab) ── */
.tg-feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  overflow: hidden;
  margin: 16px 0;
}

.tg-feature-item {
  background: var(--bg-surface, #0f172a);
  padding: 16px;
  transition: background 0.2s;
}

.tg-feature-item:hover {
  background: rgba(255, 255, 255, 0.02);
}

.tg-feature-title {
  font-size: 12px;
  font-weight: 500;
  color: rgba(226, 232, 240, 0.8);
  margin-bottom: 4px;
}

.tg-feature-desc {
  font-size: 11px;
  font-weight: 300;
  color: rgba(226, 232, 240, 0.4);
  line-height: 1.5;
}

.tg-status-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 20px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  margin-bottom: 16px;
}

.tg-status-card.linked {
  border-color: rgba(16, 185, 129, 0.2);
  background: rgba(16, 185, 129, 0.03);
}

.tg-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(226, 232, 240, 0.3);
  flex-shrink: 0;
}

.tg-status-card.linked .tg-status-dot {
  background: #10b981;
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.4);
}

/* ── Pro badge on Telegram tab ── */
.settings-page .tab-badge {
  font-size: 9px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 4px;
  margin-left: 6px;
  vertical-align: middle;
}

.settings-page .tab-badge.pro {
  background: rgba(6, 182, 212, 0.15);
  color: #67e8f9;
}

/* ── Security tab ── */
/* Mirrors the integrations-grid visual language so the Security tab feels
 * native: subtle dividers between provider rows, identical button density,
 * same hover treatment. Each row is a flex meta+action pair that wraps on
 * narrow viewports. */
.settings-page .settings-provider-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  overflow: hidden;
}

.settings-page .settings-provider-row {
  background: var(--bg-surface, #0f172a);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px;
  flex-wrap: wrap;
  transition: background 0.2s;
}

.settings-page .settings-provider-row:hover {
  background: rgba(255, 255, 255, 0.03);
}

.settings-page .settings-provider-meta {
  min-width: 0;
  flex: 1;
}

.settings-page .settings-provider-name {
  font-size: 13px;
  font-weight: 500;
  color: rgba(226, 232, 240, 0.85);
}

.settings-page .settings-provider-status {
  font-size: 11px;
  font-weight: 300;
  color: rgba(226, 232, 240, 0.4);
  margin-top: 2px;
}

.settings-page .settings-provider-row.is-connected .settings-provider-status {
  color: rgba(16, 185, 129, 0.85);
}

.settings-page .settings-provider-row [data-provider-action][hidden] {
  display: none !important;
}

/* Danger zone — leaves the card chrome alone but signals tone via title
 * accent. Buttons inside remain the standard secondary variant when
 * disabled, since shipping a red destructive button for a non-functional
 * feature would be misleading. */
.settings-page .settings-danger-card .card-title {
  color: rgba(248, 113, 113, 0.95);
}

.settings-page .settings-danger-card .card-subtitle {
  color: rgba(248, 113, 113, 0.45);
}

/* ── Responsive ── */
@media (max-width: 768px) {
  .settings-page .card-header,
  .settings-page .card > .hd {
    padding: 16px 16px 10px;
  }

  .settings-page .card-body,
  .settings-page .card > .bd {
    padding: 6px 16px 16px;
  }

  .settings-page .integrations-grid {
    grid-template-columns: 1fr;
  }

  .tg-feature-grid {
    grid-template-columns: 1fr;
  }

  .settings-page .settings-provider-row {
    padding: 12px 14px;
  }
}
