/* Apple-inspired: clarity, spacing, system typography */

:root {
  --bg: #fbfbfd;
  --bg-elevated: #ffffff;
  --text: #1d1d1f;
  --text-secondary: #6e6e73;
  --separator: rgba(60, 60, 67, 0.12);
  --accent: #0071e3;
  --accent-hover: #0077ed;
  --accent-pressed: #006edb;
  --success: #34c759;
  --danger: #ff3b30;
  --radius-lg: 18px;
  --radius-md: 12px;
  --radius-pill: 980px;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 24px rgba(0, 0, 0, 0.06);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --header-blur: saturate(180%) blur(20px);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.47059;
  letter-spacing: -0.022em;
  background: var(--bg);
  color: var(--text);
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(251, 251, 253, 0.72);
  backdrop-filter: var(--header-blur);
  -webkit-backdrop-filter: var(--header-blur);
  border-bottom: 1px solid var(--separator);
}

.site-header__inner {
  max-width: 980px;
  margin: 0 auto;
  padding: 14px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.site-logo {
  font-size: 21px;
  font-weight: 600;
  letter-spacing: -0.03em;
  color: var(--text);
  text-decoration: none;
}

.site-logo:hover {
  color: var(--text);
  opacity: 0.85;
  text-decoration: none;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 20px;
}

.site-nav a:not(.site-nav__cta) {
  font-size: 12px;
  font-weight: 400;
  color: var(--text-secondary);
  text-decoration: none;
}

.site-nav a:not(.site-nav__cta):hover {
  color: var(--text);
  text-decoration: none;
}

.site-nav__cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 16px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: #fff;
  background: var(--accent);
  border-radius: var(--radius-pill);
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: background 0.15s ease;
}

.site-nav__cta:hover {
  background: var(--accent-hover);
  text-decoration: none;
  color: #fff;
}

.site-nav__cta:active {
  background: var(--accent-pressed);
}

.site-nav__cta--ghost {
  background: transparent;
  color: var(--accent);
  border: 1px solid rgba(0, 113, 227, 0.35);
}

.site-nav__cta--ghost:hover {
  background: rgba(0, 113, 227, 0.06);
  color: var(--accent);
}

/* Main */
.site-main {
  max-width: 980px;
  margin: 0 auto;
  padding: 48px 22px 80px;
}

/* Hero */
.hero {
  text-align: center;
  padding: 32px 0 56px;
  max-width: 692px;
  margin: 0 auto;
}

.hero__eyebrow {
  margin: 0 0 12px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}

.hero__title {
  margin: 0 0 16px;
  font-size: 48px;
  font-weight: 600;
  letter-spacing: -0.04em;
  line-height: 1.05;
}

.hero__lead {
  margin: 0 0 28px;
  font-size: 21px;
  line-height: 1.381;
  font-weight: 400;
  color: var(--text-secondary);
  letter-spacing: 0.011em;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 22px;
  font-size: 17px;
  font-weight: 500;
  letter-spacing: -0.022em;
  border-radius: var(--radius-pill);
  border: none;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s ease, transform 0.1s ease;
}

.btn:active {
  transform: scale(0.98);
}

.btn--primary {
  background: var(--accent);
  color: #fff;
}

.btn--primary:hover {
  background: var(--accent-hover);
}

.btn--secondary {
  background: transparent;
  color: var(--accent);
  border: 1px solid rgba(0, 113, 227, 0.4);
}

.btn--secondary:hover {
  background: rgba(0, 113, 227, 0.06);
}

/* Cards */
.card {
  background: var(--bg-elevated);
  border-radius: var(--radius-lg);
  border: 1px solid var(--separator);
  box-shadow: var(--shadow-sm);
  padding: 28px 32px;
  margin-bottom: 24px;
}

.card--narrow {
  max-width: 420px;
  margin-left: auto;
  margin-right: auto;
}

.card__title {
  margin: 0 0 8px;
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.03em;
}

.card__subtitle {
  margin: 0 0 24px;
  font-size: 14px;
  color: var(--text-secondary);
}

h3 {
  margin: 0 0 16px;
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

/* Forms */
.form-stack {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.form-stack label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-top: 12px;
}

.form-stack label:first-child {
  margin-top: 0;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
select {
  width: 100%;
  margin: 0 0 4px;
  padding: 14px 16px;
  font-size: 17px;
  font-family: inherit;
  color: var(--text);
  background: #f5f5f7;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}

input:hover,
select:hover {
  background: #ebebed;
}

input:focus,
select:focus {
  background: var(--bg-elevated);
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(0, 113, 227, 0.2);
}

button[type="submit"],
.form-actions .btn {
  width: 100%;
  margin-top: 24px;
}

button[type="submit"] {
  padding: 14px 24px;
  font-size: 17px;
  font-weight: 500;
  font-family: inherit;
  color: #fff;
  background: var(--accent);
  border: none;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: background 0.15s ease;
}

button[type="submit"]:hover {
  background: var(--accent-hover);
}

.form-footer {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--separator);
  font-size: 14px;
  color: var(--text-secondary);
  text-align: center;
}

/* Tables */
.table-wrap {
  overflow-x: auto;
  margin: 0 -8px;
  border-radius: var(--radius-md);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

th {
  text-align: left;
  font-weight: 600;
  font-size: 12px;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 10px 12px;
  border-bottom: 1px solid var(--separator);
}

td {
  padding: 14px 12px;
  border-bottom: 1px solid var(--separator);
}

tbody tr:last-child td {
  border-bottom: none;
}

tbody tr:hover td {
  background: rgba(0, 0, 0, 0.02);
}

/* Grid */
.row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
  align-items: start;
}

.row .card {
  margin-bottom: 0;
}

/* Alerts */
.success {
  margin: 0 0 16px;
  padding: 12px 16px;
  font-size: 14px;
  color: #1a5c2e;
  background: rgba(52, 199, 89, 0.12);
  border-radius: var(--radius-md);
}

.error {
  margin: 0 0 16px;
  padding: 12px 16px;
  font-size: 14px;
  color: #c41e16;
  background: rgba(255, 59, 48, 0.1);
  border-radius: var(--radius-md);
}

/* Footer */
.site-footer {
  max-width: 980px;
  margin: 0 auto;
  padding: 32px 22px 48px;
  border-top: 1px solid var(--separator);
}

.site-footer p {
  margin: 0;
  font-size: 12px;
  color: var(--text-secondary);
  text-align: center;
}

/* Stat tiles (dashboard) */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 8px;
}

.stat {
  padding: 16px 18px;
  background: #f5f5f7;
  border-radius: var(--radius-md);
}

.stat__value {
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.03em;
}

.stat__label {
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 4px;
}

@media (max-width: 734px) {
  .hero__title {
    font-size: 32px;
  }

  .hero__lead {
    font-size: 19px;
  }

  .site-header__inner {
    flex-direction: column;
    align-items: flex-start;
  }

  .site-nav {
    width: 100%;
    justify-content: flex-start;
  }

  .card {
    padding: 22px 20px;
  }
}
