/* ===== Account Settings Page — Self-contained ===== */

/* Base reset */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Poppins', sans-serif;
  background: #f8fafc;
  min-height: 100vh;
  color: #1e293b;
  overflow-x: hidden;
}

a { text-decoration: none; }

.content-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  width: 100%;
  min-height: 100vh;
}

/* Settings page container */
.settings-page {
  flex: 1;
  padding: 1.25rem 1.5rem;
  max-width: 960px;
  width: 100%;
  margin: 0 auto;
}

/* Page header */
.settings-page-header {
  margin-bottom: 1rem;
}

.settings-page-header h1 {
  font-size: 1.25rem;
  color: #1e293b;
  margin-bottom: 0.1rem;
  font-weight: 600;
}

.settings-page-header p {
  color: #64748b;
  font-size: 0.8rem;
}

/* Free tier banner */
.free-tier-banner {
  background: linear-gradient(135deg, #fefce8 0%, #fff7ed 100%);
  border: 1px solid #fde68a;
  border-radius: 0.4rem;
  padding: 0.55rem 1rem;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.free-tier-banner .banner-text {
  font-size: 0.78rem;
  color: #92400e;
  line-height: 1.4;
}

.free-tier-banner .banner-text strong {
  margin-right: 0.3rem;
}

/* 3-column grid */
.settings-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.85rem;
}

.settings-grid .span-2 {
  grid-column: span 2;
}

.settings-grid .full-width {
  grid-column: 1 / -1;
}

/* Section cards */
.settings-section {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 0.4rem;
  padding: 0.85rem;
}

.settings-section-header {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.6rem;
  padding-bottom: 0.45rem;
  border-bottom: 1px solid #e2e8f0;
}

.settings-section-header i {
  color: #4092cc;
  font-size: 0.82rem;
}

.settings-section-header h2 {
  font-size: 0.88rem;
  color: #1e293b;
  font-weight: 600;
  text-align: left;
  margin: 0;
}

.settings-section-header h2::after {
  display: none;
}

/* Setting rows */
.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.4rem 0;
  border-bottom: 1px solid #f1f5f9;
  gap: 0.5rem;
}

.setting-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.setting-row:first-child {
  padding-top: 0;
}

.setting-label {
  flex: 1;
  min-width: 0;
}

.setting-label h3 {
  font-size: 0.8rem;
  color: #1e293b;
  font-weight: 500;
  line-height: 1.3;
}

.setting-label p {
  font-size: 0.72rem;
  color: #64748b;
  line-height: 1.3;
  margin: 0;
}

.setting-value {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
}

.setting-value .value-text {
  font-size: 0.78rem;
  color: #1e293b;
  background: #f8fafc;
  padding: 0.2rem 0.5rem;
  border-radius: 0.3rem;
  border: 1px solid #e2e8f0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 180px;
}

/* Inputs */
.setting-input {
  width: 72px;
  padding: 0.3rem 0.5rem;
  border: 1px solid #e2e8f0;
  border-radius: 0.35rem;
  font-size: 0.78rem;
  font-family: 'Poppins', sans-serif;
  color: #1e293b;
  background: white;
}

.setting-input:focus {
  outline: none;
  border-color: #4092cc;
  box-shadow: 0 0 0 2px rgba(64, 146, 204, 0.1);
}

/* Buttons */
.btn {
  padding: 0.3rem 0.7rem;
  border: none;
  border-radius: 0.35rem;
  cursor: pointer;
  font-family: 'Poppins', sans-serif;
  font-size: 0.78rem;
  font-weight: 500;
  transition: all 0.15s;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  white-space: nowrap;
}

