/* Fonts */
@import url('https://fonts.googleapis.com/css2?family=DM+Serif+Display:ital@0;1&family=Space+Mono:wght@400;700&family=DM+Sans:wght@400;500;700&display=swap');

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition: background .4s, color .4s;
}

/* Theme tokens */
:root {
  --bg: #F3F1EC;
  --fg: #1A1A1A;
  --muted: #96918A;
  --border: #DCD8D1;
  --accent: #CFA030;
  --card: #E6E3DD;
  --card2: #FFFFFF;
  --serif: 'DM Serif Display', Georgia, serif;
  --mono: 'Space Mono', monospace;
  --sans: 'DM Sans', sans-serif;
  --shadow: 0 12px 46px rgba(0, 0, 0, .06);

  /* builder blues */
  --blue1: #3b82f6;
  --blue2: #2563eb;
  --blue3: #1d4ed8;
  --lb: rgba(219, 234, 254, .92);
  --lb2: rgba(239, 246, 255, .96);
  --lbBorder: rgba(37, 99, 235, .22);
}

[data-theme="dark"] {
  --bg: #141414;
  --fg: #E8E4DC;
  --muted: #c7c7c7 !important;
  --border: #2E2E2E;
  --card: #1E1E1E;
  --card2: #252525;
}

/* Page fade-in (optional; your JS adds .is-loaded) */
body:not(.is-loaded) .page {
  opacity: 0;
  transform: translateY(12px);
}

body.is-loaded .page {
  opacity: 1;
  transform: translateY(0);
  transition: opacity .6s ease, transform .6s ease;
}

/* Common button */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border-radius: 16px;
  padding: 12px 18px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: .4px;
  cursor: pointer;
  border: 1.5px solid var(--border);
  background: transparent;
  color: var(--fg);
  transition: background .2s, color .2s, border-color .2s, opacity .2s, transform .2s;
  text-decoration: none;
  user-select: none;
  text-transform: uppercase;
}

.btn:hover {
   transform: translateY(-1px);
  box-shadow: 0 14px 44px rgba(0,0,0,0.16);
  opacity: .94;
}

.btn:hover i{
  transform:translateX(4px);
}


.btn-solid {
  border-color: transparent;
  background: var(--fg);
  color: var(--bg);
}

.btn-solid i {
  color: var(--bg);
}

.btn-solid:hover {
  opacity: .9;
}

/* Hero wrapper + dots canvas */
.hero {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
  background: var(--bg);
}

.hero::before,
.hero::after {
  content: "";
  position: absolute;
  inset: -20%;
  pointer-events: none;
  z-index: 0;
}

.hero::before {
  inset: 0;
  opacity: .14;
}

.hero::after {
  opacity: .34;
  filter: blur(26px);
}

.hero-dots {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
  opacity: .55;
  mix-blend-mode: normal;
}

/* Standard page container */
.wrap {
  position: relative;
  z-index: 2;
  max-width: 1280px;
  /* keep your wider default */
  margin: 0 auto;
  padding: 86px 32px 42px;
}

/* Head */
.top-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

.grid {
  margin-top: 32px;
}

.top-title h1 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(34px, 4.8vw, 60px);
  line-height: 1.06;
  letter-spacing: -.6px;
}

.top-title p {
  margin-top: 10px;
  font-family: var(--mono);
  font-size: 14px;
  color: var(--muted);
  line-height: 1.7;
  max-width: 62ch;
}

/* Layout helpers (login/signup-only pages) */
.auth-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 22px;
  align-items: start;
  max-width: 560px;
}

/* ===== Card + form styles (from your signup partial) ===== */
.signup-card {
  background: var(--card2);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 18px 18px 16px;
  box-shadow: var(--shadow);
}

.signup-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 10px;
}

.signup-top h3 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 24px;
  line-height: 1.1;
}

.signup-top p {
  margin-top: 6px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
  line-height: 1.6;
  max-width: 52ch;
}

