/* ═══════ APP SHELL ═══════ */
.app-body {
  background: var(--bg-deep);
  min-height: 100vh;
  overflow-x: hidden;
}

/* AUTH SCREEN */
.auth-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  background: var(--bg-deep);
  position: relative;
}

.auth-screen::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(212, 165, 106, 0.07) 0%, transparent 70%);
  pointer-events: none;
}

.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--bg-card);
  border: 1px solid rgba(212, 165, 106, 0.12);
  border-radius: 20px;
  padding: 3rem 2.5rem;
  position: relative;
}

.auth-badge {
  font-family: var(--font-display);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.3em;
  color: var(--accent-gold);
  margin-bottom: 2rem;
}

.auth-title {
  font-family: var(--font-display);
  font-size: 2.2rem;
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 0.5rem;
}

.auth-sub {
  font-size: 0.9rem;
  color: var(--fg-muted);
  margin-bottom: 2rem;
}

.auth-toggle {
  margin-top: 1.5rem;
  font-size: 0.9rem;
  color: var(--fg-muted);
  text-align: center;
}

.auth-toggle a {
  color: var(--accent-gold);
  text-decoration: none;
  margin-left: 0.4rem;
  font-weight: 600;
}

/* FORMS */
.form-group {
  margin-bottom: 1.2rem;
}

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

.form-label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg-muted);
  margin-bottom: 0.5rem;
}

.form-input {
  width: 100%;
  background: var(--bg-elevated);
  border: 1px solid rgba(212, 165, 106, 0.12);
  border-radius: 10px;
  padding: 0.75rem 1rem;
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 0.95rem;
  transition: border-color 0.2s;
  outline: none;
  appearance: none;
}

.form-input:focus {
  border-color: rgba(212, 165, 106, 0.5);
}

.form-input::placeholder {
  color: rgba(154, 148, 144, 0.5);
}

select.form-input {
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%239a9490' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  padding-right: 2.5rem;
}

.form-error {
  color: #e07080;
  font-size: 0.85rem;
  margin-top: 0.5rem;
  padding: 0.6rem 0.8rem;
  background: rgba(224, 112, 128, 0.1);
  border-radius: 8px;
  border: 1px solid rgba(224, 112, 128, 0.2);
}

/* BUTTONS */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: linear-gradient(135deg, var(--accent-gold) 0%, #c49050 100%);
  color: #0a0a0f;
  border: none;
  border-radius: 10px;
  padding: 0.85rem 1.8rem;
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.15s;
}

.btn-primary:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-ghost {
  background: transparent;
  border: 1px solid rgba(212, 165, 106, 0.2);
  color: var(--accent-gold);
  border-radius: 8px;
  padding: 0.5rem 1rem;
  font-family: var(--font-body);
  font-size: 0.85rem;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}

.btn-ghost:hover {
  border-color: rgba(212, 165, 106, 0.5);
  background: rgba(212, 165, 106, 0.05);
}

.btn-danger {
  background: transparent;
  border: 1px solid rgba(224, 112, 128, 0.2);
  color: #e07080;
  border-radius: 8px;
  padding: 0.4rem 0.8rem;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-danger:hover {
  background: rgba(224, 112, 128, 0.1);
}

/* ═══════ SIDEBAR ═══════ */
#app-shell {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: 100vh;
}

.sidebar {
  background: var(--bg-card);
  border-right: 1px solid rgba(212, 165, 106, 0.07);
  display: flex;
  flex-direction: column;
  padding: 2rem 1.5rem;
  position: sticky;
  top: 0;
  height: 100vh;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 2.5rem;
}

.brand-glyph {
  color: var(--accent-gold);
  font-size: 1.2rem;
}

.brand-name {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.sidebar-level {
  margin-bottom: 2.5rem;
  padding: 1.2rem;
  background: var(--bg-elevated);
  border-radius: 12px;
  border: 1px solid rgba(212, 165, 106, 0.08);
}

.level-badge {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 800;
  color: var(--accent-gold);
  letter-spacing: 0.05em;
  margin-bottom: 0.7rem;
}

.xp-bar-wrap {
  height: 4px;
  background: rgba(212, 165, 106, 0.1);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 0.4rem;
}

.xp-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-gold), var(--accent-glow));
  border-radius: 2px;
  transition: width 0.6s ease;
}

