:root {
  --radius: 999px;
  --card-radius: 4.8rem;
}

html {
  font-size: 62.5%;
  box-sizing: border-box;
}

*,
*::before,
*::after {
  box-sizing: inherit;
}

body {
  font-family: "Inter", system-ui, sans-serif;
  font-size: 1.6rem;
  color: #111;
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh; /* for mobile browsers */
  display: grid;
  place-items: center;
  background: #7a2a5c;
  padding: 1.5rem;
}

body.app {
  display: block;
  padding: 0;
  background: #f4f4f6;
}

.auth-card {
  display: grid;
  grid-template-columns: 1fr 1fr;
  width: min(110rem, 100%);
  min-height: min(80rem, calc(100dvh - 3rem)); /* ← was "height" */
  padding: 1.4rem;
  background-color: #fff;
  border-radius: var(--card-radius);
}

.auth-media {
  position: relative;
  border-radius: 4rem;
  overflow: hidden;
}

.auth-media__img {
  position: absolute; /* ← add */
  inset: 0;
  object-position: center;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.auth-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: safe center; /* ← change: was "center" */
  align-items: center;
  padding: 4.8rem 5.6rem;
}

.auth-panel > :not(.auth-back) {
  width: 100%;
  max-width: 42rem;
}

.auth-back {
  position: absolute;
  top: 3.2rem;
  left: 3.2rem;
  display: grid;
  place-items: center;
  width: 4.4rem;
  height: 4.4rem;
  border: 1px solid #e5e5e5;
  border-radius: var(--radius);
  color: inherit;
  text-decoration: none;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease,
    color 0.2s ease;
}

.auth-back:hover,
.auth-back:focus-visible {
  transform: translateY(-3px);
  box-shadow:
    0 6px 12px rgba(0, 0, 0, 0.08),
    /* soft contact shadow */ 0 14px 28px rgba(0, 0, 0, 0.12);

  color: #1e10ea;
}

.auth-back:active {
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.auth-panel h1 {
  margin: 0 0 2rem;
  font-size: 4rem;
  font-weight: 700;
  text-align: center;
  letter-spacing: -0.02em;
}

.auth-sub {
  margin: 0 0 3.2rem;
  font-size: 1.6rem;
  text-align: center;
  color: #6b6b6b;
}

.auth-sub a {
  color: #111;
  font-weight: 600;
  text-decoration: none;
}

.auth-sub a:hover {
  color: #1e10ea;
  text-decoration: underline;
}

.auth-form {
  display: flex;
  flex-direction: column;
}

.field {
  position: relative;
  margin-bottom: 2rem;

  input {
    margin-bottom: 0;
  }

  label {
    position: absolute;
    left: 1.8rem;
    top: 50%;
    transform: translateY(-50%);
    margin: 0;
    padding: 0 0.6rem;
    background-color: #fff;
    color: #6b6b6b;
    font-size: 1.6rem;
    font-weight: 400;
    pointer-events: none;
    transition: all 0.2s ease;
  }

  input:focus + label,
  input:not(:placeholder-shown) + label {
    top: 0;
    font-size: 1.2rem;
    font-weight: 600;
  }

  input:focus + label {
    color: #1e10ea;
  }
}

.auth-form input {
  width: 100%;
  height: 5.6rem;
  padding: 0 2.4rem;
  border: 1px solid #e5e5e5;
  border-radius: var(--radius);
  font: inherit;
  background-color: #fff;
}

.auth-form input:focus {
  outline: none;
  border-color: #1e10ea;
  box-shadow: 0 5px 6px 0px rgba(30, 16, 234, 0.2);
}

.field-password input {
  padding-right: 5.6rem;
}

.field-password__toggle {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  right: 1.6rem;
  padding: 0.4rem;
  cursor: pointer;
  border: 0;
  background: none;
  touch-action: none;
  user-select: none;

  img {
    display: block;
  }
}

.auth-forgot {
  align-self: flex-end;
  margin: -0.8rem 0 2.4rem;
  font-size: 1.4rem;
  color: #111;
  text-decoration: none;
}

.auth-forgot:hover {
  color: #1e10ea;
  text-decoration: underline;
}

.btn-primary {
  height: 5.6rem;
  border: 0;
  border-radius: var(--radius);
  background: #111;
  font: inherit;
  color: #fff;
  font-weight: 600;
  cursor: pointer;
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease,
    background 0.2s ease;
}

.btn-primary:hover {
  background: #1e10ea;
  transform: translateY(-3px);
  box-shadow:
    0 8px 16px rgba(30, 16, 234, 0.25),
    0 16px 32px rgba(30, 16, 234, 0.15);
}

.btn-primary:active {
  transform: translateY(0px);
  box-shadow: 0 2px 6px rgba(30, 16, 234, 0.2);
}

/* ---------- "or" divider + Continue with Google ---------- */
.auth-divider {
  display: flex;
  align-items: center;
  gap: 1.6rem;
  margin: 2.4rem 0;
  color: #9a9a9a;
  font-size: 1.4rem;
}

/* the two lines either side of "or" */
.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: #e5e5e5;
}

