@import url('https://fonts.googleapis.com/css2?family=DM+Mono:wght@400;500&family=Fraunces:ital,wght@0,300;0,600;1,300&family=DM+Sans:wght@300;400;500;600&display=swap');

:root {
  --teal:        #0f9b72;
  --teal-light:  #e6f7f2;
  --teal-mid:    #c0ead8;
  --purple:      #6c63d5;
  --purple-light:#f0effe;
  --amber:       #b06a10;
  --amber-light: #fef3e2;
  --red:         #c0392b;
  --bg:          #f7f8fb;
  --card:        #ffffff;
  --border:      #e4e8ef;
  --text:        #1a1f2e;
  --text-2:      #4a5168;
  --text-3:      #8b93a7;
  --header-bg:   #0f1117;
  --header-border:#1e2330;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'DM Sans', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: var(--teal); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ─── HEADER ─── */
.app-header {
  height: 56px;
  background: var(--header-bg);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 16px;
  flex-shrink: 0;
  border-bottom: 1px solid var(--header-border);
}
.header-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  text-decoration: none;
}
.header-logo img { width: 28px; height: 28px; object-fit: contain; }
.header-logo span {
  font-family: 'Fraunces', serif;
  font-weight: 300;
  font-size: 15px;
  color: #dde2ee;
}
.header-nav {
  display: flex;
  gap: 4px;
  margin-left: 24px;
}
.header-nav a {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-3);
  padding: 8px 14px;
  border-radius: 6px;
  text-decoration: none;
  transition: all 0.15s;
}
.header-nav a:hover { color: #dde2ee; background: rgba(255,255,255,0.05); }
.header-nav a.active { color: white; background: rgba(255,255,255,0.1); }
.header-spacer { flex: 1; }
.header-wallet {
  font-family: 'DM Mono', monospace;
  font-size: 12px;
  color: var(--teal);
  background: rgba(15,155,114,0.1);
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
}
.header-user {
  width: 34px; height: 34px;
  background: #1a1f2e;
  border: 1px solid #2a3045;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: border-color 0.15s;
}
.header-user:hover { border-color: var(--teal); }
.header-user svg { stroke: var(--text-3); }
.header-auth {
  display: flex;
  gap: 8px;
}
.btn-ghost {
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  color: var(--text-3);
  background: transparent;
  border: 1px solid #2a3045;
  padding: 7px 16px;
  border-radius: 7px;
  cursor: pointer;
  transition: all 0.15s;
}
.btn-ghost:hover { color: white; border-color: var(--teal); }
.btn-primary {
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  font-weight: 500;
  color: white;
  background: var(--teal);
  border: none;
  padding: 8px 18px;
  border-radius: 7px;
  cursor: pointer;
  transition: opacity 0.15s;
}
.btn-primary:hover { opacity: 0.9; }
.btn-primary:disabled { opacity: 0.4; cursor: not-allowed; }

/* ─── MAIN CONTENT ─── */
.app-main {
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* ─── LANDING ─── */
.landing-hero {
  text-align: center;
  padding: 80px 24px 60px;
  max-width: 680px;
  margin: 0 auto;
}
.landing-hero h1 {
  font-family: 'Fraunces', serif;
  font-size: 56px;
  font-weight: 600;
  margin-bottom: 12px;
  line-height: 1.1;
}
.landing-hero .tagline {
  font-size: 22px;
  color: var(--text-2);
  font-weight: 300;
  margin-bottom: 32px;
  line-height: 1.5;
}
.landing-hero .cta-row {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-bottom: 48px;
}
.landing-hero .btn-primary { font-size: 15px; padding: 12px 28px; border-radius: 10px; }
.landing-hero .btn-ghost { font-size: 15px; padding: 12px 28px; border-radius: 10px; color: var(--text-2); border-color: var(--border); }

.landing-values {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  max-width: 900px;
  margin: 0 auto 60px;
  padding: 0 24px;
}
.value-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 28px 24px;
  text-align: center;
}
.value-card .icon {
  font-size: 32px;
  margin-bottom: 14px;
}
.value-card h3 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 8px;
}
.value-card p {
  font-size: 13.5px;
  color: var(--text-2);
  line-height: 1.6;
}

/* ─── AUTH FORMS ─── */
.auth-page {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  padding: 40px 24px;
}
.auth-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 40px 44px;
  width: 100%;
  max-width: 420px;
}
.auth-card h1 {
  font-family: 'Fraunces', serif;
  font-size: 28px;
  font-weight: 600;
  margin-bottom: 6px;
}
.auth-card .subtitle {
  font-size: 14px;
  color: var(--text-2);
  margin-bottom: 28px;
}
.form-field {
  margin-bottom: 18px;
}
.form-field label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-2);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.form-field input, .form-field textarea {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  color: var(--text);
  outline: none;
  transition: border-color 0.15s;
}
.form-field input:focus, .form-field textarea:focus { border-color: var(--teal); }
.form-field textarea { resize: vertical; min-height: 80px; }
.form-actions {
  margin-top: 24px;
}
.form-actions .btn-primary { width: 100%; padding: 13px; font-size: 15px; }
.form-footer {
  text-align: center;
  margin-top: 18px;
  font-size: 13px;
  color: var(--text-3);
}
.form-error {
  background: #fce8e6;
  color: var(--red);
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 13px;
  margin-bottom: 16px;
  display: none;
}
.form-error.visible { display: block; }