.xp-label {
  font-size: 0.75rem;
  color: var(--fg-muted);
  font-weight: 500;
}

.nav-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  flex: 1;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0.9rem;
  border-radius: 10px;
  color: var(--fg-muted);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.2s;
}

.nav-link:hover {
  background: rgba(212, 165, 106, 0.05);
  color: var(--fg);
}

.nav-link.active {
  background: rgba(212, 165, 106, 0.1);
  color: var(--accent-gold);
}

.nav-icon {
  font-size: 0.9rem;
  width: 18px;
  text-align: center;
}

.sidebar-footer {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(212, 165, 106, 0.07);
}

.nav-username {
  font-size: 0.8rem;
  color: var(--fg-muted);
  font-weight: 500;
}

.logout-link {
  font-size: 0.8rem;
  color: rgba(154, 148, 144, 0.6);
  text-decoration: none;
  transition: color 0.2s;
}

.logout-link:hover {
  color: var(--fg-muted);
}

/* ═══════ MAIN CONTENT ═══════ */
.main-content {
  padding: 3rem 3rem;
  overflow-y: auto;
}

.view {
  max-width: 780px;
  animation: viewIn 0.25s ease;
}

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

.view-header {
  margin-bottom: 2.5rem;
}

.view-badge {
  font-family: var(--font-display);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.3em;
  color: var(--accent-gold);
  text-transform: uppercase;
  margin-bottom: 0.8rem;
}

.view-title {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  font-weight: 800;
  line-height: 1.1;
}

/* ═══════ TODAY STATS ═══════ */
.today-stats {
  display: flex;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.today-stat {
  background: var(--bg-card);
  border: 1px solid rgba(212, 165, 106, 0.08);
  border-radius: 14px;
  padding: 1.2rem 1.6rem;
  flex: 1;
}

.today-stat-val {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 0.2rem;
  transition: all 0.3s;
}

.today-stat-label {
  font-size: 0.78rem;
  color: var(--fg-muted);
  font-weight: 500;
}

/* ═══════ QUEST CARDS ═══════ */
.quests-list {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.quest-card {
  background: var(--bg-card);
  border: 1px solid rgba(212, 165, 106, 0.08);
  border-radius: 14px;
  padding: 1.3rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1.2rem;
  transition: border-color 0.25s, transform 0.2s;
}

.quest-card:hover {
  border-color: rgba(212, 165, 106, 0.2);
}

.quest-card.done {
  border-color: rgba(212, 165, 106, 0.25);
  background: linear-gradient(135deg, var(--bg-card) 0%, rgba(212, 165, 106, 0.04) 100%);
}

.quest-complete-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid rgba(212, 165, 106, 0.3);
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.2s;
  color: transparent;
  font-size: 1rem;
}

.quest-complete-btn:hover {
  border-color: var(--accent-gold);
  background: rgba(212, 165, 106, 0.1);
}

.quest-card.done .quest-complete-btn {
  border-color: var(--accent-gold);
  background: var(--accent-gold);
  color: #0a0a0f;
}

.quest-info {
  flex: 1;
}

.quest-title {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 0.3rem;
}

.quest-card.done .quest-title {
  text-decoration: line-through;
  opacity: 0.5;
}

.quest-meta {
  display: flex;
  gap: 0.8rem;
  align-items: center;
}

.quest-domain-tag {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.2rem 0.6rem;
  border-radius: 20px;
}

.domain-mindset  { background: rgba(199, 125, 186, 0.15); color: #c77dba; }
.domain-fitness  { background: rgba(106, 212, 165, 0.15); color: #6ad4a5; }
.domain-style    { background: rgba(240, 212, 138, 0.15); color: var(--accent-glow); }
.domain-finances { background: rgba(212, 165, 106, 0.15); color: var(--accent-gold); }

.quest-xp {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--accent-gold);
  font-family: var(--font-display);
}

.quest-streak {
  font-size: 0.72rem;
  color: var(--fg-muted);
}

.quest-actions {
  display: flex;
  gap: 0.5rem;
  opacity: 0;
  transition: opacity 0.2s;
}

.quest-card:hover .quest-actions {
  opacity: 1;
}

/* ═══════ DOMAINS VIEW ═══════ */
.domains-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

.domain-card {
  background: var(--bg-card);
  border: 1px solid rgba(212, 165, 106, 0.08);
  border-radius: 16px;
  padding: 2rem;
  transition: border-color 0.25s;
}

.domain-card:hover {
  border-color: rgba(212, 165, 106, 0.2);
}

.domain-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1.5rem;
}

.domain-card-name {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 800;
}

.domain-card-xp {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--accent-gold);
}