.btn-social {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.2rem;
  height: 5.6rem;
  border: 1px solid #e5e5e5;
  border-radius: var(--radius);
  background: #fff;
  color: #111;
  font-weight: 600;
  text-decoration: none;
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease,
    border-color 0.2s ease;
}

.btn-social:hover,
.btn-social:focus-visible {
  border-color: #d0d0d0;
  transform: translateY(-2px);
  box-shadow:
    0 6px 12px rgba(0, 0, 0, 0.06),
    0 12px 24px rgba(0, 0, 0, 0.08);
}

.btn-social:active {
  transform: translateY(0);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.auth-error {
  margin-bottom: 3rem;
  color: #e00;
  font-size: 1.4rem;
  font-weight: 600;
  font-style: italic;
  text-align: center;
}

.field-error {
  margin: -1.4rem 0 1.6rem 2rem; /* pulls it up into the .field's bottom gap */
  font-size: 1.3rem;
  color: #d92d20;
}

.auth-form input[aria-invalid="true"] {
  border-color: #d92d20;
}

.error-page {
  text-align: center;
}

.error-code {
  margin: 0;
  font-size: 9.6rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.04em;
  color: #1e10ea;
}

/* .btn-primary is a <button> elsewhere; as a link it needs these */
a.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 3.2rem;
  text-decoration: none;
}

.app-nav {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 2.4rem;
  padding: 1.6rem 3.2rem;
  background: #fff;
  border-bottom: 1px solid #eee;
}
.app-nav__brand {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-weight: 700;
  color: inherit;
  text-decoration: none;
}
.app-nav__links {
  display: flex;
  gap: 0.8rem;
  margin-right: auto;
}
.app-nav__links a {
  padding: 0.8rem 1.6rem;
  border-radius: var(--radius);
  color: #6b6b6b;
  text-decoration: none;
  font-weight: 500;
}
.app-nav__links a[aria-current="page"] {
  background: #111;
  color: #fff;
}

.app-main {
  width: min(96rem, 100%);
  margin: 0 auto;
  padding: 4rem 2.4rem;
}
.page-head h1 {
  margin: 0 0 0.4rem;
  font-size: 3.2rem;
  letter-spacing: -0.02em;
}
.muted {
  color: #6b6b6b;
  margin: 0 0 2.4rem;
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(28rem, 1fr));
  gap: 2rem;
}
.stack {
  display: grid;
  gap: 2rem;
}
.card {
  background: #fff;
  border-radius: 2.4rem;
  padding: 2.8rem;
  box-shadow:
    0 1px 2px rgba(0, 0, 0, 0.04),
    0 8px 24px rgba(0, 0, 0, 0.04);
}
.card h2 {
  margin: 0 0 1.6rem;
  font-size: 2rem;
}
.card .auth-form {
  max-width: 48rem;
}

.details {
  margin: 0 0 2rem;
}
.details div {
  display: flex;
  justify-content: space-between;
  gap: 1.6rem;
  padding: 1.2rem 0;
  border-bottom: 1px solid #f0f0f0;
}
.details dt {
  color: #6b6b6b;
}
.details dd {
  margin: 0;
  font-weight: 600;
  text-align: right;
}