/* ─── HOME ─── */
.home-page {
  padding: 36px 32px;
  max-width: 1100px;
  margin: 0 auto;
  width: 100%;
}
.home-page h1 {
  font-family: 'Fraunces', serif;
  font-size: 28px;
  font-weight: 600;
  margin-bottom: 8px;
}
.home-subtitle {
  font-size: 15px;
  color: var(--text-2);
  margin-bottom: 28px;
}
.agents-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}
.agent-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 22px 20px;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.agent-card:hover { border-color: var(--teal); box-shadow: 0 4px 16px rgba(15,155,114,0.08); }
.agent-card .card-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: 'DM Mono', monospace;
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 3px 8px;
  border-radius: 10px;
  width: fit-content;
}
.badge-gold   { background: #fef3e2; color: #b06a10; border: 1px solid #f0d8b0; }
.badge-silver { background: #f0f1f5; color: #6b7280; border: 1px solid #d1d5db; }
.badge-bronze { background: #fce8e6; color: #92400e; border: 1px solid #f0b5ae; }
.agent-card .card-name {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
}
.agent-card .card-desc {
  font-size: 13px;
  color: var(--text-2);
  line-height: 1.5;
  flex: 1;
}
.agent-card .card-meta {
  display: flex;
  gap: 12px;
  font-size: 11px;
  color: var(--text-3);
  font-family: 'DM Mono', monospace;
}
.empty-state {
  text-align: center;
  padding: 60px 24px;
  color: var(--text-3);
}
.empty-state .empty-icon {
  font-size: 48px;
  margin-bottom: 16px;
  opacity: 0.5;
}
.empty-state h2 {
  font-family: 'Fraunces', serif;
  font-size: 22px;
  font-weight: 300;
  color: var(--text);
  margin-bottom: 8px;
}
.empty-state p {
  font-size: 14px;
  margin-bottom: 20px;
  line-height: 1.6;
}

/* ─── STORE ─── */
.store-page {
  padding: 36px 32px;
  max-width: 1100px;
  margin: 0 auto;
  width: 100%;
}
.store-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  gap: 16px;
  flex-wrap: wrap;
}
.store-header h1 {
  font-family: 'Fraunces', serif;
  font-size: 28px;
  font-weight: 600;
}
.store-search {
  position: relative;
}
.store-search input {
  width: 280px;
  padding: 10px 14px 10px 36px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  font-family: 'DM Sans', sans-serif;
  outline: none;
  background: white;
}
.store-search input:focus { border-color: var(--teal); }
.store-search svg {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  stroke: var(--text-3);
}
.store-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.store-tag {
  font-size: 12px;
  padding: 5px 12px;
  background: white;
  border: 1px solid var(--border);
  border-radius: 16px;
  cursor: pointer;
  color: var(--text-2);
  transition: all 0.15s;
}
.store-tag:hover, .store-tag.active { background: var(--teal-light); color: var(--teal); border-color: var(--teal-mid); }

/* ─── WALLET ─── */
.wallet-page {
  padding: 36px 32px;
  max-width: 800px;
  margin: 0 auto;
  width: 100%;
}
.wallet-balance {
  background: white;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 32px;
  text-align: center;
  margin-bottom: 28px;
}
.wallet-balance .amount {
  font-family: 'DM Mono', monospace;
  font-size: 42px;
  font-weight: 500;
  color: var(--teal);
  margin-bottom: 4px;
}
.wallet-balance .label {
  font-size: 14px;
  color: var(--text-3);
}
.wallet-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-bottom: 32px;
}
.history-list {
  background: white;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}
.history-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  font-size: 13.5px;
}
.history-item:last-child { border-bottom: none; }
.history-item .date { color: var(--text-3); font-family: 'DM Mono', monospace; font-size: 11px; min-width: 70px; }
.history-item .desc { flex: 1; color: var(--text-2); }
.history-item .tokens { font-family: 'DM Mono', monospace; font-weight: 500; }
.history-item .tokens.positive { color: var(--teal); }
.history-item .tokens.negative { color: var(--text-3); }

/* ─── PROFILE ─── */
.profile-page {
  padding: 36px 32px;
  max-width: 700px;
  margin: 0 auto;
  width: 100%;
}
.profile-page h1 {
  font-family: 'Fraunces', serif;
  font-size: 28px;
  font-weight: 600;
  margin-bottom: 24px;
}
.profile-section {
  background: white;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 28px;
  margin-bottom: 20px;
}
.profile-section h2 {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 16px;
  color: var(--text);
}
.eggspert-cta {
  background: var(--teal-light);
  border: 1px solid var(--teal-mid);
  border-radius: 12px;
  padding: 24px 28px;
  margin-bottom: 20px;
}
.eggspert-cta h2 {
  color: var(--teal);
  font-size: 16px;
  margin-bottom: 8px;
}
.eggspert-cta p {
  font-size: 13.5px;
  color: var(--text-2);
  margin-bottom: 16px;
  line-height: 1.6;
}

/* ─── FOOTER ─── */
.app-footer {
  text-align: center;
  padding: 20px;
  font-size: 12px;
  color: var(--text-3);
  border-top: 1px solid var(--border);
}
.app-footer a { color: var(--text-3); }
.app-footer a:hover { color: var(--teal); text-decoration: none; }
.app-footer .sep { opacity: 0.4; margin: 0 8px; }

/* ─── UTILITIES ─── */
.hidden { display: none !important; }
.loading { text-align: center; padding: 40px; color: var(--text-3); }