.btn-primary { background: #4092cc; color: white; }
.btn-primary:hover { background: #3582b8; }
.btn-success { background: #22c55e; color: white; }
.btn-success:hover { background: #16a34a; }
.btn-danger { background: #ef4444; color: white; }
.btn-danger:hover { background: #dc2626; }
.btn-polar { background: #000; color: #fff; font-weight: 500; }
.btn-polar:hover { background: #222; }
.btn-outline { background: transparent; color: #64748b; border: 1px solid #e2e8f0; }
.btn-outline:hover { background: #f8fafc; color: #1e293b; }

/* Stacked buttons (e.g. subscription section) */
.btn-stack {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.3rem;
}

/* Estimate text */
.estimate-text {
  font-size: 0.68rem;
  color: #4092cc;
  font-weight: 500;
  margin-top: 0.15rem;
}

/* Danger zone */
.settings-section.danger-zone { border-color: #fecaca; }
.settings-section.danger-zone .settings-section-header { border-bottom-color: #fecaca; }
.settings-section.danger-zone .settings-section-header i { color: #ef4444; }
.settings-section.danger-zone .settings-section-header h2 { color: #ef4444; }

/* ===== Login / Register form overrides ===== */

.dashboard-container {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 2rem 1rem;
  flex: 1;
}

/* Override schedule-generator form-group styles for login/register */
.dashboard-container .form-container {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 0.5rem;
  padding: 2rem;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.06);
}

.dashboard-container .form-container h2 {
  font-size: 1.3rem;
  color: #1e293b;
  font-weight: 600;
  margin-bottom: 1.25rem;
  text-align: center;
}

.dashboard-container .form-container h2::after {
  display: none;
}

.dashboard-container .form-group {
  width: 100%;
  text-align: left;
  margin-bottom: 1rem;
}

.dashboard-container .form-group label {
  display: block;
  text-align: left;
  font-weight: 500;
  color: #374151;
  font-size: 0.85rem;
  margin-bottom: 0.35rem;
}

.dashboard-container .form-group input {
  text-align: left;
  border-radius: 0.4rem;
  height: 42px;
  font-size: 0.9rem;
}

.dashboard-container .form-group input::placeholder {
  text-align: left;
}

.dashboard-container .button-container {
  margin-top: 1.25rem;
  margin-bottom: 0.75rem;
}

.dashboard-container .button-container button {
  width: 100%;
  background-color: #4092cc;
  border-radius: 0.4rem;
  font-size: 0.95rem;
  font-weight: 600;
  padding: 0.65rem 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
}

.dashboard-container .button-container button:hover {
  background-color: #3582b8;
  transform: none;
  box-shadow: 0 2px 8px rgba(64,146,204,0.3);
}

.dashboard-container .auth-links {
  text-align: center;
  margin-top: 0.75rem;
}

.dashboard-container .auth-links p {
  font-size: 0.82rem;
  color: #64748b;
  margin-bottom: 0.3rem;
}

.dashboard-container .auth-links a {
  color: #4092cc;
  font-weight: 500;
}

.dashboard-container .auth-links a:hover {
  text-decoration: underline;
}

.message {
  padding: 0.6rem 0.85rem;
  border-radius: 0.4rem;
  font-size: 0.82rem;
  margin-bottom: 1rem;
  display: none;
}

.message.success {
  background: #dcfce7;
  color: #166534;
  border: 1px solid #bbf7d0;
  display: block;
}

.message.error {
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #fecaca;
  display: block;
}

/* Avatar */
.avatar-wrapper {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid #e2e8f0;
  flex-shrink: 0;
  cursor: pointer;
}

.avatar-img {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: cover;
  display: block;
}

.avatar-placeholder {
  width: 100%;
  height: 100%;
  background: #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #94a3b8;
  font-size: 1rem;
}

/* ===== Responsive */
@media (max-width: 768px) {
  .settings-grid {
    grid-template-columns: 1fr;
  }

  .settings-grid .span-2,
  .settings-grid .full-width {
    grid-column: 1;
  }

  .settings-page {
    padding: 1rem;
  }

  .setting-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.4rem;
  }

  .setting-value {
    width: 100%;
  }

  .setting-input {
    flex: 1;
  }

  .free-tier-banner {
    flex-direction: column;
    text-align: center;
  }

  .setting-value .value-text {
    max-width: none;
  }
}
