/* ============================================================
   PLAN22.NET - ACCOUNT AREA (auth + dashboard)
   Uses the same design tokens as styles.css
   ============================================================ */

:root {
  --color-bg: #ffffff;
  --color-surface: #f8fafd;
  --color-bg-alt: #f0f7ff;
  --color-text-primary: #1a1f2e;
  --color-text-secondary: #5a6478;
  --color-accent: #00D9FF;
  --color-accent-dark: #009ab8;
  --color-accent-soft: rgba(0, 217, 255, 0.10);
  --color-border: #e2e8f0;
  --color-nav-bg: #1a2030;
  --color-error: #b00020;
  --color-error-soft: #fdecea;
  --color-success: #1a7a3a;
  --color-success-soft: #e6f9ed;
  --color-warning: #b45309;
  --color-warning-soft: #fef3c7;
  --font-heading: 'Space Grotesk', sans-serif;
  --font-body: 'Inter', sans-serif;
  --shadow-sm: 0 1px 3px rgba(15, 20, 32, 0.06);
  --shadow-md: 0 6px 24px rgba(15, 20, 32, 0.08);
  --shadow-lg: 0 14px 50px rgba(15, 20, 32, 0.12);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: var(--font-body);
  background: var(--color-bg-alt);
  color: var(--color-text-primary);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: var(--font-heading);
  line-height: 1.25;
  color: var(--color-text-primary);
}

a { color: var(--color-accent-dark); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- Slim nav (account pages) ---------- */
.auth-nav {
  background: var(--color-nav-bg);
  padding: 0.85rem 0;
  position: sticky;
  top: 0;
  z-index: 50;
}
.auth-nav .container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.auth-nav .brand {
  color: #fff;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.15rem;
  text-decoration: none;
}
.auth-nav .brand:hover { text-decoration: none; }
.auth-nav .nav-back {
  color: rgba(255, 255, 255, 0.75);
  font-size: 0.85rem;
  font-weight: 500;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: color 0.2s;
}
.auth-nav .nav-back:hover { color: var(--color-accent); text-decoration: none; }
.auth-nav .lang-pill {
  display: inline-flex;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 20px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.06);
}
.auth-nav .lang-pill a {
  color: rgba(255, 255, 255, 0.60);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 0.22rem 0.65rem;
  line-height: 1.6;
  text-decoration: none;
}
.auth-nav .lang-pill a.active {
  background: var(--color-accent);
  color: #0f1420;
}
.auth-nav .lang-pill a:hover:not(.active) {
  background: rgba(255, 255, 255, 0.10);
  color: #fff;
}

/* ---------- Centered card layout (signin/signup/reset) ---------- */
.auth-shell {
  min-height: calc(100vh - 60px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2.5rem 1.25rem;
}
.auth-card {
  background: var(--color-bg);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 440px;
  padding: 2.25rem 2rem;
  border: 1px solid var(--color-border);
}
.auth-card h1 {
  font-size: 1.55rem;
  margin-bottom: 0.4rem;
  letter-spacing: -0.01em;
}
.auth-card .auth-sub {
  color: var(--color-text-secondary);
  font-size: 0.94rem;
  margin-bottom: 1.6rem;
}

/* Brand mark inside auth card */
.auth-logo {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  margin-bottom: 1.25rem;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--color-text-primary);
}
.auth-logo-dot {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  background: var(--color-accent);
  box-shadow: 0 0 0 4px var(--color-accent-soft);
}

/* ---------- Form fields ---------- */
.auth-form { display: flex; flex-direction: column; gap: 1rem; }

.auth-field { display: flex; flex-direction: column; gap: 0.35rem; }
.auth-field label {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--color-text-secondary);
  text-transform: uppercase;
}
.auth-field input {
  width: 100%;
  padding: 0.7rem 0.85rem;
  font-family: var(--font-body);
  font-size: 0.96rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--color-text-primary);
  transition: border-color 0.18s, box-shadow 0.18s;
}
.auth-field input:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px var(--color-accent-soft);
}
.auth-field-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.82rem;
}
.auth-field-row a { color: var(--color-accent-dark); font-weight: 500; }
.auth-checkbox {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  font-size: 0.85rem;
  color: var(--color-text-secondary);
  line-height: 1.5;
}
.auth-checkbox input { margin-top: 3px; accent-color: var(--color-accent-dark); }

