/* ==========================================================================
   Base: reset, typography, shared buttons/inputs, window chrome
   ========================================================================== */

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

html,
body {
  height: 100%;
  overflow: hidden;
}

body {
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: var(--leading-normal);
  color: var(--text-primary);
  background: var(--surface-base);
  -webkit-font-smoothing: antialiased;
  user-select: none;
}

#app {
  height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Frameless window (macOS only): the top strip is draggable everywhere.
   Other platforms keep the native frame, which already provides dragging. */
.drag-strip {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 38px;
  -webkit-app-region: drag;
  z-index: 40;
  pointer-events: none;
}

body.platform-darwin .drag-strip {
  display: block;
}

button,
input {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
  -webkit-app-region: no-drag;
}

button {
  cursor: pointer;
  border: none;
  background: none;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

/* Branded keyboard focus ring — inputs already get an accent ring via
   .text-input:focus; this keeps buttons/links consistent with it. */
button:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 3px;
}

/* The hidden attribute must win over component display rules. */
[hidden] {
  display: none !important;
}

h1,
h2,
h3 {
  font-family: var(--font-display);
  font-weight: 800;
  line-height: var(--leading-tight);
  text-transform: uppercase;
}

/* --- Buttons ------------------------------------------------------------ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 32px;
  border-radius: var(--radius-pill);
  font-weight: 700;
  font-size: 16px;
  letter-spacing: 0.02em;
  transition:
    transform var(--duration-fast) var(--ease-out),
    box-shadow var(--duration-normal) var(--ease-out),
    background-color var(--duration-fast) var(--ease-default),
    border-color var(--duration-fast) var(--ease-default);
}

.btn:active:not(:disabled) {
  transform: translateY(1px) scale(0.99);
}

.btn-primary {
  background: var(--color-accent);
  color: var(--text-inverse);
}

.btn-primary:hover:not(:disabled) {
  background: var(--color-accent-hover);
  box-shadow: var(--glow-accent);
  transform: translateY(-1px);
}

.btn-outline {
  background: transparent;
  color: var(--text-primary);
  border: 1.5px solid var(--border-strong);
}

.btn-outline:hover:not(:disabled) {
  border-color: var(--color-accent);
  color: var(--color-accent);
  background: rgba(245, 158, 11, 0.06);
}

.btn-danger {
  background: var(--color-error);
  color: #fff;
}

.btn-danger:hover:not(:disabled) {
  background: #b91c1c;
}

.btn-ghost {
  color: var(--text-muted);
  padding: 10px 18px;
  border-radius: var(--radius-pill);
}

.btn-ghost:hover:not(:disabled) {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.06);
}

/* --- Inputs ------------------------------------------------------------- */

.field-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.text-input {
  width: 100%;
  padding: 14px 18px;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--border-strong);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-primary);
  font-size: 16px;
  outline: none;
  transition:
    border-color var(--duration-fast) var(--ease-default),
    box-shadow var(--duration-fast) var(--ease-default);
  user-select: text;
}

.text-input::placeholder {
  color: var(--text-subtle);
}

.text-input:focus {
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px var(--color-accent-glow);
}

.form-error {
  margin-top: 10px;
  font-size: 14px;
  color: #f87171;
}

/* --- Utility ------------------------------------------------------------ */

.eyebrow {
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--color-accent);
}

.mono {
  font-family: var(--font-mono);
  font-weight: 500;
}

.spinner {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2.5px solid rgba(255, 255, 255, 0.25);
  border-top-color: currentColor;
  animation: spin 0.8s linear infinite;
  flex: none;
}

.spinner.large {
  width: 42px;
  height: 42px;
  border-width: 3.5px;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.fade-in {
  animation: fadeIn var(--duration-slow) var(--ease-out);
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
