/* ============================================================
   ZeroDay — Account Pages CSS v7
   Auth (Discord-only) + Full Dashboard Layout
   ============================================================ */

/* ══════════════════════════════════════════════════════════
   AUTH PAGES
══════════════════════════════════════════════════════════ */
.auth-page {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  padding: 100px 24px 60px; position: relative; overflow: hidden;
}
.auth-card {
  width: 100%; max-width: 460px; position: relative; z-index: 2;
  background: var(--bg-3); border: 1px solid var(--border-2);
  border-radius: var(--radius-xl); padding: 44px;
  box-shadow: var(--shadow-lg);
}
.auth-logo {
  display: flex; align-items: center; justify-content: center;
  gap: 10px; margin-bottom: 28px;
  font-family: var(--font-display); font-size: 1.4rem; font-weight: 800;
}
.auth-title    { font-size: 1.55rem; text-align: center; margin-bottom: 6px; }
.auth-subtitle { font-size: 0.875rem; text-align: center; color: var(--text-3); margin-bottom: 28px; }

/* Discord button */
.btn-discord {
  width: 100%; display: flex; align-items: center; justify-content: center;
  gap: 10px; padding: 14px 20px; border-radius: var(--radius);
  background: #5865F2; color: #fff; font-weight: 700; font-size: 1rem;
  font-family: var(--font-body); cursor: pointer; border: none;
  transition: var(--transition); letter-spacing: 0.01em;
}
.btn-discord:hover { background: #4752c4; transform: translateY(-2px); box-shadow: 0 8px 24px rgba(88,101,242,0.35); }
.btn-discord svg   { flex-shrink: 0; }

/* Why Discord bullets */
.auth-why {
  margin: 20px 0; background: rgba(255,255,255,0.03);
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px 16px; display: flex; flex-direction: column; gap: 9px;
}
.auth-why-item {
  display: flex; align-items: center; gap: 10px;
  font-size: 0.82rem; color: var(--text-2);
}
.auth-why-item span { font-size: 1rem; flex-shrink: 0; }

.auth-notice {
  background: rgba(0,212,255,0.06); border: 1px solid rgba(0,212,255,0.18);
  border-radius: var(--radius); padding: 12px 14px;
  font-size: 0.79rem; color: var(--text-2); margin-bottom: 20px; line-height: 1.6;
}
.auth-switch {
  text-align: center; font-size: 0.83rem; color: var(--text-3); margin-top: 20px;
}
.auth-switch a { color: var(--accent); font-weight: 600; }
.auth-switch a:hover { text-decoration: underline; }

/* Alert */
.alert {
  padding: 12px 16px; border-radius: var(--radius);
  font-size: 0.85rem; display: none; line-height: 1.5;
}
.alert.show    { display: block; }
.alert.success { background: rgba(0,229,160,0.08); border: 1px solid rgba(0,229,160,0.25); color: var(--green); }
.alert.danger  { background: rgba(255,77,109,0.08); border: 1px solid rgba(255,77,109,0.25); color: var(--red); }

/* ══════════════════════════════════════════════════════════
   ACCOUNT LAYOUT
══════════════════════════════════════════════════════════ */
.account-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: calc(100vh - 64px);
  margin-top: 64px;
}

/* ── Sidebar ── */
.account-sidebar {
  background: var(--bg-2);
  border-right: 1px solid var(--border);
  padding: 28px 0 32px;
  position: sticky; top: 64px;
  height: calc(100vh - 64px);
  overflow-y: auto;
  display: flex; flex-direction: column;
}