/* Password strength */
.pw-strength {
  height: 4px;
  background: var(--color-border);
  border-radius: 99px;
  overflow: hidden;
  margin-top: 0.4rem;
}
.pw-strength-bar { height: 100%; width: 0; transition: width 0.25s, background 0.25s; }
.pw-strength-bar.lvl-1 { width: 25%; background: #ef4444; }
.pw-strength-bar.lvl-2 { width: 50%; background: #f59e0b; }
.pw-strength-bar.lvl-3 { width: 75%; background: #10b981; }
.pw-strength-bar.lvl-4 { width: 100%; background: #059669; }
.pw-strength-label {
  font-size: 0.72rem;
  color: var(--color-text-secondary);
  margin-top: 0.25rem;
}

/* ---------- Buttons ---------- */
.btn {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.96rem;
  padding: 0.78rem 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.18s, color 0.18s, border-color 0.18s, transform 0.05s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  text-decoration: none;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }

.btn-primary {
  background: var(--color-accent);
  color: #0f1420;
}
.btn-primary:hover:not(:disabled) {
  background: var(--color-accent-dark);
  color: #fff;
  text-decoration: none;
}
.btn-secondary {
  background: var(--color-surface);
  color: var(--color-text-primary);
  border-color: var(--color-border);
}
.btn-secondary:hover:not(:disabled) {
  background: var(--color-bg-alt);
  text-decoration: none;
}
.btn-block { width: 100%; }
.btn-ghost {
  background: transparent;
  color: var(--color-text-secondary);
  border: none;
  font-size: 0.85rem;
  padding: 0.3rem 0.5rem;
}
.btn-ghost:hover { color: var(--color-text-primary); text-decoration: underline; }

/* ---------- OAuth chips ---------- */
.auth-or {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 1.25rem 0 1rem;
  color: var(--color-text-secondary);
  font-size: 0.78rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.auth-or::before, .auth-or::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--color-border);
}
.oauth-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
}
.oauth-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  padding: 0.68rem 0.6rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--color-text-primary);
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
  transition: border-color 0.18s, background 0.18s;
}
.oauth-btn:hover { border-color: var(--color-text-primary); background: var(--color-surface); text-decoration: none; }
.oauth-btn svg { width: 18px; height: 18px; }
.magic-link-btn {
  width: 100%;
  margin-top: 0.6rem;
  padding: 0.7rem;
  border: 1px dashed var(--color-border);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--color-text-secondary);
  font-weight: 500;
  font-size: 0.88rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: border-color 0.18s, color 0.18s, background 0.18s;
}
.magic-link-btn:hover {
  border-color: var(--color-accent);
  color: var(--color-text-primary);
  background: var(--color-accent-soft);
}

/* ---------- Alerts ---------- */
.auth-alert {
  padding: 0.7rem 0.85rem;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  margin-bottom: 1rem;
  border: 1px solid transparent;
}
.auth-alert[hidden] { display: none; }
.auth-alert-error {
  background: var(--color-error-soft);
  color: var(--color-error);
  border-color: #f5c2c0;
}
.auth-alert-success {
  background: var(--color-success-soft);
  color: var(--color-success);
  border-color: #bfe7cf;
}
.auth-alert-info {
  background: var(--color-accent-soft);
  color: var(--color-accent-dark);
  border-color: rgba(0, 217, 255, 0.35);
}
.auth-alert-warning {
  background: var(--color-warning-soft);
  color: var(--color-warning);
  border-color: #fde68a;
}

.auth-footer-line {
  text-align: center;
  margin-top: 1.4rem;
  font-size: 0.88rem;
  color: var(--color-text-secondary);
}
.auth-footer-line a { color: var(--color-accent-dark); font-weight: 600; }

.auth-legal {
  text-align: center;
  margin-top: 1.5rem;
  font-size: 0.72rem;
  color: var(--color-text-secondary);
  line-height: 1.55;
}