.badge {
  display: inline-block;
  margin-left: 0.6rem;
  padding: 0.2rem 1rem;
  border-radius: var(--radius);
  font-size: 1.2rem;
  font-weight: 600;
}
.badge--ok {
  background: #e7f8ee;
  color: #137a3c;
}
.badge--warn {
  background: #fff4e0;
  color: #9a5b00;
}

.notice {
  padding: 1.2rem 1.6rem;
  border-radius: 1.2rem;
  background: #eef0ff;
  color: #1e10ea;
}

.btn-ghost {
  display: inline-flex;
  align-items: center;
  height: 4rem;
  padding: 0 1.6rem;
  border: 1px solid #e5e5e5;
  border-radius: var(--radius);
  background: #fff;
  color: inherit;
  font: inherit;
  text-decoration: none;
  cursor: pointer;
}
.btn-danger {
  height: 4.8rem;
  padding: 0 2.4rem;
  border: 0;
  border-radius: var(--radius);
  background: #d92d20;
  color: #fff;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.otp {
  display: flex;
  justify-content: center;
  gap: 1.2rem;
  margin-bottom: 2.4rem;
}

/* ".auth-form .otp__box", not just ".otp__box": your ".auth-form input" rule
   (width 100%, pill radius, padding) is more specific than one class and would win */
.auth-form .otp__box {
  flex: 1;
  max-width: 5.6rem;
  height: 6.4rem;
  padding: 0;
  text-align: center;
  font-size: 2.4rem;
  font-weight: 600;
  border-radius: 1.6rem;
}

.resend {
  margin-top: 2.4rem;
  text-align: center;
  color: #6b6b6b;
}

.link-button {
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  font-weight: 600;
  color: #111;
  text-decoration: underline;
  cursor: pointer;
}
.link-button:disabled {
  color: #9a9a9a;
  text-decoration: none;
  cursor: default;
}

/* =========================================================================
   Admin pages
   ========================================================================= */

