:root {
  color-scheme: light;
  --bg: #f4f6f8;
  --panel: #ffffff;
  --text: #17202a;
  --muted: #607080;
  --line: #d8dee6;
  --accent: #ff2d89;
  --accent-strong: #d8176b;
  --danger: #b42318;
  --success: #067647;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a {
  color: var(--accent);
}

.topbar {
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 0 32px;
  background: #ffffff;
  border-bottom: 1px solid var(--line);
}

.brand {
  color: var(--text);
  font-weight: 800;
  text-decoration: none;
}

.topbar nav {
  display: flex;
  align-items: center;
  gap: 18px;
}

.topbar nav a {
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 700;
  text-decoration: none;
}

.auth-shell,
.page-shell,
.admin-shell {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
}

.auth-shell {
  min-height: calc(100vh - 64px);
  display: grid;
  place-items: center;
  padding: 40px 0;
}

.auth-panel,
.panel,
.table-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 1px 2px rgba(23, 32, 42, 0.04);
}

.auth-panel {
  width: min(100%, 420px);
  padding: 28px;
}

.page-shell,
.admin-shell {
  padding: 40px 0;
  display: grid;
  gap: 24px;
}

.page-heading {
  max-width: 760px;
}

.admin-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.panel,
.table-panel {
  padding: 22px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 12px;
  font-size: 2.5rem;
  line-height: 1.05;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 18px;
  font-size: 1.2rem;
  letter-spacing: 0;
}

p,
.muted {
  color: var(--muted);
  line-height: 1.55;
}

form {
  display: grid;
  gap: 16px;
}

label,
fieldset {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 0.94rem;
}

fieldset {
  margin: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

legend {
  padding: 0 6px;
  color: var(--text);
  font-weight: 800;
}

input {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fbfcfd;
  color: var(--text);
  font: inherit;
}

input:focus {
  border-color: var(--accent);
  outline: 3px solid rgba(255, 45, 137, 0.2);
}

.checkbox-row {
  grid-template-columns: 18px 1fr;
  align-items: start;
}

.checkbox-row input {
  min-height: auto;
  margin-top: 2px;
}

button,
.button {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 14px;
  border: 1px solid var(--accent);
  border-radius: 6px;
  background: var(--accent);
  color: #ffffff;
  font: inherit;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
}

.btn-primary,
.btn-primary:hover,
.btn-primary:focus,
.btn-primary.focus,
.btn-primary:not(:disabled):not(.disabled):active,
.btn-primary:not(:disabled):not(.disabled).active {
  border-color: var(--accent) !important;
  background-color: var(--accent) !important;
  color: #ffffff !important;
  box-shadow: none;
}

.btn-primary:hover,
.btn-primary:focus,
.btn-primary.focus,
.btn-primary:not(:disabled):not(.disabled):active,
.btn-primary:not(:disabled):not(.disabled).active {
  border-color: var(--accent-strong) !important;
  background-color: var(--accent-strong) !important;
}

body.authentication-bg,
.authentication-bg {
  min-height: 100vh;
  background-color: #000000 !important;
  background-image: url("../assets/images/facecard/auth-bg-desktop.webp") !important;
  background-position: center !important;
  background-size: cover !important;
  background-repeat: no-repeat !important;
}

.authentication-bg .account-pages {
  min-height: calc(100vh - 70px);
  display: flex;
  align-items: center;
  margin-top: 0 !important;
  margin-bottom: 0 !important;
  padding: 40px 0;
}

.authentication-bg .auth-card {
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.28);
}

.authentication-bg .auth-brand-header {
  border-bottom: 0;
  background: var(--accent);
}

.authentication-bg .auth-logo {
  width: min(169px, 58%);
  height: auto;
}

.authentication-bg .footer-alt,
.authentication-bg .text-muted a,
.authentication-bg .text-muted b {
  color: rgba(255, 255, 255, 0.88) !important;
}

.authentication-bg .row.mt-3 .text-muted {
  color: rgba(255, 255, 255, 0.78) !important;
}

.button.secondary {
  background: #ffffff;
  color: var(--accent);
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 14px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
}

td span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.9rem;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.inline-permissions {
  gap: 10px;
}

.inline-permissions button {
  width: fit-content;
}

.empty-state,
.form-error {
  margin-bottom: 0;
}

.form-error {
  color: var(--danger);
  font-weight: 700;
}

.flash-stack {
  width: min(1120px, calc(100% - 32px));
  margin: 20px auto 0;
  display: grid;
  gap: 10px;
}

.flash {
  margin: 0;
  padding: 12px 14px;
  border-radius: 8px;
  background: #ffffff;
  border: 1px solid var(--line);
}

.flash-error {
  color: var(--danger);
}

.flash-success {
  color: var(--success);
}

.status {
  width: fit-content;
  padding: 2px 8px;
  border-radius: 999px;
  background: #eef2f6;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

@media (max-width: 760px) {
  body.authentication-bg,
  .authentication-bg {
    background-image: url("../assets/images/facecard/auth-bg-mobile.webp") !important;
  }

  .authentication-bg .account-pages {
    padding: 24px 0;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
    padding: 18px;
  }

  .admin-grid {
    grid-template-columns: 1fr;
  }

  h1 {
    font-size: 2rem;
  }

  table,
  thead,
  tbody,
  tr,
  th,
  td {
    display: block;
  }

  thead {
    display: none;
  }

  tr {
    padding: 12px 0;
    border-bottom: 1px solid var(--line);
  }

  td {
    padding: 8px 0;
    border-bottom: 0;
  }
}