/* Sidebar profile summary */
.sidebar-profile {
  display: flex; align-items: center; gap: 12px;
  padding: 0 20px 24px; border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
}
.sidebar-avatar {
  width: 44px; height: 44px; border-radius: 50%; flex-shrink: 0;
  background: linear-gradient(135deg, var(--accent), #0055aa);
  display: grid; place-items: center;
  font-family: var(--font-display); font-size: 1.1rem; font-weight: 800;
  color: #050810; overflow: hidden;
}
.sidebar-user-info { min-width: 0; }
.sidebar-display-name {
  font-weight: 700; font-size: .9rem;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sidebar-username {
  font-size: .75rem; color: var(--text-3); margin-top: 1px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sidebar-badge {
  display: inline-block; font-size: .62rem; font-weight: 800;
  letter-spacing: .07em; padding: 2px 8px; border-radius: 100px;
  margin-top: 5px; background: rgba(0,212,255,0.1);
  color: var(--accent); border: 1px solid rgba(0,212,255,0.2);
}
.sidebar-badge.plan-premium { background: rgba(255,184,48,0.12); color: var(--amber); border-color: rgba(255,184,48,0.25); }
.sidebar-badge.plan-certified { background: rgba(0,229,160,0.1); color: var(--green); border-color: rgba(0,229,160,0.2); }

/* Sidebar nav */
.sidebar-nav { flex: 1; padding: 0 12px; }
.sidebar-nav-group { margin-bottom: 8px; }
.sidebar-nav-label {
  font-size: .65rem; font-weight: 700; letter-spacing: .1em;
  text-transform: uppercase; color: var(--text-3);
  padding: 12px 8px 6px;
}
.sidebar-nav-item {
  display: flex; align-items: center; gap: 10px;
  width: 100%; padding: 9px 12px; border-radius: 10px;
  font-size: .84rem; font-weight: 500; color: var(--text-2);
  transition: var(--transition); background: none;
  border: none; cursor: pointer; text-align: left;
  margin-bottom: 2px;
}
.sidebar-nav-item:hover  { background: var(--surface-2); color: var(--text-1); }
.sidebar-nav-item.active { background: rgba(0,212,255,0.1); color: var(--accent); font-weight: 600; }
.sidebar-nav-item svg    { flex-shrink: 0; opacity: .7; }
.sidebar-nav-item.active svg { opacity: 1; }

/* Plan CTA at bottom of sidebar */
.sidebar-plan-cta {
  margin: 20px 16px 0;
  background: linear-gradient(135deg, rgba(0,212,255,0.08), rgba(0,85,170,0.1));
  border: 1px solid rgba(0,212,255,0.18); border-radius: 14px;
  padding: 18px 16px;
}
.sidebar-plan-cta-title { font-weight: 700; font-size: .88rem; margin-bottom: 4px; }
.sidebar-plan-cta-sub   { font-size: .75rem; color: var(--text-3); margin-bottom: 14px; }

/* ── Main content ── */
.account-main {
  background: var(--bg); padding: 40px 48px;
  overflow-y: auto; min-width: 0;
}

/* Sections */
.account-section { display: none; }
.account-section.active { display: block; animation: fade-in 0.2s ease; }
@keyframes fade-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.section-header { margin-bottom: 28px; }
.section-title  { font-size: 1.4rem; font-family: var(--font-display); font-weight: 700; margin-bottom: 5px; }
.section-sub    { font-size: .84rem; color: var(--text-3); }

/* Settings cards */
.settings-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 28px; margin-bottom: 20px;
}
.settings-card-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 16px; margin-bottom: 20px; flex-wrap: wrap;
}
.settings-card-title {
  font-size: .8rem; font-weight: 700; letter-spacing: .07em;
  text-transform: uppercase; color: var(--text-3); margin-bottom: 18px;
}
.settings-card-header .settings-card-title { margin-bottom: 0; }

.settings-actions {
  display: flex; align-items: center; gap: 14px; margin-top: 20px; flex-wrap: wrap;
}
.save-msg { font-size: .82rem; transition: opacity .4s; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 10px 20px; border-radius: var(--radius);
  font-weight: 600; font-size: .88rem; font-family: var(--font-body);
  cursor: pointer; border: none; transition: var(--transition);
}
.btn-primary   { background: var(--accent); color: #050810; }
.btn-primary:hover:not(:disabled) { background: #22deff; transform: translateY(-1px); }
.btn-secondary { background: var(--surface-2); color: var(--text-1); border: 1px solid var(--border-2); }
.btn-secondary:hover:not(:disabled) { background: rgba(255,255,255,0.1); }
.btn:disabled  { opacity: .5; cursor: not-allowed; }
.btn-danger-outline {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 18px; border-radius: var(--radius);
  background: rgba(255,77,109,0.06); border: 1px solid rgba(255,77,109,0.25);
  color: var(--red); font-weight: 600; font-size: .85rem;
  font-family: var(--font-body); cursor: pointer; transition: var(--transition);
}
.btn-danger-outline:hover { background: rgba(255,77,109,0.12); }
.icon-btn {
  width: 32px; height: 32px; border-radius: 8px;
  background: var(--surface-2); border: 1px solid var(--border);
  color: var(--text-2); display: grid; place-items: center;
  cursor: pointer; transition: var(--transition); flex-shrink: 0;
}
.icon-btn:hover { background: var(--surface); color: var(--text-1); }

/* Form elements */
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-group { margin-bottom: 16px; }
.form-label {
  display: block; font-size: .8rem; font-weight: 600;
  color: var(--text-2); margin-bottom: 7px;
}
.form-input {
  width: 100%; padding: 10px 14px; border-radius: var(--radius);
  background: var(--bg-2); border: 1px solid var(--border-2);
  color: var(--text-1); font-size: .88rem; font-family: var(--font-body);
  transition: var(--transition); outline: none;
}
.form-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(0,212,255,0.08); }
.form-input::placeholder { color: var(--text-3); }
textarea.form-input { resize: vertical; line-height: 1.55; }
.form-hint { font-size: .74rem; color: var(--text-3); margin-top: 5px; display: block; }

.input-prefix-wrap { position: relative; display: flex; align-items: center; }
.input-prefix {
  position: absolute; left: 12px; font-size: .82rem;
  color: var(--text-3); white-space: nowrap; pointer-events: none;
}
.form-input.with-prefix      { padding-left: 28px; }
.form-input.with-prefix-long { padding-left: 88px; }
.input-prefix-long { position: absolute; left: 12px; font-size: .78rem; color: var(--text-3); white-space: nowrap; }

/* Info grid */
.info-grid { display: flex; flex-direction: column; gap: 0; }
.info-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 0; border-bottom: 1px solid var(--border);
  flex-wrap: wrap; gap: 8px;
}
.info-row:last-child { border-bottom: none; padding-bottom: 0; }
.info-label { font-size: .82rem; color: var(--text-3); }
.info-value { font-size: .88rem; font-weight: 600; }

/* Account ID */
.account-id-display {
  display: flex; align-items: center; gap: 10px;
  background: var(--bg-2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 12px 16px;
  font-family: monospace; font-size: .95rem; color: var(--accent);
  letter-spacing: .05em;
}

/* Toggle switches */
.toggle-list { display: flex; flex-direction: column; gap: 0; }
.toggle-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 0; border-bottom: 1px solid var(--border); gap: 20px;
}
.toggle-row:last-child { border-bottom: none; padding-bottom: 0; }
.toggle-row:first-child { padding-top: 0; }
.toggle-label { font-size: .88rem; font-weight: 600; }
.toggle-sub   { font-size: .77rem; color: var(--text-3); margin-top: 3px; }
.toggle-switch { position: relative; width: 42px; height: 24px; flex-shrink: 0; }
.toggle-switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.toggle-track {
  position: absolute; inset: 0; border-radius: 100px;
  background: var(--border-2); cursor: pointer;
  transition: var(--transition);
}
.toggle-switch input:checked + .toggle-track { background: var(--accent); }
.toggle-track::after {
  content: ''; position: absolute; top: 3px; left: 3px;
  width: 18px; height: 18px; border-radius: 50%;
  background: #fff; transition: var(--transition);
}
.toggle-switch input:checked + .toggle-track::after { transform: translateX(18px); }

/* Status badge */
.status-dot-badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: .72rem; font-weight: 700; padding: 3px 10px;
  border-radius: 100px; white-space: nowrap;
  background: rgba(255,255,255,0.06); color: var(--text-3);
}
.status-dot-badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex-shrink: 0; }
.status-dot-badge.active { background: rgba(0,229,160,0.1); color: var(--green); }

