/* ================================================================== */
/* TradeCraft — Shared CSS                                             */
/* Single source of truth for styles used across multiple pages.       */
/* Page-specific styles remain in each HTML file's <style> block.      */
/*                                                                     */
/* Design tokens live in `_tokens.css` — auto-generated from the       */
/* canonical token JSONs at 4-design/tokens/. Run              */
/* `npx style-dictionary build --config 4-design/tokens/       */
/* build/style-dictionary.config.mjs` to refresh.                      */
/* ================================================================== */
@import url("./_tokens.css");
@import url("./a11y.css");
@import url("./components.css");


/* ================================================================== */
/* Reset                                                               */
/* ================================================================== */
*,*::before,*::after{box-sizing:border-box;margin:0;padding:0}


/* ================================================================== */
/* Base                                                                */
/* ================================================================== */
html { scroll-behavior: smooth }

body {
  font-family: var(--font);
  background: var(--bg);
  background-image: var(--grid-bg);
  background-size: 28px 28px;
  color: var(--body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}


/* ================================================================== */
/* Layout                                                              */
/* ================================================================== */
.container {
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 24px;
  position: relative;
  z-index: 1;
}

.page-container {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 24px;
}


/* ================================================================== */
/* Nav                                                                 */
/* ================================================================== */
nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(245,244,240,.9);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-light);
  padding: 16px 0;
}

nav .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  color: var(--heading);
  letter-spacing: -0.5px;
  text-decoration: none;
}

.logo span {
  color: var(--success);
  font-weight: 800;
}

.nav-link {
  font-size: 14px;
  font-weight: 500;
  color: var(--body-light);
  text-decoration: none;
  transition: color .2s;
}

.nav-link:hover {
  color: var(--heading);
}


/* ================================================================== */
/* Buttons                                                             */
/* ================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  font-size: 15px;
  font-weight: 600;
  font-family: var(--font);
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: background .2s, transform .15s cubic-bezier(.16,1,.3,1), box-shadow .3s;
  text-decoration: none;
  letter-spacing: -0.1px;
}

.btn:active {
  transform: translateY(0) scale(0.985);
}

.btn-primary {
  color: #fff;
  background: var(--success);
  box-shadow: 0 2px 8px rgba(13,150,104,.2), inset 0 1px 0 rgba(255,255,255,.15);
}

.btn-primary:hover {
  background: var(--success-dark);
  box-shadow: 0 6px 20px rgba(13,150,104,.3), inset 0 1px 0 rgba(255,255,255,.15);
  transform: translateY(-1px);
}

.btn-primary:disabled {
  background: var(--muted);
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-secondary {
  color: var(--heading);
  background: var(--bg);
  border: 1.5px solid var(--border);
}

.btn-secondary:hover {
  background: #eceae5;
  transform: translateY(-1px);
}

.btn-secondary:disabled {
  color: var(--muted);
  background: var(--input-bg);
  border-color: var(--border);
  cursor: not-allowed;
  transform: none;
}

.btn-outline {
  color: var(--body-light);
  background: transparent;
  border: none;
  padding: 12px 16px;
  font-weight: 500;
}

.btn-outline:hover {
  color: var(--heading);
}

.btn-danger {
  color: #fff;
  background: var(--error);
  box-shadow: 0 2px 8px rgba(220,38,38,.2);
}

.btn-danger:hover {
  filter: brightness(0.92);
  transform: translateY(-1px);
}

/* Size modifiers — combine with .btn .btn-primary etc. */
.btn-lg { padding: 16px 32px; font-size: 16px; }
.btn-sm { padding: 8px 16px;  font-size: 14px; }


/* ================================================================== */
/* Feedback Messages                                                   */
/* ================================================================== */
.feedback {
  display: none;
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  margin-top: 16px;
  line-height: 1.5;
}

.feedback.success {
  display: block;
  background: var(--success-bg);
  color: var(--success-dark);
}

.feedback.error {
  display: block;
  background: var(--danger-bg);
  color: var(--danger);
}


/* ================================================================== */
/* Error Card / No-Token Card                                          */
/* ================================================================== */
.error-card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  padding: 56px 36px;
  max-width: 480px;
  margin: 80px auto;
  text-align: center;
  border: 1px solid var(--border-light);
}

.error-card h2 {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 600;
  color: var(--heading);
  margin: 16px 0 8px;
}

.error-card p {
  font-size: 14px;
  color: var(--body-light);
  line-height: 1.6;
}


/* ================================================================== */
/* Drop Zone (File Upload)                                             */
/* ================================================================== */
.drop-zone {
  border: 2px dashed var(--border);
  border-radius: 12px;
  padding: 40px 24px;
  text-align: center;
  cursor: pointer;
  transition: border-color .2s, background .2s;
  background: var(--input-bg);
}

.drop-zone:hover,
.drop-zone.dragover {
  border-color: var(--success);
  background: var(--success-bg);
}

.drop-zone-icon {
  display: block;
  margin: 0 auto 12px;
  color: var(--muted);
}

.drop-zone-text {
  font-size: 15px;
  font-weight: 600;
  color: var(--heading);
  margin-bottom: 4px;
}

.drop-zone-hint {
  font-size: 13px;
  color: var(--muted);
}

.drop-zone input[type="file"] {
  display: none;
}


/* ================================================================== */
/* Skeleton Loading                                                    */
/* ================================================================== */
.skeleton {
  background: linear-gradient(90deg, var(--border-light) 25%, #e8e7e3 50%, var(--border-light) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 8px;
}

@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.skeleton-text {
  height: 16px;
  width: 200px;
  margin-bottom: 8px;
}

.skeleton-logo {
  height: 80px;
  width: 200px;
  margin: 0 auto 20px;
}


/* ================================================================== */
/* Colour Preset & Swatch (shared between setup and account)           */
/* ================================================================== */
.colour-swatch-lg {
  width: 72px;
  height: 72px;
  border-radius: 14px;
  border: 3px solid var(--border);
  cursor: pointer;
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
  transition: border-color .2s;
}

.colour-swatch-lg input[type="color"] {
  position: absolute;
  inset: -8px;
  width: calc(100% + 16px);
  height: calc(100% + 16px);
  border: none;
  cursor: pointer;
  padding: 0;
}

.colour-presets {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.colour-presets label {
  font-size: 13px;
  font-weight: 600;
  color: var(--body-light);
  margin-bottom: 8px;
  width: 100%;
}

.colour-preset {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  border: 2.5px solid transparent;
  cursor: pointer;
  transition: transform .15s, border-color .2s, box-shadow .2s;
}

.colour-preset:hover {
  transform: scale(1.1);
}

.colour-preset.selected {
  border-color: var(--heading);
  box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--heading);
}


/* ================================================================== */
/* Footer                                                              */
/* ================================================================== */
footer {
  background: var(--heading);
  padding: 36px 0 32px;
  text-align: center;
  margin-top: auto;
}

footer p {
  font-size: 13px;
  color: rgba(255,255,255,.35);
}

footer a {
  color: rgba(255,255,255,.5);
  text-decoration: none;
  transition: color .2s;
}

footer a:hover {
  color: #fff;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 24px;
  margin-bottom: 16px;
  font-size: 13px;
}


/* ================================================================== */
/* Responsive                                                          */
/* ================================================================== */

/* Prevent iOS auto-zoom on input focus */
input, textarea, select {
  font-size: 16px !important;
}

@media (max-width: 640px) {
  .footer-links {
    gap: 16px;
    font-size: 12px;
  }
}