/* sub-navigation under the page title */
.admin-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-bottom: 2.4rem;
  padding-bottom: 1.6rem;
  border-bottom: 1px solid #e5e5e5;
}
.admin-tabs a {
  padding: 0.8rem 1.6rem;
  border-radius: var(--radius);
  color: #6b6b6b;
  font-weight: 500;
  text-decoration: none;
}
.admin-tabs a:hover { background: #ececf0; }
.admin-tabs a[aria-current="page"] {
  background: #1e10ea;
  color: #fff;
}

.back-link { color: #6b6b6b; text-decoration: none; }
.back-link:hover { color: #1e10ea; }

/* filter bar (GET forms) */
.filters {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 1.6rem;
  margin-bottom: 2.4rem;
  padding: 2rem;
  background: #fff;
  border-radius: 2rem;
}
.filters__field {
  display: grid;
  gap: 0.6rem;
  font-size: 1.3rem;
  font-weight: 600;
  color: #6b6b6b;
}
.filters__field--grow { flex: 1 1 24rem; }
.filters__field input,
.filters__field select,
.action__row input,
.action__row select {
  height: 4rem;
  padding: 0 1.4rem;
  border: 1px solid #e5e5e5;
  border-radius: 1.2rem;
  background: #fff;
  color: #111;
  font: inherit;
  font-weight: 400;
}
.filters__field input:focus,
.filters__field select:focus,
.action__row input:focus,
.action__row select:focus {
  outline: none;
  border-color: #1e10ea;
  box-shadow: 0 0 0 3px rgba(30, 16, 234, 0.12);
}
.filters__actions { display: flex; gap: 0.8rem; }

.btn-small {
  height: 4rem;
  padding: 0 2rem;
}
.btn-ghost:disabled {
  color: #9a9a9a;
  cursor: not-allowed;
}

/* tables: scroll sideways on small screens instead of squashing */
.table-wrap {
  overflow-x: auto;
  background: #fff;
  border-radius: 2rem;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 8px 24px rgba(0, 0, 0, 0.04);
}
.card .table-wrap { box-shadow: none; border: 1px solid #f0f0f0; }

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 1.4rem;
}
.data-table th,
.data-table td {
  padding: 1.4rem 1.6rem;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid #f0f0f0;
  white-space: nowrap;
}
.data-table th {
  font-size: 1.2rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #6b6b6b;
}
.data-table th a { color: inherit; text-decoration: none; }
.data-table th a:hover { color: #1e10ea; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover { background: #fafafc; }
.data-table td .muted { display: block; margin: 0; font-size: 1.3rem; }
.data-table__primary { font-weight: 600; color: #111; text-decoration: none; }
.data-table__primary:hover { color: #1e10ea; text-decoration: underline; }
.data-table__details {
  max-width: 36rem;
  white-space: normal !important;
  overflow-wrap: anywhere;
}

.empty-state {
  padding: 4rem;
  text-align: center;
  color: #6b6b6b;
  background: #fff;
  border-radius: 2rem;
}

.pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
  margin-top: 2rem;
}
.pagination a,
.pagination span[aria-current="page"] {
  display: inline-grid;
  place-items: center;
  min-width: 4rem;
  height: 4rem;
  padding: 0 1.2rem;
  border-radius: var(--radius);
  text-decoration: none;
}
.pagination a { color: #111; background: #fff; border: 1px solid #e5e5e5; }
.pagination a:hover { border-color: #1e10ea; color: #1e10ea; }
.pagination span[aria-current="page"] { background: #111; color: #fff; font-weight: 600; }
.pagination__gap { color: #9a9a9a; }
.table-count { margin-top: 1.2rem; font-size: 1.3rem; }

.badge--danger { background: #fdecea; color: #b42318; }
.badge--muted { background: #f0f0f3; color: #4a4a55; }
.badge--admin { background: #eef0ff; color: #1e10ea; }

/* user detail: action forms */
.admin-actions { margin: 2rem 0; }
.action-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(24rem, 1fr));
  gap: 1.6rem;
}
.action {
  display: grid;
  align-content: start;
  gap: 0.8rem;
  padding: 2rem;
  border: 1px solid #f0f0f0;
  border-radius: 1.6rem;
}
.action .muted { margin: 0; font-size: 1.3rem; }
.action__row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
}
.action__row input,
.action__row select { flex: 1 1 14rem; }

.danger-zone {
  display: grid;
  gap: 0.8rem;
  margin-top: 2.4rem;
  padding: 2rem;
  border: 1px solid #f5c2bd;
  border-radius: 1.6rem;
  background: #fffafa;
}
.danger-zone h3 { margin: 0; color: #b42318; }
.danger-zone .muted { margin: 0; }

/* maintenance form */
.maintenance-form {
  display: grid;
  gap: 1.6rem;
  max-width: 48rem;
}
.maintenance-form .btn-primary { justify-self: start; padding: 0 3.2rem; }
.checkbox {
  display: flex;
  align-items: center;
  gap: 1rem;
  cursor: pointer;
}
.checkbox input { width: 1.8rem; height: 1.8rem; accent-color: #1e10ea; }

@media (max-width: 600px) {
  .app-nav {
    flex-wrap: wrap;
    padding: 1.2rem 1.6rem;
    gap: 1.2rem;
  }
  .app-nav__links {
    order: 3;
    width: 100%;
  } /* links drop to their own row */
  .app-main {
    padding: 2.4rem 1.6rem;
  }
}

/* tablet: drop the photo, card becomes a single column */
@media (max-width: 900px) {
  .auth-card {
    grid-template-columns: 1fr;
    min-height: auto;
  }
  .auth-media {
    display: none;
  }
  .auth-panel {
    padding: 8rem 3.2rem 4.8rem;
  } /* extra top room for the back arrow */
}

/* phone: card fills the screen */
@media (max-width: 480px) {
  body {
    padding: 0;
    place-items: stretch;
  }
  .auth-card {
    border-radius: 0;
    min-height: 100dvh;
    height: auto;
    padding: 0;
  }
  .auth-panel {
    padding: 7.2rem 2rem 3.2rem;
  }
  .auth-panel h1 {
    font-size: 3.2rem;
  }
  .auth-back {
    top: 2rem;
    left: 2rem;
  }
}

/* respect users who turn off animations in their OS */
@media (prefers-reduced-motion: reduce) {
  .auth-back,
  .btn-social {
    transition: none;
  }
  .auth-back:hover,
  .btn-social:hover,
  .btn-social:focus-visible {
    transform: none;
  }
}