/* ---------- Dashboard layout ---------- */
.dash-shell {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1.25rem 4rem;
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 2rem;
}
.dash-sidebar {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 1.4rem 1rem;
  height: fit-content;
  position: sticky;
  top: 80px;
  box-shadow: var(--shadow-sm);
}
.dash-user {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--color-border);
  margin-bottom: 0.8rem;
}
.dash-avatar {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--color-accent) 0%, var(--color-accent-dark) 100%);
  color: #0f1420;
  font-family: var(--font-heading);
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
}
.dash-user-name {
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--color-text-primary);
  line-height: 1.2;
  word-break: break-word;
}
.dash-user-email {
  font-size: 0.75rem;
  color: var(--color-text-secondary);
  word-break: break-word;
  margin-top: 2px;
}
.dash-nav {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}
.dash-nav a {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.55rem 0.7rem;
  border-radius: var(--radius-sm);
  color: var(--color-text-secondary);
  font-size: 0.92rem;
  font-weight: 500;
  transition: background 0.18s, color 0.18s;
}
.dash-nav a:hover {
  background: var(--color-surface);
  color: var(--color-text-primary);
  text-decoration: none;
}
.dash-nav a.active {
  background: var(--color-accent-soft);
  color: var(--color-accent-dark);
}
.dash-nav-icon { width: 18px; text-align: center; }
.dash-signout {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--color-border);
}

.dash-main { min-width: 0; }
.dash-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.4rem;
  flex-wrap: wrap;
}
.dash-header h1 {
  font-size: 1.6rem;
  letter-spacing: -0.01em;
}
.dash-header p {
  color: var(--color-text-secondary);
  font-size: 0.92rem;
  margin-top: 0.3rem;
}
.dash-section {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  margin-bottom: 1.4rem;
}
.dash-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.dash-section-head h2 {
  font-size: 1.1rem;
  letter-spacing: -0.005em;
}

/* License cards */
.license-grid { display: grid; gap: 1rem; }
.license-card {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 1.1rem 1.2rem;
  background: var(--color-surface);
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1rem;
  align-items: flex-start;
  transition: border-color 0.18s, box-shadow 0.18s;
}
.license-card:hover {
  border-color: rgba(0, 217, 255, 0.5);
  box-shadow: var(--shadow-sm);
}
.license-card .product {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 1rem;
  margin-bottom: 0.35rem;
  color: var(--color-text-primary);
}
.license-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1rem;
  font-size: 0.82rem;
  color: var(--color-text-secondary);
  margin-bottom: 0.6rem;
}
.license-key {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: 'Courier New', monospace;
  font-size: 0.86rem;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  padding: 0.32rem 0.65rem;
  border-radius: var(--radius-sm);
  color: var(--color-text-primary);
  letter-spacing: 0.04em;
}
.license-key button {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--color-text-secondary);
  font-size: 0.78rem;
  padding: 0;
}
.license-key button:hover { color: var(--color-accent-dark); }

.status-pill {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.18rem 0.55rem;
  border-radius: 99px;
}
.status-pill.active { background: var(--color-success-soft); color: var(--color-success); }
.status-pill.expired { background: var(--color-error-soft); color: var(--color-error); }
.status-pill.revoked { background: #e5e7eb; color: #4b5563; }
.status-pill.trial { background: var(--color-warning-soft); color: var(--color-warning); }

.empty-state {
  text-align: center;
  padding: 2.5rem 1rem;
  color: var(--color-text-secondary);
}
.empty-state .empty-icon {
  font-size: 2.4rem;
  color: var(--color-border);
  margin-bottom: 0.6rem;
}
.empty-state h3 {
  font-size: 1.05rem;
  color: var(--color-text-primary);
  margin-bottom: 0.4rem;
}
.empty-state p { font-size: 0.9rem; max-width: 380px; margin: 0 auto; }

/* Profile form rows */
.profile-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}
@media (max-width: 560px) {
  .profile-grid { grid-template-columns: 1fr; }
}

/* Loading spinner */
.spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(0, 0, 0, 0.15);
  border-top-color: var(--color-text-primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

.full-loader {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  color: var(--color-text-secondary);
  gap: 0.6rem;
}

/* Author footer line (rule: author visible) */
.author-mark {
  text-align: center;
  font-size: 0.78rem;
  color: var(--color-text-secondary);
  margin-top: 2.5rem;
  padding-top: 1rem;
}
.author-mark a { color: var(--color-accent-dark); }

/* Responsive */
@media (max-width: 880px) {
  .dash-shell { grid-template-columns: 1fr; padding-top: 1rem; }
  .dash-sidebar { position: static; }
}
@media (max-width: 480px) {
  .auth-card { padding: 1.6rem 1.3rem; }
  .oauth-grid { grid-template-columns: 1fr; }
  .license-card { grid-template-columns: 1fr; }
}
