html, body { background: var(--beige-100); color: var(--gray-700); margin: 0; padding: 0; }
body { font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }

h1, h2, h3, h4, h5 {
  font-family: "Plus Jakarta Sans", "Inter", system-ui, sans-serif;
  letter-spacing: -0.02em;
  color: var(--sage-700);
  margin: 0;
}

a { color: var(--sage-500); text-decoration: none; }
a:hover { color: var(--sage-600); }

::selection { background: var(--sage-200); color: var(--sage-700); }

[tabindex="-1"]:focus { outline: none; }

.auth-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 48px 24px;
  background: var(--beige-100);
}
.auth-card {
  width: 100%;
  max-width: 420px;
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: 20px;
  padding: 32px;
  box-shadow: 0 2px 6px rgba(52,71,56,0.05), 0 1px 2px rgba(52,71,56,0.04);
}
.auth-card h1 { font-size: 26px; margin-bottom: 6px; }
.auth-card .sub { color: var(--gray-500); margin-bottom: 24px; }
.auth-card .field-group { display: flex; flex-direction: column; gap: 14px; margin-bottom: 18px; }
.auth-card .validation-message { color: var(--danger-500, #b85c4c); font-size: 13px; }
.auth-card .auth-foot { margin-top: 18px; font-size: 14px; color: var(--gray-500); }

.builder-shell { display: grid; grid-template-columns: 280px 1fr; min-height: 100vh; background: var(--beige-100); }
.builder-rail { background: #fff; border-right: 1px solid var(--gray-200); padding: 32px 24px; position: sticky; top: 0; height: 100vh; }
.builder-rail .logo-row { display: flex; align-items: center; gap: 12px; margin-bottom: 32px; }
.builder-rail .logo-row img { height: 28px; }
.rail-steps { display: flex; flex-direction: column; gap: 6px; }
.rail-step { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 12px; color: var(--gray-500); font-size: 14px; transition: all 200ms cubic-bezier(0.22, 1, 0.36, 1); }
.rail-step .num { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 999px; background: var(--gray-100, #F4F4F2); color: var(--gray-500); font-size: 12px; font-weight: 600; }
.rail-step.active { background: var(--sage-50); color: var(--sage-700); font-weight: 600; }
.rail-step.active .num { background: var(--sage-400); color: #fff; }
.rail-step.done .num { background: var(--sage-200); color: var(--sage-700); }
.rail-step.done { color: var(--sage-700); }
.builder-body { display: flex; flex-direction: column; min-height: 100vh; }
.builder-content { flex: 1; padding: 48px 64px 120px; max-width: 920px; width: 100%; box-sizing: border-box; }
.builder-action-bar { position: sticky; bottom: 0; background: rgba(244, 239, 231, 0.85); backdrop-filter: blur(12px); border-top: 1px solid var(--gray-200); padding: 16px 64px; display: flex; justify-content: space-between; align-items: center; }

.app-shell { display: block; grid-template-columns: none; min-height: 100vh; background: var(--beige-100); }
.app-topbar { background: rgba(255,255,255,0.85); backdrop-filter: blur(12px); border-bottom: 1px solid var(--gray-200); padding: 14px 32px; margin-bottom: 0; display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; z-index: 10; }
.app-topbar .logo { height: 28px; }
.app-content { max-width: 1180px; margin: 0 auto; padding: 48px 32px; }

input, textarea, select { font-family: inherit; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 13px; font-weight: 500; color: var(--gray-700); }
.field input, .field textarea, .field select {
  height: 48px;
  border: 1.5px solid var(--gray-200);
  border-radius: 14px;
  padding: 0 14px;
  font-size: 15px;
  color: var(--gray-700);
  background: #fff;
  transition: border-color 200ms cubic-bezier(0.22, 1, 0.36, 1), box-shadow 200ms cubic-bezier(0.22, 1, 0.36, 1);
}
.field textarea { height: auto; min-height: 120px; padding: 12px 14px; resize: vertical; line-height: 1.5; }
.field input:focus, .field textarea:focus, .field select:focus { outline: none; border-color: var(--sage-400); box-shadow: 0 0 0 4px rgba(127,163,138,0.2); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field-fieldset { border: 0; padding: 0; margin: 0; }
.field-fieldset > legend { font-size: 13px; font-weight: 500; color: var(--gray-700); padding: 0; margin-bottom: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

.template-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.template-card { background: #fff; border: 1.5px solid var(--gray-200); border-radius: 20px; padding: 20px; cursor: pointer; transition: all 200ms cubic-bezier(0.22, 1, 0.36, 1); }
.template-card:hover { border-color: var(--sage-200); transform: translateY(-2px); box-shadow: 0 8px 18px rgba(52,71,56,0.07); }
.template-card.selected { border-color: var(--sage-400); box-shadow: 0 0 0 4px rgba(127,163,138,0.2); }
.template-preview { aspect-ratio: 8.5 / 11; background: var(--beige-50); border-radius: 12px; margin-bottom: 12px; padding: 14px; font-size: 7px; line-height: 1.4; overflow: hidden; }
.template-card h4 { font-size: 14px; margin-bottom: 2px; color: var(--sage-700); }
.template-card .desc { font-size: 12px; color: var(--gray-500); }