/* Linked accounts */
.linked-account-row {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 0; border-bottom: 1px solid var(--border);
}
.linked-account-row:last-child { border-bottom: none; padding-bottom: 0; }
.linked-account-row:first-child { padding-top: 0; }
.linked-account-icon {
  width: 38px; height: 38px; border-radius: 10px;
  display: grid; place-items: center; flex-shrink: 0;
}
.discord-icon { background: #5865F2; color: #fff; }
.github-icon  { background: #24292f; color: #fff; border: 1px solid var(--border); }
.linked-account-info { flex: 1; min-width: 0; }
.linked-account-name   { font-weight: 600; font-size: .88rem; }
.linked-account-detail { font-size: .77rem; color: var(--text-3); margin-top: 2px; }

/* Server row */
.server-row {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 0; border-bottom: 1px solid var(--border);
}
.server-row:last-child { border-bottom: none; }
.server-row-icon { font-size: 1.3rem; flex-shrink: 0; }
.server-row-info { flex: 1; min-width: 0; }
.server-row-name { font-weight: 600; font-size: .88rem; display: flex; align-items: center; gap: 8px; }
.server-row-id   { font-size: .74rem; color: var(--text-3); margin-top: 2px; font-family: monospace; }

/* Profile preview */
.profile-preview-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); overflow: hidden; margin-bottom: 20px;
}
.profile-banner { height: 90px; }
.profile-preview-body {
  display: flex; align-items: flex-end; gap: 16px;
  padding: 0 24px 20px; position: relative;
}
.profile-preview-avatar-wrap { position: relative; margin-top: -28px; }
.profile-preview-avatar {
  width: 72px; height: 72px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), #0055aa);
  border: 3px solid var(--bg-2);
  display: grid; place-items: center;
  font-size: 1.6rem; font-weight: 800; color: #050810;
  overflow: hidden; font-family: var(--font-display);
}
.avatar-change-btn {
  position: absolute; bottom: 0; right: 0;
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--accent); color: #050810;
  display: grid; place-items: center; cursor: pointer;
  border: 2px solid var(--bg-2); transition: var(--transition);
}
.avatar-change-btn:hover { background: #22deff; }
.profile-preview-info { padding-bottom: 4px; }
.profile-preview-name     { font-weight: 700; font-size: 1.05rem; }
.profile-preview-username { font-size: .8rem; color: var(--text-3); margin-top: 2px; }
.profile-preview-id       { font-size: .72rem; color: var(--text-3); font-family: monospace; margin-top: 4px; }

/* Discord sync */
.discord-sync-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; flex-wrap: wrap;
}

