/* pdkidp — Premium dark-mode design system */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

/* ── Design Tokens ─────────────────────────────────────────────────────── */
:root {
  --bg:          #0a0a0f;
  --bg-surface:  #111118;
  --bg-card:     #16161f;
  --bg-input:    #1c1c28;
  --border:      rgba(255,255,255,0.08);
  --border-hover:rgba(255,255,255,0.15);

  --text-primary:   #f1f0f7;
  --text-secondary: #8b8aa0;
  --text-muted:     #4b4a60;

  --accent:       #6366f1;
  --accent-hover: #5154d8;
  --accent-light: rgba(99,102,241,0.15);
  --accent-glow:  rgba(99,102,241,0.35);

  --success:      #10b981;
  --success-bg:   rgba(16,185,129,0.12);
  --error:        #ef4444;
  --error-bg:     rgba(239,68,68,0.12);

  --radius-sm: 8px;
  --radius:    12px;
  --radius-lg: 20px;

  --shadow-sm: 0 1px 3px rgba(0,0,0,0.4);
  --shadow:    0 4px 24px rgba(0,0,0,0.5);
  --shadow-lg: 0 12px 48px rgba(0,0,0,0.6), 0 0 80px rgba(99,102,241,0.05);
}

/* ── Reset ──────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; -webkit-text-size-adjust: 100%; }

body {
  font-family: 'Inter', system-ui, sans-serif;
  background-color: var(--bg);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--accent-hover); }

ul { list-style: none; }

/* ── Auth page layout (login, error) ───────────────────────────────────── */
.auth-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 24px;
  background:
    radial-gradient(ellipse 80% 60% at 50% -10%, rgba(99,102,241,0.18) 0%, transparent 60%),
    var(--bg);
}

.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 40px;
  box-shadow: var(--shadow-lg);
  animation: fadeUp 0.35s ease both;
}

.consent-card { max-width: 480px; }

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0);    }
}

.auth-logo {
  display: flex;
  justify-content: center;
  margin-bottom: 24px;
}

.auth-logo svg {
  filter: drop-shadow(0 4px 16px rgba(99,102,241,0.5));
}

.auth-title {
  font-size: 1.5rem;
  font-weight: 700;
  text-align: center;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  margin-bottom: 6px;
}

.auth-subtitle {
  font-size: 0.9rem;
  color: var(--text-secondary);
  text-align: center;
  margin-bottom: 28px;
}

/* ── Forms ──────────────────────────────────────────────────────────────── */
.auth-form, .profile-form { display: flex; flex-direction: column; gap: 18px; }

.form-group { display: flex; flex-direction: column; gap: 6px; }

.form-label {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-secondary);
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.form-input {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.95rem;
  font-family: inherit;
  padding: 12px 14px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  width: 100%;
}

.form-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.form-input:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.form-input::placeholder { color: var(--text-muted); }

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

@media (max-width: 480px) {
  .form-row { grid-template-columns: 1fr; }
}

/* ── Buttons ────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 22px;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
  text-decoration: none;
  white-space: nowrap;
}

.btn:active { transform: scale(0.98); }

.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 4px 14px var(--accent-glow);
}
.btn-primary:hover {
  background: var(--accent-hover);
  box-shadow: 0 6px 20px var(--accent-glow);
  color: #fff;
}

.btn-secondary {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
}
.btn-secondary:hover {
  border-color: var(--border-hover);
  color: var(--text-primary);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
}
.btn-ghost:hover { color: var(--text-primary); }

.btn-full { width: 100%; }

.btn-sm { padding: 7px 14px; font-size: 0.82rem; }

/* ── Alerts ─────────────────────────────────────────────────────────────── */
.alert {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  margin-bottom: 20px;
  animation: fadeIn 0.3s ease both;
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.alert-error  { background: var(--error-bg);   color: var(--error);   border: 1px solid rgba(239,68,68,0.25); }
.alert-success{ background: var(--success-bg); color: var(--success); border: 1px solid rgba(16,185,129,0.25); }

/* ── App page layout (profile) ─────────────────────────────────────────── */
.app-page { display: flex; flex-direction: column; min-height: 100vh; }

.app-header {
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(12px);
}

.app-header-inner {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 24px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.app-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1rem;
  color: var(--text-primary);
}

.app-nav {
  display: flex;
  align-items: center;
  gap: 16px;
}

.nav-user {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.app-main {
  flex: 1;
  padding: 40px 24px;
  background:
    radial-gradient(ellipse 60% 40% at 50% 0%, rgba(99,102,241,0.07) 0%, transparent 70%),
    var(--bg);
}

.profile-container {
  max-width: 680px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.page-title {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

/* ── Cards ──────────────────────────────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow-sm);
}

.profile-section { display: flex; flex-direction: column; gap: 20px; }

.section-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}

/* ── Scope consent ──────────────────────────────────────────────────────── */
.scope-list {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px 20px;
  margin-bottom: 24px;
}

.scope-list-label {
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.scope-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
  font-size: 0.9rem;
  color: var(--text-primary);
}

.consent-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 20px;
}

.consent-footer {
  text-align: center;
  font-size: 0.82rem;
  color: var(--text-muted);
}

/* ── Error page ─────────────────────────────────────────────────────────── */
.error-card { text-align: center; }

.error-icon {
  display: flex;
  justify-content: center;
  margin-bottom: 20px;
}

.error-code { font-size: 3rem; font-weight: 800; color: var(--error); }

.error-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 28px;
}

/* ── Scrollbar ──────────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--border-hover); }