.signup-form {
  display: grid;
  gap: 8px;
  margin-top: 8px;
}

.field {
  display: grid;
  gap: 6px;
  border: none;
  padding: 0;
}

.field label {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--muted);
}

.field input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 10px 12px;
  font-family: var(--sans);
  font-size: 14px;
  background: var(--card2);
  color: var(--fg);
  outline: none;
}

.field input:focus {
  border-color: color-mix(in srgb, var(--accent) 60%, var(--border));
  box-shadow: 0 0 0 6px color-mix(in srgb, var(--accent) 12%, transparent);
}

.signup-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 4px;
  align-items: center;
}

.signup-note {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--muted);
  line-height: 1.4;
  max-width: 48ch;
}

.signup-alt {
  margin-top: 10px;
}

.signup-link {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--muted);
  text-decoration: none;
}

.signup-link:hover {
  text-decoration: underline;
  opacity: .85;
}

.error-message {
  display: block;
  margin-top: 4px;
  font-size: 11px;
  color: #E53E3E;
  min-height: 0;
}

/* Login helpers */
.login-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 2px;
}

.server-error-row {
  background-color: rgba(229, 62, 62, .08);
  color: #991b1b;
  padding: 10px 12px;
  border: 1px solid rgba(229, 62, 62, .25);
  border-radius: 14px;
  text-align: left;
  font-family: var(--mono);
  font-size: 10.5px;
  line-height: 1.5;
  margin-top: 8px;
}

/* Responsive */
@media(max-width:640px) {
  .wrap {
    padding: 74px 18px 34px;
  }

  .auth-grid {
    max-width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  body.is-loaded .page {
    transition: none !important;
  }
}

/* Center auth pages */
.auth-layout {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  min-height: 70vh;
}

.auth-grid {
  width: 100%;
  max-width: 560px;
}

/* force signup to be open on the dedicated signup page */
.hero--auth #signupCard .signup-more {
  max-height: 1200px;
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  overflow: visible;
}

.hero--auth #signupCard .signup-actions--folded {
  display: none;
}

.nav-logo {
  text-decoration: none;
}

h1,
h2,
h3,
.footer-tagline {
  color: var(--fg);
}

.field {
  background-color: transparent;
}

main {
  width: 100%;
}

/* =========================
   Folders
   ========================= */

.folder-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

.folder-item {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  padding: 12px 8px;
  border-radius: 14px;
  transition: background .2s, box-shadow .2s, transform .2s, opacity .2s;
  outline: none;
}

.folder-item:hover {
  background: var(--card);
}

.folder-item:focus-visible {
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 55%, transparent);
}

.folder-item.is-active {
  background: var(--card);
  box-shadow: 0 0 0 1px var(--border) inset;
}

.folder-icon {
  width: 76px;
  height: 60px;
  position: relative;
}

.folder-shape {
  position: relative;
  width: 100%;
  height: 100%;
}

.folder-shape .tab {
  position: absolute;
  top: 0;
  left: 0;
  width: 34px;
  height: 15px;
  border-radius: 6px 6px 0 0;
  background: color-mix(in srgb, var(--fg) 10%, var(--card));
}

.folder-shape .body {
  position: absolute;
  top: 12px;
  left: 0;
  width: 100%;
  height: 48px;
  border-radius: 4px 10px 10px 10px;
  background: color-mix(in srgb, var(--fg) 16%, var(--card));
}

.folder-shape .body::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 32px;
  border-radius: 0 0 10px 10px;
  background: color-mix(in srgb, var(--fg) 22%, var(--card));
}

.folder-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--fg);
  opacity: .92;
}

/* =========================
   Panel (minimal, no card)
   ========================= */

.folder-panel {
  margin-top: 14px;
  padding: 0;
  background: transparent;
  border: 0;
  margin-left: 36px;
}

.folder-panel__title {
  margin: 0 0 4px;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: -.2px;
  color: var(--fg);
}