/* Session */
.session-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap;
}

/* Activity */
.activity-list { display: flex; flex-direction: column; gap: 0; }
.activity-item {
  display: flex; align-items: center; gap: 12px;
  padding: 13px 0; border-bottom: 1px solid var(--border);
}
.activity-item:last-child { border-bottom: none; }
.activity-icon { font-size: 1.2rem; flex-shrink: 0; width: 32px; text-align: center; }
.activity-info { flex: 1; min-width: 0; }
.activity-title { font-size: .88rem; font-weight: 600; }
.activity-meta  { font-size: .74rem; color: var(--text-3); margin-top: 2px; }
.activity-empty {
  text-align: center; padding: 40px 20px;
  color: var(--text-3); display: flex; flex-direction: column;
  align-items: center; gap: 10px;
}
.activity-empty p { font-size: .85rem; }

/* Certification */
.cert-status-display {
  display: flex; align-items: center; gap: 14px;
  padding: 16px; background: var(--bg-2);
  border: 1px solid var(--border); border-radius: var(--radius);
}
.cert-dot {
  width: 12px; height: 12px; border-radius: 50%; flex-shrink: 0;
}
.cert-dot.none     { background: var(--text-3); }
.cert-dot.pending  { background: var(--amber); box-shadow: 0 0 8px var(--amber); }
.cert-dot.approved { background: var(--green); box-shadow: 0 0 8px var(--green); animation: pulse-glow 2s infinite; }
.cert-status-label { font-weight: 700; font-size: .92rem; }
.cert-status-sub   { font-size: .78rem; color: var(--text-3); margin-top: 3px; }

