/* Clinora account/settings overlay — ported from dashboard/account */

#gpt-settings-root {
  --p-bg: #ffffff;
  --p-surface: #ffffff;
  --p-surface-muted: #f7f7f8;
  --p-border: #e5e7eb;
  --p-text: #1f2421;
  --p-text-muted: #68716c;
  --p-text-faint: #98a09c;
  --p-accent: #1b3a2f;
  --p-input-bg: #ffffff;
  --p-input-border: #e5e7eb;
}

#gpt-settings-root[data-platform-theme="dark"] {
  --p-bg: #000000;
  --p-surface: #000000;
  --p-surface-muted: #0a0a0a;
  --p-border: rgba(255, 255, 255, 0.12);
  --p-text: #ececec;
  --p-text-muted: rgba(255, 255, 255, 0.68);
  --p-text-faint: rgba(255, 255, 255, 0.42);
  --p-accent: #6ba88b;
  --p-input-bg: #0a0a0a;
  --p-input-border: rgba(255, 255, 255, 0.16);
}

.gpt-settings-backdrop {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 0.75rem;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(2px);
}

.gpt-settings-backdrop.is-open {
  display: flex;
}

.gpt-settings-backdrop[hidden] {
  display: none !important;
}

.gpt-settings-shell {
  display: flex;
  width: 100%;
  max-width: 56rem;
  height: min(720px, calc(100vh - 1.5rem));
  overflow: hidden;
  border-radius: 1rem;
  background: var(--p-surface);
  color: var(--p-text);
  border: 1px solid var(--p-border);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.28);
}

.gpt-settings-nav {
  width: 220px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  padding: 0.75rem;
  border-right: 1px solid var(--p-border);
}

.gpt-settings-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  margin-bottom: 1.25rem;
  border: none;
  border-radius: 0.5rem;
  background: transparent;
  color: var(--p-text);
  font-size: 1.25rem;
  cursor: pointer;
}

.gpt-settings-close:hover {
  background: var(--p-surface-muted);
}

.gpt-settings-tabs {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.gpt-settings-tab {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 0.75rem;
  padding: 0.625rem 0.75rem;
  border: none;
  border-radius: 0.5rem;
  background: transparent;
  color: var(--p-text-muted);
  text-align: left;
  cursor: pointer;
  transition: background 0.15s ease;
}

.gpt-settings-tab:hover {
  background: var(--p-surface-muted);
}

.gpt-settings-tab.is-active {
  background: var(--p-surface-muted);
  color: var(--p-text);
}

.gpt-settings-tab__icon {
  width: 1.25rem;
  text-align: center;
  font-size: 1rem;
}

.gpt-settings-tab__label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
}

.gpt-settings-tab__desc {
  display: block;
  font-size: 0.625rem;
  color: var(--p-text-faint);
}

.gpt-settings-workspace {
  margin-top: auto;
  padding-top: 0.75rem;
  border-top: 1px solid var(--p-border);
}

.gpt-settings-workspace-label {
  padding: 0 0.75rem;
  font-size: 0.625rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--p-text-faint);
}

.gpt-settings-workspace-name {
  margin-top: 0.25rem;
  padding: 0 0.75rem;
  font-size: 0.75rem;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gpt-settings-main {
  min-width: 0;
  flex: 1;
  overflow-y: auto;
}

.gpt-settings-content {
  max-width: 42rem;
  margin: 0 auto;
  padding: 1.5rem 2rem;
}

.gpt-settings-head {
  margin-bottom: 1.75rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--p-border);
}

.gpt-settings-head h1 {
  font-size: 1.25rem;
  font-weight: 600;
}

.gpt-settings-head p {
  margin-top: 0.25rem;
  font-size: 0.875rem;
  color: var(--p-text-muted);
}

.gpt-settings-section {
  margin-bottom: 1.5rem;
}

.gpt-settings-section + .gpt-settings-section {
  padding-top: 1.5rem;
  border-top: 1px solid var(--p-border);
}

.gpt-settings-section h2 {
  font-size: 0.875rem;
  font-weight: 600;
}

.gpt-settings-section > p {
  margin-top: 0.25rem;
  font-size: 0.75rem;
  color: var(--p-text-muted);
}

.gpt-settings-panel[hidden] {
  display: none !important;
}

.platform-input {
  background: var(--p-input-bg);
  border: 1px solid var(--p-input-border);
  color: var(--p-text);
}

.platform-text-muted {
  color: var(--p-text-muted);
}

.platform-text-faint {
  color: var(--p-text-faint);
}

