/* =========================================================================
   DopamineDriven — Auth + Dashboard CSS
   Mobile-first. Uses existing CSS custom properties from app.css.
   ========================================================================= */

/* ── Auth page shell ─────────────────────────────────────────────────────── */
.dd-auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 5rem 1.25rem 3rem;
  background: var(--bg);
}

.dd-auth-card {
  width: 100%;
  max-width: 440px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: clamp(2rem, 6vw, 2.75rem);
}

.dd-auth-logo {
  display: block;
  margin-bottom: 2rem;
}

/* ── Headings ────────────────────────────────────────────────────────────── */
.dd-auth-title {
  font-size: clamp(1.6rem, 4vw, 2.1rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.1;
  margin: 0 0 0.5rem;
}

.dd-auth-sub {
  font-size: 0.9rem;
  color: var(--muted);
  margin: 0 0 1.75rem;
  line-height: 1.55;
}

/* ── Banners / notices ───────────────────────────────────────────────────── */
.dd-auth-banner {
  border-radius: 10px;
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  line-height: 1.5;
  margin-bottom: 1.25rem;
}

.dd-auth-banner--ok {
  background: rgba(204, 255, 0, 0.08);
  border: 1px solid rgba(204, 255, 0, 0.25);
  color: var(--accent);
}

.dd-auth-banner--err {
  background: rgba(255, 80, 80, 0.08);
  border: 1px solid rgba(255, 80, 80, 0.25);
  color: #ff8080;
}

.dd-auth-resend-btn {
  display: inline;
  background: none;
  border: none;
  padding: 0;
  color: var(--accent);
  font-size: inherit;
  cursor: pointer;
  text-decoration: underline;
}
.dd-auth-resend-btn:hover { opacity: 0.8; }

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

.dd-auth-field { display: flex; flex-direction: column; gap: 0.45rem; }

.dd-auth-label {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.dd-auth-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.dd-auth-forgot {
  font-size: 0.78rem;
  color: var(--faint);
  transition: color 160ms ease;
}
.dd-auth-forgot:hover { color: var(--accent); }

.dd-auth-input-wrap {
  position: relative;
}

.dd-auth-input {
  width: 100%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.8rem 2.75rem 0.8rem 1rem;
  font-size: 1rem;
  color: var(--text);
  font-family: var(--font-sans);
  transition: border-color 180ms ease, background 180ms ease;
  -webkit-appearance: none;
}

.dd-auth-input:focus {
  outline: none;
  border-color: var(--accent);
  background: rgba(204, 255, 0, 0.04);
}

.dd-auth-input::placeholder { color: var(--faint); }

/* Password input inside wrap gets extra right padding for eye button */
.dd-auth-input-wrap .dd-auth-input { padding-right: 2.75rem; }

.dd-auth-eye {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--faint);
  cursor: pointer;
  padding: 0.25rem;
  display: flex;
  align-items: center;
  transition: color 160ms ease;
}
.dd-auth-eye:hover { color: var(--text); }

/* ── Password strength ───────────────────────────────────────────────────── */
.dd-pw-strength { margin-top: 0.5rem; }

.dd-pw-bar {
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.dd-pw-fill {
  height: 100%;
  width: 0%;
  border-radius: 2px;
  transition: width 300ms ease, background 300ms ease;
  background: var(--faint);
}

.dd-pw-fill[data-strength="1"] { width: 20%; background: #ff5050; }
.dd-pw-fill[data-strength="2"] { width: 40%; background: #ff8c00; }
.dd-pw-fill[data-strength="3"] { width: 60%; background: #ffd700; }
.dd-pw-fill[data-strength="4"] { width: 80%; background: #9aef4a; }
.dd-pw-fill[data-strength="5"] { width: 100%; background: var(--accent); }

.dd-pw-rules {
  list-style: none;
  padding: 0;
  margin: 0.6rem 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.6rem;
}

.dd-pw-rules li {
  font-size: 0.73rem;
  color: var(--faint);
  transition: color 200ms ease;
}

.dd-pw-rules li::before {
  content: '○ ';
  font-size: 0.65rem;
}

.dd-pw-rules li.is-met {
  color: var(--accent);
}

.dd-pw-rules li.is-met::before {
  content: '● ';
}

/* ── Remember / privacy ──────────────────────────────────────────────────── */
.dd-auth-remember {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.875rem;
  color: var(--muted);
  cursor: pointer;
}

.dd-auth-remember input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
  cursor: pointer;
}

.dd-auth-privacy {
  font-size: 0.78rem;
  color: var(--faint);
  line-height: 1.55;
  margin: 0;
}

.dd-auth-privacy a { color: var(--muted); text-decoration: underline; }
.dd-auth-privacy a:hover { color: var(--accent); }

/* ── Submit button ───────────────────────────────────────────────────────── */
.dd-auth-submit {
  width: 100%;
  padding: 0.9rem 1.5rem;
  background: var(--accent);
  color: #000;
  border: none;
  border-radius: 12px;
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: opacity 180ms ease, transform 120ms ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 0.25rem;
  font-family: var(--font-sans);
}

.dd-auth-submit:hover:not(:disabled) { opacity: 0.88; }
.dd-auth-submit:active:not(:disabled) { transform: scale(0.98); }
.dd-auth-submit:disabled { opacity: 0.4; cursor: not-allowed; }

/* Spinner (CSS-only rotating ring) */
.dd-auth-submit-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(0, 0, 0, 0.25);
  border-top-color: #000;
  border-radius: 50%;
  animation: dd-spin 0.7s linear infinite;
  flex-shrink: 0;
}

@keyframes dd-spin { to { transform: rotate(360deg); } }

/* ── Switch link ─────────────────────────────────────────────────────────── */
.dd-auth-switch {
  text-align: center;
  font-size: 0.875rem;
  color: var(--faint);
  margin: 1.25rem 0 0;
}

.dd-auth-switch a { color: var(--accent); font-weight: 700; }
.dd-auth-switch a:hover { text-decoration: underline; }

/* ── Honeypot: absolutely invisible ─────────────────────────────────────── */
.dd-auth-hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* =========================================================================
   DASHBOARD
   ========================================================================= */

.dd-dashboard {}

.dd-dash-hero {
  padding-top: clamp(5rem, 12vw, 8rem);
  padding-bottom: clamp(2.5rem, 5vw, 4rem);
  border-bottom: 1px solid var(--border);
}

.dd-dash-headline {
  font-size: clamp(2rem, 6vw, 4rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.1;
  margin: 0.5rem 0 0.75rem;
}

.dd-dash-sub {
  font-size: 1rem;
  color: var(--muted);
  margin: 0;
  max-width: 52ch;
  line-height: 1.6;
}

/* ── Tool cards ──────────────────────────────────────────────────────────── */
.dd-dash-tools {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin-bottom: 3.5rem;
}

@media (min-width: 640px) {
  .dd-dash-tools { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 900px) {
  .dd-dash-tools { grid-template-columns: repeat(3, 1fr); }
}

.dd-dash-tool-card {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1.75rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: 20px;
  text-decoration: none;
  color: inherit;
  transition: border-color 200ms ease, transform 200ms ease, background 200ms ease;
  position: relative;
}

.dd-dash-tool-card:hover {
  border-color: var(--accent);
  background: rgba(204, 255, 0, 0.04);
  transform: translateY(-3px);
}

.dd-dash-tool-icon {
  font-size: 2rem;
  line-height: 1;
}

.dd-dash-tool-name {
  font-size: 1.3rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin: 0 0 0.2rem;
}

.dd-dash-tool-tag {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 0.5rem;
}

.dd-dash-tool-desc {
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.6;
  margin: 0;
}

.dd-dash-tool-count {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  font-size: 0.72rem;
  font-family: var(--font-mono);
  color: var(--faint);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.2rem 0.5rem;
}

/* ── Account section ─────────────────────────────────────────────────────── */
.dd-dash-account {
  border-top: 1px solid var(--border);
  padding-top: 2.5rem;
  margin-bottom: 4rem;
}

.dd-dash-email {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--muted);
  margin: 0.5rem 0 1.5rem;
}

.dd-dash-account-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.dd-btn-ghost--danger {
  border-color: rgba(255, 80, 80, 0.3);
  color: #ff8080;
}

.dd-btn-ghost--danger:hover {
  border-color: #ff5050;
  background: rgba(255, 80, 80, 0.06);
  color: #ff5050;
}

.dd-dash-delete-hint {
  font-size: 0.78rem;
  color: var(--faint);
  margin: 0;
  line-height: 1.5;
}

/* ── Nav auth links (injected into navbar) ───────────────────────────────── */
.dd-nav-auth {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.dd-nav-user {
  font-size: 0.8rem;
  color: var(--muted);
}

.dd-nav-sign-in {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text);
  padding: 0.4rem 1rem;
  border: 1px solid var(--border-mid);
  border-radius: 8px;
  transition: border-color 160ms ease, color 160ms ease;
}

.dd-nav-sign-in:hover { border-color: var(--accent); color: var(--accent); }

@media (max-width: 640px) {
  .dd-nav-auth { display: none; }
}
