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

/* === Variables === */
:root {
  --color-bg: #f8f9fa;
  --color-surface: #ffffff;
  --color-text: #212529;
  --color-text-muted: #6c757d;
  --color-primary: #0d6efd;
  --color-primary-hover: #0b5ed7;
  --color-danger: #dc3545;
  --color-success: #198754;
  --color-warning: #ffc107;
  --color-border: #dee2e6;
  --radius: 6px;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  --max-width: 960px;
  --font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

/* === Base === */
html {
  font-size: 16px;
}

body {
  font-family: var(--font-family), serif;
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
  min-height: 100vh;
}

a {
  color: var(--color-primary);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* === Layout === */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1rem;
}

/* === Header === */
.site-header {
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  padding: 0.75rem 0;
  margin-bottom: 2rem;
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-text);
}

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

nav {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.btn-link {
  background: none;
  border: none;
  color: var(--color-primary);
  cursor: pointer;
  font: inherit;
  padding: 0;
}

.btn-link:hover {
  text-decoration: underline;
}

/* === Forms === */
.form-group {
  margin-bottom: 1rem;
}

label {
  display: block;
  margin-bottom: 0.25rem;
  font-weight: 500;
  font-size: 0.9rem;
}

input[type="text"],
input[type="email"],
input[type="password"] {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  font: inherit;
  font-size: 0.95rem;
  transition: border-color 0.15s;
}

input:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.15);
}

input:disabled {
  background: var(--color-bg);
  color: var(--color-text-muted);
}

.form-hint {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.8rem;
  color: var(--color-text-muted);
}

/* === Buttons === */
.btn {
  display: inline-block;
  padding: 0.5rem 1.25rem;
  font: inherit;
  font-size: 0.95rem;
  font-weight: 500;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background-color 0.15s;
}

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

.btn-primary:hover {
  background: var(--color-primary-hover);
}

/* === Alerts === */
.alert {
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  margin-bottom: 1rem;
  font-size: 0.9rem;
}

.alert-error {
  background: #f8d7da;
  color: #842029;
  border: 1px solid #f5c2c7;
}

.alert-success {
  background: #d1e7dd;
  color: #0f5132;
  border: 1px solid #badbcc;
}

.alert-warning {
  background: #fff3cd;
  color: #664d03;
  border: 1px solid #ffecb5;
}

/* === Auth Pages === */
.auth-page {
  max-width: 400px;
  margin: 2rem auto;
}

.auth-page h1 {
  margin-bottom: 1.5rem;
}

.auth-link {
  margin-top: 1rem;
  text-align: center;
  font-size: 0.9rem;
}

/* === Account Page === */
.account-page {
  max-width: 600px;
  margin: 0 auto;
}

.account-page h1 {
  margin-bottom: 1.5rem;
}

/* === Card === */
.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow);
}

.card h2 {
  margin-bottom: 1rem;
  font-size: 1.15rem;
}

/* === Error Page === */
.error-page {
  text-align: center;
  margin-top: 4rem;
}

.error-page h1 {
  font-size: 3rem;
  color: var(--color-text-muted);
  margin-bottom: 0.5rem;
}

.error-page p {
  margin-bottom: 1.5rem;
  color: var(--color-text-muted);
}

/* === HTMX indicators === */
.htmx-indicator {
  display: none;
}

.htmx-request .htmx-indicator {
  display: inline-block;
}

.htmx-request.htmx-indicator {
  display: inline-block;
}