.gpt-settings-theme-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  margin-top: 1rem;
}

.gpt-settings-theme-card {
  padding: 1rem;
  border: 1px solid var(--p-border);
  border-radius: 1rem;
  background: var(--p-surface);
  text-align: left;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.gpt-settings-theme-card:hover {
  transform: translateY(-2px);
}

.gpt-settings-theme-card.is-active {
  box-shadow: 0 0 0 2px var(--p-accent);
}

.gpt-settings-theme-preview {
  display: grid;
  grid-template-columns: 35% 65%;
  height: 4rem;
  margin-bottom: 1rem;
  overflow: hidden;
  border: 1px solid var(--p-border);
  border-radius: 0.75rem;
}

.gpt-settings-theme-preview__sidebar {
  background: #f7f7f8;
}

.gpt-settings-theme-card--dark .gpt-settings-theme-preview__sidebar {
  background: #000000;
}

.gpt-settings-theme-card--dark .gpt-settings-theme-preview__main {
  background: #000000;
}

.gpt-settings-theme-preview__main {
  background: #ffffff;
}

.gpt-settings-theme-card__title {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
}

.gpt-settings-theme-card__desc {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.75rem;
  color: var(--p-text-muted);
}

.gpt-settings-grid-2 {
  display: grid;
  gap: 1rem;
  margin-top: 1rem;
}

@media (min-width: 640px) {
  .gpt-settings-grid-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.gpt-settings-field label {
  display: block;
  font-size: 0.75rem;
  color: var(--p-text-muted);
}

.gpt-settings-field input,
.gpt-settings-field select,
.gpt-settings-field textarea {
  width: 100%;
  margin-top: 0.25rem;
  padding: 0.5rem 0.75rem;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  outline: none;
}

.gpt-settings-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--p-border);
}

.gpt-settings-toggle-row:last-child {
  border-bottom: none;
}

.gpt-settings-toggle {
  position: relative;
  width: 2.5rem;
  height: 1.5rem;
  flex-shrink: 0;
  border: none;
  border-radius: 999px;
  background: var(--p-border);
  cursor: pointer;
  transition: background 0.15s ease;
}

.gpt-settings-toggle.is-on {
  background: var(--p-accent);
}

.gpt-settings-toggle span {
  position: absolute;
  top: 0.25rem;
  left: 0.25rem;
  width: 1rem;
  height: 1rem;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
  transition: transform 0.15s ease;
}

.gpt-settings-toggle.is-on span {
  transform: translateX(1.25rem);
}

.gpt-settings-logo-card {
  display: block;
  padding: 0.75rem;
  border-radius: 0.75rem;
  cursor: pointer;
}

.gpt-settings-logo-card input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.gpt-settings-logo-preview {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 4rem;
  margin-top: 0.75rem;
  border: 1px dashed var(--p-border);
  border-radius: 0.5rem;
  font-size: 0.75rem;
  color: var(--p-text-faint);
}

.gpt-settings-logo-preview img {
  max-height: 3.5rem;
  max-width: 100%;
  object-fit: contain;
}

.gpt-settings-colour {
  font-size: 0.75rem;
}

.gpt-settings-colour span {
  display: block;
  margin-bottom: 0.25rem;
  color: var(--p-text-muted);
}

.gpt-settings-colour input[type="color"] {
  width: 4rem;
  height: 2.5rem;
  padding: 0.15rem;
  border: 1px solid var(--p-border);
  border-radius: 0.25rem;
  cursor: pointer;
}

.gpt-settings-canvas-preview {
  height: 2.5rem;
  border: 1px solid var(--p-border);
  border-radius: 0.5rem;
  padding: 0.5rem 0.75rem;
  font-size: 0.75rem;
  display: flex;
  align-items: center;
}

.gpt-settings-location-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.625rem 0.75rem;
  border-radius: 0.5rem;
  margin-top: 0.5rem;
}

.gpt-settings-btn-accent {
  border: none;
  border-radius: 0.5rem;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: #fff;
  background: var(--p-accent);
  cursor: pointer;
}

.gpt-settings-btn-accent:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.gpt-settings-btn-danger {
  margin-top: 0.5rem;
  border: none;
  border-radius: 0.5rem;
  padding: 0.625rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: #fff;
  background: #c0392b;
  cursor: pointer;
}

.gpt-settings-plan-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.gpt-settings-plan-row select {
  padding: 0.375rem 0.5rem;
  border-radius: 0.5rem;
  font-size: 0.75rem;
}