.domain-progress-bar {
  height: 6px;
  background: rgba(212, 165, 106, 0.1);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 0.6rem;
}

.domain-progress-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.8s ease;
}

.domain-progress-label {
  font-size: 0.78rem;
  color: var(--fg-muted);
}

/* ═══════ ACTIVITY ═══════ */
.activity-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.activity-item {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  padding: 1rem 0;
  border-bottom: 1px solid rgba(212, 165, 106, 0.06);
}

.activity-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.activity-info {
  flex: 1;
}

.activity-title {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 0.2rem;
}

.activity-time {
  font-size: 0.78rem;
  color: var(--fg-muted);
}

.activity-xp {
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--accent-gold);
}

/* ═══════ MODAL ═══════ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 10, 15, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  z-index: 100;
  backdrop-filter: blur(4px);
}

.modal-card {
  background: var(--bg-card);
  border: 1px solid rgba(212, 165, 106, 0.15);
  border-radius: 20px;
  padding: 2.5rem;
  width: 100%;
  max-width: 520px;
  animation: modalIn 0.2s ease;
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.95) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.8rem;
}

.modal-title {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 800;
}

.modal-close {
  background: none;
  border: none;
  color: var(--fg-muted);
  font-size: 1rem;
  cursor: pointer;
  padding: 0.3rem;
  transition: color 0.2s;
}

.modal-close:hover {
  color: var(--fg);
}

/* ═══════ XP TOAST ═══════ */
.xp-toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: var(--bg-elevated);
  border: 1px solid rgba(212, 165, 106, 0.3);
  border-radius: 12px;
  padding: 0.9rem 1.4rem;
  display: flex;
  align-items: center;
  gap: 0.7rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--accent-gold);
  z-index: 200;
  animation: toastIn 0.3s ease;
  box-shadow: 0 8px 32px rgba(212, 165, 106, 0.15);
}

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

.xp-toast-icon {
  font-size: 1.1rem;
}

/* ═══════ EMPTY STATE ═══════ */
.empty-state {
  text-align: center;
  padding: 4rem 2rem;
  color: var(--fg-muted);
}

.empty-glyph {
  font-size: 2rem;
  margin-bottom: 1rem;
  opacity: 0.3;
}

.empty-state a {
  color: var(--accent-gold);
  text-decoration: none;
  font-weight: 600;
}

/* ═══════ MOBILE ═══════ */
@media (max-width: 768px) {
  #app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    top: auto;
    height: auto;
    flex-direction: row;
    align-items: center;
    padding: 0.8rem 1rem;
    border-right: none;
    border-top: 1px solid rgba(212, 165, 106, 0.1);
    z-index: 50;
  }

  .sidebar-brand,
  .sidebar-level,
  .sidebar-footer {
    display: none;
  }

  .nav-links {
    flex-direction: row;
    width: 100%;
    justify-content: space-around;
    gap: 0;
  }

  .nav-link {
    flex-direction: column;
    gap: 0.2rem;
    font-size: 0.65rem;
    padding: 0.5rem;
    text-align: center;
  }

  .nav-icon {
    font-size: 1.1rem;
  }

  .main-content {
    padding: 1.5rem 1rem 6rem;
  }

  .today-stats {
    flex-direction: column;
    gap: 0.8rem;
  }

  .domains-grid {
    grid-template-columns: 1fr;
  }

  .form-row {
    grid-template-columns: 1fr;
  }
}
