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

:root {
  --brown: #A6714A;
  --brown-dark: #5E4130;
  --brown-darker: #4A3325;
  --cream: #FBF3EA;
  --card: #ffffff;
  --text: #3a2b1f;
  --muted: #8a7867;
  --danger: #c0392b;
  --accent: #E8A54B;
  --gradient-1: #F0AE55;
  --gradient-2: #8C4E24;
  --gradient-primary: linear-gradient(135deg, var(--gradient-1) 0%, var(--gradient-2) 100%);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Nunito', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--cream);
  color: var(--text);
}

h1, h2, h3 {
  font-family: 'Quicksand', 'Nunito', sans-serif;
  color: var(--brown-darker);
}

a { color: inherit; }

/* ---------- Login page ---------- */
.center-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 16px;
  text-align: center;
  background: radial-gradient(circle at top, #fff8ee 0%, var(--cream) 60%);
}
.center-page h1 { font-size: 2.4rem; }

/* ---------- App shell (sidebar + main) ---------- */
.app-shell {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 250px;
  flex-shrink: 0;
  background: linear-gradient(180deg, var(--brown-dark), var(--brown-darker));
  color: #f4e9dc;
  display: flex;
  flex-direction: column;
  padding: 22px 14px;
}

.sidebar-brand {
  font-family: 'Quicksand', sans-serif;
  font-weight: 700;
  font-size: 1.15rem;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 10px 18px 10px;
  border-bottom: 1px solid rgba(255,255,255,0.12);
  margin-bottom: 12px;
}
.brand-emoji {
  font-size: 1.2rem;
  width: 32px; height: 32px;
  border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  background: var(--gradient-primary);
  box-shadow: 0 2px 8px rgba(0,0,0,0.25);
}

.sidebar-guilds {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sidebar-guild {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 10px;
  text-decoration: none;
  color: #ecdfce;
  font-weight: 600;
  font-size: 0.92rem;
  transition: background 0.15s;
}
.sidebar-guild:hover { background: rgba(255,255,255,0.08); }
.sidebar-guild.active { background: var(--gradient-primary); color: #3a2410; box-shadow: 0 2px 10px rgba(0,0,0,0.2); }
.sidebar-guild.disabled { opacity: 0.45; cursor: default; }
.sidebar-guild-icon {
  width: 30px; height: 30px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid rgba(255,255,255,0.25);
}
.sidebar-guild-fallback {
  display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,0.15);
  font-size: 0.7rem;
}
.sidebar-guild-name {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.sidebar-guild-flag { margin-left: auto; opacity: 0.7; }

.sidebar-footer {
  border-top: 1px solid rgba(255,255,255,0.12);
  padding-top: 12px;
  font-size: 0.85rem;
}
.sidebar-footer a { text-decoration: none; opacity: 0.8; }
.sidebar-footer a:hover { opacity: 1; text-decoration: underline; }

.main {
  flex: 1;
  padding: 36px 44px;
  max-width: 980px;
}

.page-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 26px;
}
.page-header img {
  width: 52px; height: 52px; border-radius: 50%;
  padding: 2px;
  background: var(--gradient-primary);
  border: none;
}
.page-header h1 { margin: 0; font-size: 1.6rem; }
.page-header .subtitle { color: var(--muted); font-size: 0.9rem; }

/* ---------- Cards & modules ---------- */
.card {
  background: var(--card);
  border-radius: 16px;
  padding: 26px;
  margin-bottom: 22px;
  box-shadow: 0 3px 14px rgba(94, 65, 48, 0.08);
  border: 1px solid #f1e6d8;
}

.module-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 18px;
}

.module-card {
  background: var(--card);
  border-radius: 16px;
  padding: 22px;
  text-decoration: none;
  color: var(--text);
  box-shadow: 0 3px 14px rgba(94, 65, 48, 0.08);
  border: 1px solid #f1e6d8;
  transition: transform 0.15s, box-shadow 0.15s;
  display: block;
}
.module-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 22px rgba(94, 65, 48, 0.15);
}
.module-card .module-icon {
  width: 46px; height: 46px;
  border-radius: 12px;
  background: #f6e8d6;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem;
  margin-bottom: 14px;
}
.module-card h3 { margin: 0 0 6px 0; font-size: 1.05rem; }
.module-card p { margin: 0; color: var(--muted); font-size: 0.85rem; line-height: 1.4; }
.module-card.soon { opacity: 0.55; cursor: default; }
.module-card .soon-badge {
  display: inline-block; margin-top: 10px;
  font-size: 0.7rem; background: #eee; color: #888;
  padding: 2px 8px; border-radius: 999px;
}

/* ---------- Guild picker (pre-selection landing) ---------- */
.guild-list { list-style: none; padding: 0; }
.guild-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-radius: 12px;
  background: var(--card);
  margin-bottom: 10px;
  border: 1px solid #f1e6d8;
}

/* ---------- Forms ---------- */
.btn {
  display: inline-block;
  background: var(--gradient-primary);
  color: white;
  border: none;
  padding: 10px 22px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 700;
  text-decoration: none;
  font-family: inherit;
  box-shadow: 0 2px 8px rgba(140, 78, 36, 0.3);
  transition: filter 0.15s, transform 0.1s;
}
.btn:hover { filter: brightness(1.08); transform: translateY(-1px); }
.btn.secondary { background: #f1e4d3; color: var(--brown-darker); }
.btn.danger { background: var(--danger); }
.btn.small { padding: 7px 14px; font-size: 0.85rem; }

input, textarea, select {
  width: 100%;
  padding: 9px 12px;
  border: 1.5px solid #eaddc9;
  border-radius: 10px;
  font-size: 0.92rem;
  margin-top: 4px;
  margin-bottom: 12px;
  font-family: inherit;
  background: #fffdfa;
}
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--accent);
}

label { font-weight: 700; font-size: 0.82rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.02em; }

.category-card {
  border: 1.5px solid #eadfcf;
  border-radius: 14px;
  padding: 18px;
  margin-bottom: 16px;
  position: relative;
  background: #fffdfa;
}

.pill {
  display: inline-block;
  background: #f1e4d3;
  color: var(--brown-dark);
  padding: 3px 12px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
}

.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--brown-dark);
  color: white;
  padding: 13px 20px;
  border-radius: 10px;
  opacity: 0;
  transition: opacity 0.3s;
  font-weight: 600;
  box-shadow: 0 6px 18px rgba(0,0,0,0.2);
}
.toast.show { opacity: 1; }

.row-flex { display: flex; gap: 14px; align-items: flex-start; }
.row-flex > * { flex: 1; }

.question-row { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
.question-row input[type=text] { margin-bottom: 0; }
.question-row select { margin-bottom: 0; width: auto; }

.icon-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--danger);
  font-size: 0.95rem;
  font-weight: 700;
}

.helptext { color: var(--muted); margin-top: -8px; font-size: 0.88rem; }

.breadcrumb {
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 6px;
}
.breadcrumb a { text-decoration: none; color: var(--brown); font-weight: 700; }