.info-box {
  background: rgba(255,184,48,0.07); border: 1px solid rgba(255,184,48,0.2);
  border-radius: var(--radius); padding: 12px 14px;
  font-size: .8rem; color: var(--amber); line-height: 1.55;
}

/* API Management */
.planned-notice {
  display: flex; align-items: flex-start; gap: 14px;
  background: rgba(255,184,48,0.06); border: 1px solid rgba(255,184,48,0.18);
  border-radius: var(--radius-lg); padding: 20px 22px; margin-bottom: 20px;
}
.planned-notice-icon { font-size: 1.5rem; flex-shrink: 0; margin-top: 1px; }
.api-keys-empty {
  display: flex; flex-direction: column; align-items: center;
  gap: 10px; padding: 32px 20px; color: var(--text-3); text-align: center;
}
.api-keys-empty p { font-size: .84rem; }

/* Empty state */
.empty-state {
  display: flex; flex-direction: column; align-items: center;
  gap: 10px; padding: 40px 20px; color: var(--text-3); text-align: center;
}
.empty-state p { font-size: .85rem; }

/* Logout button in navbar */
.dash-logout {
  background: rgba(255,77,109,0.07); border: 1px solid rgba(255,77,109,0.2);
  color: var(--red); padding: 8px 16px; border-radius: var(--radius);
  font-size: .85rem; font-weight: 600; font-family: var(--font-body);
  cursor: pointer; transition: var(--transition);
}
.dash-logout:hover { background: rgba(255,77,109,0.14); }

/* Modal */
.modal-overlay {
  position: fixed; inset: 0; z-index: 2000;
  background: rgba(0,0,0,0.75); backdrop-filter: blur(4px);
  display: none; align-items: center; justify-content: center; padding: 24px;
}
.modal-overlay.open { display: flex; }
.modal-box {
  background: var(--bg-3); border: 1px solid var(--border-2);
  border-radius: var(--radius-xl); padding: 40px;
  width: 100%; box-shadow: var(--shadow-lg); position: relative;
}
.modal-title    { font-size: 1.25rem; margin-bottom: 8px; font-family: var(--font-display); }
.modal-subtitle { font-size: .875rem; color: var(--text-2); line-height: 1.6; }

/* Animations */
@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 8px var(--green); }
  50%       { box-shadow: 0 0 16px var(--green); }
}

/* ══════════════════════════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════════════════════════ */
@media (max-width: 960px) {
  .account-layout { grid-template-columns: 1fr; }
  .account-sidebar {
    position: static; height: auto; border-right: none;
    border-bottom: 1px solid var(--border); padding: 20px 0 0;
  }
  .sidebar-nav { display: flex; flex-wrap: wrap; gap: 4px; padding: 8px 12px 16px; }
  .sidebar-nav-group { display: contents; }
  .sidebar-nav-label { display: none; }
  .sidebar-nav-item  { width: auto; padding: 8px 14px; font-size: .8rem; }
  .sidebar-plan-cta  { display: none; }
  .account-main { padding: 28px 20px; }
}
@media (max-width: 640px) {
  .auth-card  { padding: 28px 20px; }
  .form-row   { grid-template-columns: 1fr; }
  .account-main { padding: 20px 16px; }
  .settings-card { padding: 20px 16px; }
}
