@import url("tokens.css");

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }   /* classes like .field set display, which would otherwise beat the hidden attribute */
html, body { margin: 0; }
body {
  font-family: var(--font-ui);
  font-size: 15px;
  line-height: 1.5;
  color: var(--text);
  background-color: var(--paper);
  background-image: var(--grain), var(--wash);
  background-attachment: fixed;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Brand */
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 600; letter-spacing: -.01em; color: inherit; }
.brand:hover { text-decoration: none; }
.brand-logo { display: block; height: 34px; width: auto; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  height: 44px; padding: 0 18px; border-radius: 999px; border: 1px solid transparent;
  font-weight: 500; cursor: pointer; transition: background .15s var(--ease), border-color .15s, transform .15s var(--ease), opacity .15s;
  white-space: nowrap;
}
.btn:active { transform: scale(.985); }
.btn[disabled] { opacity: .55; cursor: progress; }
.btn-primary { background: var(--text); color: var(--paper); }
.btn-primary:hover { opacity: .9; }
.btn-accent { background: var(--accent); color: #fff; }
.btn-accent:hover { background: var(--accent-hover); }
.btn-outline { background: var(--surface); border-color: var(--line); }
.btn-outline:hover { background: var(--surface); box-shadow: 3px 3px 0 var(--line); transform: translate(-1px, -1px); }
.btn-ghost { background: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }
.btn-block { width: 100%; }

/* Fields */
.field { display: grid; gap: 6px; }
.field label { font-size: 13px; font-weight: 500; color: var(--text-2); }
.field-row { display: flex; justify-content: space-between; align-items: baseline; }
.input {
  height: 46px; padding: 0 14px; border-radius: var(--radius); border: 1px solid var(--line);
  background: var(--surface); transition: border-color .15s, box-shadow .15s; width: 100%;
}
.input::placeholder { color: var(--text-3); }
.input:hover { background: #fff; }
.input:focus { outline: none; border-color: var(--line); box-shadow: 3px 3px 0 var(--line); }

.divider { display: flex; align-items: center; gap: 12px; color: var(--text-3); font-size: 12px; text-transform: uppercase; letter-spacing: .08em; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line-soft); }

.alert { padding: 10px 14px; border-radius: var(--radius); font-size: 14px; display: none; }
.alert.show { display: block; }
.alert-error { background: var(--danger-soft); color: var(--danger); }
.alert-ok { background: var(--success-soft); color: var(--success); }

.muted { color: var(--text-2); }
.small { font-size: 13px; }

.preview-banner {
  position: fixed; left: 50%; bottom: 16px; transform: translateX(-50%); z-index: 50;
  padding: 7px 14px; border-radius: 999px; font-size: 12px; background: var(--surface); color: var(--text);
  border: 1px solid var(--line); box-shadow: 3px 3px 0 var(--line); max-width: calc(100% - 32px); text-align: center;
}

.spinner { width: 16px; height: 16px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
