:root {
  --page-bg: #f6f7fb;
  --header-bg: #ffffff;
  --card-bg: #ffffff;
  --text-color: #1e1f23;
  --grey-text: #4b5563;
  /* --muted-color: #6b7280; */
  --primary-color: #2563eb;
  --ring-color: #93c5fd;
  --border-color: #e5e7eb;

  --radius-large: 16px;
  --radius-medium: 12px;
  --radius-pill: 999px;

  --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.06),
                 0 8px 24px rgba(0, 0, 0, 0.08);

  --container-width: 720px;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  /* --space-6: 24px; */
}

/* Make width/height calculations intuitive by sizing by entire border-box
 * instead of just the content-box */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Ubuntu, "Helvetica Neue", Arial, sans-serif;
  font-size: 1rem;
  line-height: 1.5;
  color: var(--text-color);
  background-color: var(--page-bg);
}

h1 {
  margin-top: 0;
}

.container {
  max-width: var(--container-width);
  width: 100%;
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--space-4);
  padding-right: var(--space-4);
}

.site-header {
  background-color: var(--header-bg);
  border-bottom: 1px solid var(--border-color);
}

.nav-bar {
  padding-top: var(--space-3);
  padding-bottom: var(--space-3);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
}

.nav-actions {
  display: inline-flex;
  align-items: center;
}

.user-email {
  font-size: 0.95rem;
  color: var(--grey-text);
}

.page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: var(--space-4);
  margin-top: var(--space-5);
}

.brand {
  font-weight: 700;
  font-size: 1.5rem;
  color: var(--text-color);
  text-decoration: none; /* no link underline */
}

.page-title {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 0;
  color: var(--text-color);
}

.backlink {
  display: block;
  margin-top: calc(-1 * var(--space-4));
  margin-bottom: var(--space-3);
  color: var(--grey-text);
  text-decoration: none;
}

.backlink:hover {
  color: var(--text-color);
  text-decoration: underline;
}

.backlink:focus-visible {
  outline: 3px solid var(--ring-color);
}

.trip-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: var(--space-3);
}

.card {
  background-color: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-large);
  padding: var(--space-5);
  box-shadow: var(--shadow-card);
}

.trip-card {
  display: block;
  color: var(--text-color);
  text-decoration: none;
}

.trip-list .trip-card {
  transition: box-shadow 150ms ease, transform 150ms ease;
}

.trip-list .trip-card:hover {
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.1);
  border-color: rgba(30, 31, 35, 0.20);
  background-color: rgba(255, 255, 255, 0.85);
}

/* Creates box when tabbing though site */
.trip-list .trip-card:focus-visible {
  outline: 3px solid var(--ring-color);
  outline-offset: 4px;
  border-radius: var(--radius-large);
}

.detail {
  margin: 0;
}

.detail dt {
  font-weight: 600;
  margin-top: var(--space-3);
}

.detail dt:first-of-type {
  margin-top: 0;
}

.detail dd {
  margin: 0;
  margin-top: var(--space-2, 8px);
}

.finish-trip-button {
  margin-top: var(--space-3);
}

.form {
  display: block;
}

.form label {
  font-weight: 600;
}

.form .field {
  display: grid;
  gap: var(--space-1);
  margin-bottom: var(--space-4);
}

.form input,
.form textarea,
.form select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-medium);
  font: inherit;
  color: var(--text-color);
  background-color: #ffffff;
}

.form input:focus-visible,
.form textarea:focus-visible,
.form select:focus-visible {
  outline: 3px solid var(--ring-color);
  outline-offset: 2px;
}

.form-actions {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-top: var(--space-4);
}

.form-actions .btn-primary {
  margin-left: auto;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1.25;
  padding: 10px 16px;
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  font-weight: 600;
  text-decoration: none;
  color: var(--text-color);
  background-color: transparent;
  cursor: pointer;
  transition: background-color 120ms ease, color 120ms ease, box-shadow 120ms ease;
}

.btn:focus-visible {
  outline: 3px solid var(--ring-color);
  outline-offset: 2px;
}

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

.btn-secondary {
  color: var(--primary-color);
  border-color: currentColor;
  background-color: transparent;
}

.btn-secondary:hover {
  background-color: rgba(37, 99, 235, 0.08);
}

.btn-primary:hover {
  filter: brightness(0.95);
}

.btn-ghost {
  padding: 4px;
}

.btn-ghost.btn-icon svg {
  display: block;
  width: 18px;
  height: 18px;
}