.folder-panel__text {
  margin: 0;
  font-size: 12px;
  line-height: 1.45;
  font-family: var(--mono);
  color: var(--muted);
  /* required */
}

/* =========================
   Dark theme: lighten folders
   ========================= */

[data-theme="dark"] .folder-shape .tab {
  background: color-mix(in srgb, #fff 18%, var(--card));
}

[data-theme="dark"] .folder-shape .body {
  background: color-mix(in srgb, #fff 26%, var(--card));
}

[data-theme="dark"] .folder-shape .body::after {
  background: color-mix(in srgb, #fff 34%, var(--card));
}

[data-theme="dark"] .folder-label {
  color: color-mix(in srgb, #fff 88%, var(--fg));
  opacity: 1;
}

/* optional: a touch clearer active state on dark */
[data-theme="dark"] .folder-item.is-active {
  box-shadow: 0 0 0 1px color-mix(in srgb, #fff 14%, var(--border)) inset;
}

.folder-panel {
  margin-top: 32px;
  padding: 0;
  background: transparent;
  border: 0;
}

/* ONE block row */
.folder-row {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

/* avatar chip */
.folder-row__avatar {
  width: 26px;
  height: 26px;
  border-radius: 999px;
  display: inline-grid;
  place-items: center;
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, .08) inset,
    0 1px 0 rgba(0, 0, 0, .08);
  overflow: hidden;
}

/* inner shine */
.folder-row__avatar::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 999px;
  pointer-events: none;
}

.folder-row__avatar {
  position: relative;
}

/* text */
.folder-row__text {
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.4;
  letter-spacing: .02em;
  color: var(--muted);
}

/* simple avatar colors */
.folder-row__avatar.is-yellow {
  background: #FACC15;
}

.folder-row__avatar.is-blue {
  background: #60A5FA;
}

.folder-row__avatar.is-green {
  background: #34D399;
}

.folder-row__avatar.is-red {
  background: #FCA5A5;
}

.folder-row__avatar.is-purple {
  background: #A78BFA;
}

.folder-row__avatar.is-orange {
  background: #FDBA74;
}


.folder-row {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.folder-row__avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  font-size: 13px;
  flex: 0 0 24px;
}

.folder-row__text {
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.4;
  letter-spacing: .02em;
  color: var(--muted);
}

/*Signup-in forms on dark*/

/* ===== DARK THEME OVERRIDES for signup ===== */
[data-theme="dark"] .signup-card {
  /* slightly brighter than page bg so it doesn't disappear */
  background: color-mix(in srgb, var(--bg) 70%, #ffffff 6%);
  border-color: color-mix(in srgb, #ffffff 10%, var(--border));
  box-shadow:
    0 18px 48px rgba(0, 0, 0, .55),
    0 0 0 1px rgba(255, 255, 255, .04) inset;
}

[data-theme="dark"] .signup-top p,
[data-theme="dark"] .field label,
[data-theme="dark"] .signup-note,
[data-theme="dark"] .signup-link,
[data-theme="dark"] .field-checkbox .checkbox {
  /* make secondary text readable */
  color: color-mix(in srgb, var(--muted) 80%, #fff);
}

[data-theme="dark"] .signup-link:hover {
  opacity: 1;
  color: color-mix(in srgb, var(--muted) 60%, #fff);
}

/* Inputs need a different surface than the card */
[data-theme="dark"] .field input {
  background: color-mix(in srgb, var(--bg) 78%, #fff 4%);
  border-color: color-mix(in srgb, #fff 10%, var(--border));
  color: color-mix(in srgb, var(--fg) 88%, #fff);
}

/* Placeholder contrast */
[data-theme="dark"] .field input::placeholder {
  color: color-mix(in srgb, var(--muted) 70%, #fff);
  opacity: .7;
}

/* Focus ring: a bit stronger in dark */
[data-theme="dark"] .field input:focus {
  border-color: color-mix(in srgb, var(--accent) 70%, #fff 10%);
  box-shadow:
    0 0 0 6px color-mix(in srgb, var(--accent) 18%, transparent);
}

/* Divider line when expanded */
[data-theme="dark"] .signup-card.is-open .signup-more {
  border-top-color: color-mix(in srgb, #fff 10%, var(--border));
}

/* Checkbox visibility in dark */
[data-theme="dark"] .field-checkbox input[type="checkbox"] {
  accent-color: var(--accent);
  filter: brightness(1.1);
}

/* Error message stays readable */
[data-theme="dark"] .signup-card .error-message {
  color: color-mix(in srgb, #ff6b6b 85%, #fff);
}

[data-theme="dark"] .signup-card .btn-solid {
  box-shadow: 0 10px 28px rgba(0, 0, 0, .35);
}

.field-checkbox .checkbox>span {
  color: var(--muted);
  opacity: 1;
}

[data-theme="dark"] .field-checkbox .checkbox>span {
  color: color-mix(in srgb, var(--muted) 65%, #fff) !important;
  opacity: 1 !important;
}

[data-theme="dark"] .field-checkbox .checkbox>span a {
  color: color-mix(in srgb, var(--accent) 80%, #fff) !important;
  text-decoration-color: color-mix(in srgb, var(--accent) 45%, transparent);
}

[data-theme="dark"] .signup-card .btn.btn-solid {
  background: var(--accent) !important;
  color: #141414 !important;
  border-color: transparent !important;
}

/* Background dots on dark */
[data-theme="dark"] .hero-dots {
  opacity: .82;          
  mix-blend-mode: screen; 
}

[data-theme="dark"] .hero--auth .hero-dots{
  opacity: .42;
  mix-blend-mode: normal;
}

[data-theme="dark"] .signup-card .btn.btn-solid {
  background: var(--accent);
  color: #141414;
  border: none;
}

[data-theme="dark"] .signup-card .btn.btn-solid:hover {
  transform: translateY(-1px);
}

/*AUTOFILLS*/
/* AUTOFILL — shared fixes */
#loginForm input:-webkit-autofill,
#loginForm input:-webkit-autofill:hover,
#loginForm input:-webkit-autofill:focus,
#loginForm input:-webkit-autofill:active{
  -webkit-background-clip: padding-box;
  background-clip: padding-box;

  /* make sure radius matches your input */
  border-radius: 14px; /* match your input radius */
}

/* DARK */
/* works no matter which form id you have */
[data-theme="dark"] .signup-card input:-webkit-autofill,
[data-theme="dark"] .signup-card input:-webkit-autofill:hover,
[data-theme="dark"] .signup-card input:-webkit-autofill:focus,
[data-theme="dark"] .signup-card input:-webkit-autofill:active{
  -webkit-background-clip: padding-box;
  background-clip: padding-box;

  -webkit-box-shadow:
    0 0 0 1000px rgba(255,255,255,.06) inset,
    0 0 0 1px rgba(255,255,255,.18) inset !important;

  box-shadow:
    0 0 0 1000px rgba(255,255,255,.06) inset,
    0 0 0 1px rgba(255,255,255,.18) inset !important;

  -webkit-text-fill-color: #000 !important;
  caret-color: var(--fg) !important;
  border-radius: 14px; 
}

/* LIGHT */
#loginForm input:-webkit-autofill,
#loginForm input:-webkit-autofill:hover,
#loginForm input:-webkit-autofill:focus,
#loginForm input:-webkit-autofill:active{
  -webkit-box-shadow:
    0 0 0 1000px var(--card2) inset,
    0 0 0 1px rgba(10,10,10,.14) inset !important; 

  box-shadow:
    0 0 0 1000px var(--card2) inset,
    0 0 0 1px rgba(10,10,10,.14) inset !important;

  -webkit-text-fill-color: var(--fg) !important;
  caret-color: var(--fg) !important;

  transition: background-color 9999s ease-out 0s;
}
