/* ── Reset & Base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: #f9fafb;
  color: #1a1a2e;
  line-height: 1.6;
}

/* ── Variables ── */
:root {
  --teal:       #0d9488;
  --teal-dark:  #0f766e;
  --teal-light: #ccfbf1;
  --purple:     #7c3aed;
  --dark:       #1a1a2e;
  --mid:        #4b5563;
  --light:      #f3f4f6;
  --white:      #ffffff;
  --border:     #e5e7eb;
  --radius:     12px;
  --shadow:     0 4px 24px rgba(0,0,0,0.08);
  --shadow-lg:  0 8px 40px rgba(0,0,0,0.12);
}

/* ── Buttons ── */
.btn-primary {
  background: var(--teal);
  color: white;
  border: none;
  padding: 10px 22px;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  transition: background 0.2s, transform 0.1s;
}
.btn-primary:hover { background: var(--teal-dark); transform: translateY(-1px); }

.btn-ghost {
  background: none;
  border: 1px solid var(--border);
  color: var(--mid);
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  padding: 9px 20px;
  border-radius: 8px;
  text-decoration: none;
  display: inline-block;
  transition: background 0.2s;
}
.btn-ghost:hover { background: var(--light); }

/* ── Nav (shared) ── */
nav.topnav {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  padding: 0 2rem;
}
.nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 70px;
}
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}
.logo-icon {
  height: 48px;
  width: auto;
  border-radius: 10px;
}
.logo-text {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--dark);
}
.logo-text span { color: var(--teal); }
.nav-links {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  list-style: none;
}
.nav-links a {
  text-decoration: none;
  color: var(--mid);
  font-size: 0.9rem;
  font-weight: 500;
  transition: color 0.2s;
}
.nav-links a:hover { color: var(--teal); }
.nav-cta { display: flex; align-items: center; gap: 0.75rem; }

/* ── Login Page ── */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(160deg, #f0fdfa 0%, #faf5ff 100%);
}
.login-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 2.5rem 2rem;
  width: 100%;
  max-width: 400px;
}
.login-card .logo { justify-content: center; margin-bottom: 1.5rem; }
.login-card h2 {
  font-size: 1.4rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 0.25rem;
}
.login-card .subtitle {
  text-align: center;
  color: var(--mid);
  font-size: 0.9rem;
  margin-bottom: 1.75rem;
}
.form-group { margin-bottom: 1.1rem; }
.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--dark);
  margin-bottom: 0.4rem;
}
.form-group input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.95rem;
  transition: border-color 0.2s;
  outline: none;
}
.form-group input:focus { border-color: var(--teal); }
.login-card .btn-primary { width: 100%; text-align: center; padding: 12px; margin-top: 0.5rem; }
.error-msg {
  background: #fef2f2;
  color: #dc2626;
  border: 1px solid #fecaca;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 0.88rem;
  margin-bottom: 1rem;
}
.login-footer {
  text-align: center;
  margin-top: 1.25rem;
  font-size: 0.85rem;
  color: var(--mid);
}
.login-footer a { color: var(--teal); text-decoration: none; font-weight: 500; }

/* ── Dashboard Layout ── */
.dashboard-wrapper {
  display: flex;
  height: calc(100vh - 60px);
}

/* Sidebar */
.sidebar {
  width: 220px;
  min-width: 220px;
  background: var(--white);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 1.25rem 0;
  overflow-y: auto;
}
.sidebar-section-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: #9ca3af;
  padding: 0 1.25rem;
  margin-bottom: 0.5rem;
  margin-top: 0.75rem;
}
.sidebar-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 1.25rem;
  text-decoration: none;
  color: var(--mid);
  font-size: 0.9rem;
  font-weight: 500;
  border-left: 3px solid transparent;
  transition: background 0.15s, color 0.15s;
  cursor: pointer;
}
.sidebar-item:hover { background: var(--light); color: var(--dark); }
.sidebar-item.active {
  background: var(--teal-light);
  color: var(--teal-dark);
  border-left-color: var(--teal);
  font-weight: 600;
}
.sidebar-item .tool-icon { font-size: 1.1rem; width: 20px; text-align: center; }
.sidebar-badge {
  margin-left: auto;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--light);
  color: var(--mid);
}
.sidebar-badge.premium {
  background: var(--teal-light);
  color: var(--teal-dark);
}
.sidebar-badge.soon {
  background: #fffbeb;
  color: #d97706;
}

/* Top bar */
.dashboard-topbar {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.75rem;
  position: sticky;
  top: 0;
  z-index: 10;
}
.topbar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}
.topbar-logo img { height: 38px; border-radius: 8px; }
.topbar-logo-text { font-size: 1.05rem; font-weight: 700; color: var(--dark); }
.topbar-logo-text span { color: var(--teal); }
.topbar-right {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}
.token-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--teal-light);
  color: var(--teal-dark);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 999px;
}
.token-pill .token-icon { font-size: 1rem; }
.user-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--mid);
}
.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--teal), var(--purple));
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 0.8rem;
  font-weight: 700;
}
.logout-link {
  font-size: 0.83rem;
  color: var(--mid);
  text-decoration: none;
  padding: 5px 10px;
  border-radius: 6px;
  transition: background 0.2s;
}
.logout-link:hover { background: var(--light); color: #dc2626; }

/* Main content area */
.dashboard-body {
  display: flex;
  flex: 1;
  overflow: hidden;
}
.main-content {
  flex: 1;
  overflow-y: auto;
  padding: 2rem;
  background: #f9fafb;
}

/* Welcome state */
.welcome-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  text-align: center;
  color: var(--mid);
}
.welcome-state .big-icon { font-size: 4rem; margin-bottom: 1rem; }
.welcome-state h2 { font-size: 1.5rem; font-weight: 700; color: var(--dark); margin-bottom: 0.5rem; }
.welcome-state p { max-width: 380px; font-size: 0.95rem; }

/* Tool form panel */
.tool-panel { max-width: 680px; }
.tool-panel h2 { font-size: 1.4rem; font-weight: 700; margin-bottom: 0.25rem; }
.tool-panel .tool-desc { color: var(--mid); font-size: 0.9rem; margin-bottom: 1.75rem; }
.tool-panel .cost-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--teal-light);
  color: var(--teal-dark);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 999px;
  margin-left: 0.75rem;
  vertical-align: middle;
}

.form-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
  margin-bottom: 1.25rem;
  box-shadow: var(--shadow);
}
.form-card h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}
.form-row { display: flex; gap: 1rem; }
.form-row .form-group { flex: 1; }
.form-group { margin-bottom: 1rem; }
.form-group label {
  display: block;
  font-size: 0.83rem;
  font-weight: 600;
  color: var(--dark);
  margin-bottom: 0.35rem;
}
.form-group input:not([type="checkbox"]),
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.92rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s;
  background: var(--white);
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus { border-color: var(--teal); }
.form-group .hint { font-size: 0.78rem; color: #9ca3af; margin-top: 0.3rem; }

.generate-btn {
  background: linear-gradient(135deg, var(--teal), var(--teal-dark));
  color: white;
  border: none;
  padding: 13px 32px;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.1s;
}
.generate-btn:hover { opacity: 0.92; transform: translateY(-1px); }
