:root {
  color-scheme: light;
  --orange: #ff6a00;
  --orange-deep: #e94f00;
  --ink: #111214;
  --muted: #68707c;
  --line: rgba(17, 18, 20, 0.09);
  --glass: rgba(255, 255, 255, 0.78);
  --danger: #d92d20;
  --success: #078f5b;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC",
    "Helvetica Neue", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 15%, rgba(255, 106, 0, 0.13), transparent 34%),
    radial-gradient(circle at 88% 78%, rgba(17, 18, 20, 0.09), transparent 36%),
    linear-gradient(145deg, #f8f8f6, #eef1f5);
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.page-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px;
}

.login-card {
  width: min(970px, 100%);
  min-height: 590px;
  overflow: hidden;
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  background: var(--glass);
  border: 1px solid rgba(255, 255, 255, 0.86);
  border-radius: 34px;
  box-shadow: 0 28px 80px rgba(15, 20, 30, 0.18);
  backdrop-filter: blur(30px) saturate(1.35);
  -webkit-backdrop-filter: blur(30px) saturate(1.35);
}

.brand-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 46px;
  color: white;
  background:
    linear-gradient(155deg, rgba(255, 118, 25, 0.95), rgba(225, 65, 0, 0.96) 58%, #161616);
}

.brand-panel::after {
  content: "";
  position: absolute;
  inset: 12% -35% auto auto;
  width: 330px;
  aspect-ratio: 1;
  border: 40px solid rgba(255, 255, 255, 0.09);
  border-radius: 50%;
}

.brand-logo {
  position: relative;
  z-index: 1;
  width: 108px;
  height: 108px;
  object-fit: cover;
  border-radius: 27px;
  border: 1px solid rgba(255, 255, 255, 0.34);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.24);
}

.brand-copy {
  position: relative;
  z-index: 1;
}

.brand-copy h1 {
  margin: 0 0 14px;
  font-size: clamp(34px, 4vw, 50px);
  letter-spacing: -0.05em;
}

.brand-copy p {
  margin: 0;
  max-width: 330px;
  font-size: 17px;
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.8);
}

.form-panel {
  display: grid;
  align-content: center;
  padding: 52px 60px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--orange-deep);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.13em;
}

.form-panel h2,
.admin-title h1 {
  margin: 0;
  letter-spacing: -0.04em;
}

.form-panel h2 {
  font-size: 34px;
}

.subtitle {
  margin: 10px 0 28px;
  color: var(--muted);
  line-height: 1.6;
}

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

.field {
  display: grid;
  gap: 8px;
}

.field span {
  font-size: 14px;
  font-weight: 750;
}

.field input,
.field select {
  width: 100%;
  height: 52px;
  padding: 0 16px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(17, 18, 20, 0.13);
  border-radius: 15px;
  outline: none;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.field input:focus,
.field select:focus {
  border-color: var(--orange);
  box-shadow: 0 0 0 4px rgba(255, 106, 0, 0.13);
}

.actions {
  display: flex;
  gap: 12px;
  margin-top: 8px;
}

.primary-button,
.secondary-button,
.danger-button {
  min-height: 48px;
  padding: 0 20px;
  border-radius: 14px;
  border: 1px solid transparent;
  font-weight: 800;
  transition: transform 160ms ease, box-shadow 160ms ease, opacity 160ms ease;
}

.primary-button {
  color: white;
  background: linear-gradient(135deg, var(--orange), var(--orange-deep));
  box-shadow: 0 12px 28px rgba(255, 91, 0, 0.26);
}

.secondary-button {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.7);
  border-color: rgba(17, 18, 20, 0.12);
}

.danger-button {
  color: var(--danger);
  background: rgba(217, 45, 32, 0.08);
  border-color: rgba(217, 45, 32, 0.14);
}

.primary-button:hover,
.secondary-button:hover,
.danger-button:hover {
  transform: translateY(-1px);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  transform: none;
}

.message {
  min-height: 22px;
  margin: 12px 0 0;
  color: var(--danger);
  font-size: 14px;
  line-height: 1.5;
}

.registration-footer {
  margin-top: 18px;
  padding-top: 16px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
  text-align: center;
  border-top: 1px solid var(--line);
}

.registration-footer a {
  color: inherit;
  text-decoration: none;
  text-underline-offset: 3px;
  transition: color 160ms ease;
}

.registration-footer a:hover,
.registration-footer a:focus-visible {
  color: var(--orange-deep);
  text-decoration: underline;
}

.hidden {
  display: none !important;
}

.admin-page {
  min-height: 100vh;
  padding: 26px;
  background:
    radial-gradient(circle at 12% 8%, rgba(255, 255, 255, 0.88), transparent 34%),
    linear-gradient(145deg, #e3e5e8, #f5f6f7 52%, #e9eaec);
}

.admin-shell {
  width: min(1280px, 100%);
  margin: 0 auto;
}

.admin-header,
.glass-card {
  background: linear-gradient(145deg, rgba(253, 253, 254, 0.97), rgba(226, 228, 231, 0.9));
  border: 1px solid rgba(255, 255, 255, 0.86);
  box-shadow:
    0 18px 50px rgba(20, 26, 34, 0.09),
    inset 0 1px 0 rgba(255, 255, 255, 0.96);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  padding: 22px 26px;
  border-radius: 24px;
}

.admin-title {
  display: flex;
  align-items: center;
  gap: 16px;
}

.admin-title img {
  width: 58px;
  height: 58px;
  border-radius: 16px;
  object-fit: cover;
}

.admin-title h1 {
  font-size: 27px;
}

.admin-title p {
  margin: 5px 0 0;
  color: var(--muted);
}

.admin-actions {
  display: flex;
  gap: 10px;
}

.admin-grid {
  display: grid;
  grid-template-columns: minmax(300px, 0.72fr) minmax(520px, 1.28fr);
  gap: 20px;
  margin-top: 20px;
}

.glass-card {
  padding: 26px;
  border-radius: 24px;
}

.glass-card h2 {
  margin: 0 0 6px;
  font-size: 22px;
}

.card-note {
  margin: 0 0 22px;
  color: var(--muted);
  line-height: 1.55;
}

.user-list,
.audit-list {
  display: grid;
  gap: 12px;
}

.user-row,
.audit-row {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: rgba(255, 255, 255, 0.66);
}

.user-row {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto;
  gap: 16px;
  align-items: center;
}

.user-main strong {
  display: block;
  font-size: 16px;
}

.user-main small,
.audit-row small {
  color: var(--muted);
}

.row-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.row-actions button {
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: white;
  font-weight: 700;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  padding: 4px 9px;
  border-radius: 999px;
  color: var(--success);
  background: rgba(7, 143, 91, 0.09);
  font-size: 12px;
  font-weight: 800;
}

.status.disabled {
  color: var(--danger);
  background: rgba(217, 45, 32, 0.08);
}

.audit-card {
  grid-column: 1 / -1;
}

.audit-row {
  display: flex;
  justify-content: space-between;
  gap: 18px;
}

.empty-state {
  padding: 30px 16px;
  color: var(--muted);
  text-align: center;
}

dialog {
  width: min(460px, calc(100% - 34px));
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 24px;
  padding: 0;
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.28);
}

dialog::backdrop {
  background: rgba(10, 13, 18, 0.42);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.dialog-body {
  padding: 26px;
}

.dialog-body h2 {
  margin: 0 0 20px;
}

@media (max-width: 780px) {
  .page-shell {
    padding: 14px;
  }

  .login-card {
    grid-template-columns: 1fr;
    border-radius: 26px;
  }

  .brand-panel {
    min-height: 210px;
    padding: 28px;
  }

  .brand-logo {
    width: 72px;
    height: 72px;
    border-radius: 20px;
  }

  .brand-copy h1 {
    margin-top: 30px;
    font-size: 34px;
  }

  .brand-copy p {
    display: none;
  }

  .form-panel {
    padding: 34px 26px 38px;
  }

  .registration-footer {
    margin-top: 16px;
    padding-top: 13px;
    font-size: 11px;
  }

  .admin-page {
    padding: 14px;
  }

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

  .admin-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .admin-grid {
    display: grid;
  }

  .user-row,
  .audit-row {
    grid-template-columns: 1fr;
    flex-direction: column;
  }

  .row-actions {
    justify-content: flex-start;
  }
}

/* Apple-inspired login foundation ------------------------------------- */
.page-shell {
  background: #f5f5f7;
}

.page-shell .login-card {
  width: min(940px, 100%);
  min-height: 560px;
  grid-template-columns: minmax(300px, 0.82fr) minmax(420px, 1.18fr);
  overflow: hidden;
  background: #fff;
  border: 1px solid rgba(29, 29, 31, 0.1);
  border-radius: 24px;
  box-shadow:
    0 1px 2px rgba(15, 23, 42, 0.04),
    0 24px 64px rgba(15, 23, 42, 0.1);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.page-shell .brand-panel {
  justify-content: flex-start;
  gap: 42px;
  padding: 44px 40px;
  color: #f5f5f7;
  background: #202124;
}

.page-shell .brand-panel::after {
  inset: auto -96px -128px auto;
  width: 300px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.025);
}

.page-shell .brand-logo {
  width: 84px;
  height: 84px;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.2);
}

.page-shell .brand-copy {
  margin-top: auto;
}

.page-shell .brand-copy h1 {
  margin-bottom: 12px;
  font-size: clamp(32px, 4vw, 44px);
  font-weight: 700;
  letter-spacing: -0.04em;
}

.page-shell .brand-copy p {
  max-width: 300px;
  color: rgba(245, 245, 247, 0.72);
  font-size: 15px;
  line-height: 1.75;
}

.page-shell .form-panel {
  align-content: center;
  padding: 48px 56px;
  background: #fff;
}

.page-shell .form-panel > .eyebrow {
  margin-bottom: 14px;
  color: #8a8a91;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
}

.page-shell .form-panel h2 {
  color: #1d1d1f;
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -0.035em;
}

.page-shell .subtitle {
  margin: 8px 0 28px;
  color: #68686f;
  font-size: 14px;
}

.page-shell .form-grid {
  gap: 18px;
}

.page-shell .field {
  gap: 7px;
}

.page-shell .field > span {
  color: #343438;
  font-size: 13px;
  font-weight: 600;
}

.page-shell .field input,
.page-shell .field select {
  height: 50px;
  padding: 0 14px;
  color: #1d1d1f;
  background: #fff;
  border: 1px solid rgba(29, 29, 31, 0.16);
  border-radius: 10px;
  box-shadow: inset 0 1px 1px rgba(15, 23, 42, 0.02);
  transition: border-color 180ms ease, box-shadow 180ms ease, background-color 180ms ease;
}

.page-shell .field input:hover,
.page-shell .field select:hover {
  border-color: rgba(29, 29, 31, 0.28);
}

.page-shell .field input:focus,
.page-shell .field select:focus {
  border-color: #f45d00;
  box-shadow: 0 0 0 3px rgba(244, 93, 0, 0.14);
}

.page-shell .field input[aria-invalid="true"] {
  border-color: #b42318;
  box-shadow: 0 0 0 3px rgba(180, 35, 24, 0.1);
}

.page-shell .field-error {
  display: block;
  color: #b42318;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.4;
}

.page-shell .actions {
  margin-top: 4px;
}

.page-shell .primary-button,
.page-shell .secondary-button,
.page-shell .danger-button {
  min-height: 48px;
  border-radius: 10px;
  font-weight: 650;
  transition: background-color 180ms ease, border-color 180ms ease, box-shadow 180ms ease, opacity 180ms ease;
}

.page-shell .primary-button {
  color: #fff;
  background: #f45d00;
  box-shadow: none;
}

.page-shell .primary-button:hover {
  background: #d94f00;
}

.page-shell .primary-button:hover,
.page-shell .secondary-button:hover,
.page-shell .danger-button:hover {
  transform: none;
}

.page-shell .primary-button:focus-visible,
.page-shell .secondary-button:focus-visible,
.page-shell .danger-button:focus-visible {
  outline: 3px solid rgba(244, 93, 0, 0.22);
  outline-offset: 2px;
}

.page-shell .message {
  min-height: 0;
  margin-top: 14px;
  padding: 0;
  color: #68686f;
}

.page-shell .message:empty {
  display: none;
}

.page-shell .message[data-state="error"] {
  display: block;
  padding: 10px 12px;
  color: #8f1f17;
  background: #fff1f0;
  border: 1px solid rgba(180, 35, 24, 0.14);
  border-radius: 10px;
}

.page-shell .registration-footer {
  color: #8a8a91;
  border-color: rgba(29, 29, 31, 0.08);
}

@media (max-width: 780px) {
  .page-shell {
    padding: 12px;
  }

  .page-shell .login-card {
    grid-template-columns: 1fr;
    grid-template-rows: max-content minmax(0, 1fr);
    min-height: calc(100vh - 24px);
    border-radius: 20px;
  }

  .page-shell .brand-panel {
    min-height: auto;
    flex-direction: row;
    align-items: center;
    gap: 16px;
    padding: 22px;
  }

  .page-shell .brand-logo {
    width: 58px;
    height: 58px;
    border-radius: 14px;
  }

  .page-shell .brand-copy {
    margin: 0;
  }

  .page-shell .brand-copy h1 {
    margin: 0 0 3px;
    font-size: 24px;
  }

  .page-shell .brand-copy p {
    display: block;
    font-size: 12px;
    line-height: 1.45;
  }

  .page-shell .form-panel {
    padding: 30px 22px 26px;
  }

  .page-shell .form-panel h2 {
    font-size: 27px;
  }

  .page-shell :is(button, input, select) {
    min-height: 44px;
  }
}

/* Apple-inspired account administration foundation ------------------- */
.admin-page {
  color: #1d1d1f;
  background: #f5f5f7;
}

.admin-header,
.glass-card {
  border: 1px solid rgba(29, 29, 31, 0.1);
  background: #fff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

.admin-header,
.glass-card,
body:has(.admin-page) dialog {
  border-radius: 16px;
}

.admin-title img {
  border-radius: 14px;
  box-shadow: none;
}

.admin-title h1,
.glass-card h2,
body:has(.admin-page) dialog h2 {
  color: #1d1d1f;
  font-weight: 700;
  letter-spacing: -0.025em;
}

.admin-title p,
.admin-page .card-note,
.admin-page .user-main small,
.admin-page .audit-row small,
.admin-page .empty-state {
  color: #68686f;
}

.admin-page .field input,
.admin-page .field select,
body:has(.admin-page) dialog .field input,
body:has(.admin-page) dialog .field select {
  height: 48px;
  border: 1px solid rgba(29, 29, 31, 0.16);
  border-radius: 10px;
  color: #1d1d1f;
  background: #fff;
  box-shadow: inset 0 1px 1px rgba(15, 23, 42, 0.02);
  transition: border-color 180ms ease, box-shadow 180ms ease;
}

.admin-page .field input:focus,
.admin-page .field select:focus,
body:has(.admin-page) dialog .field input:focus,
body:has(.admin-page) dialog .field select:focus {
  border-color: #f45d00;
  box-shadow: 0 0 0 3px rgba(244, 93, 0, 0.14);
}

.admin-page :is(.primary-button, .secondary-button, .danger-button),
body:has(.admin-page) dialog :is(.primary-button, .secondary-button, .danger-button) {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  box-shadow: none;
  font-weight: 650;
  text-decoration: none;
  transition: background-color 180ms ease, border-color 180ms ease, opacity 180ms ease;
}

.admin-page .primary-button,
body:has(.admin-page) dialog .primary-button {
  color: #fff;
  background: #f45d00;
}

.admin-page .primary-button:hover,
body:has(.admin-page) dialog .primary-button:hover {
  background: #d94f00;
  transform: none;
}

.admin-page .secondary-button,
body:has(.admin-page) dialog .secondary-button {
  border-color: rgba(29, 29, 31, 0.14);
  color: #343438;
  background: #fff;
}

.admin-page .danger-button,
body:has(.admin-page) dialog .danger-button {
  border-color: rgba(180, 35, 24, 0.18);
  color: #8f1f17;
  background: #fff1f0;
}

.admin-page :is(.primary-button, .secondary-button, .danger-button):hover,
body:has(.admin-page) dialog :is(.primary-button, .secondary-button, .danger-button):hover {
  transform: none;
}

.admin-page :is(button, a, input, select):focus-visible,
body:has(.admin-page) dialog :is(button, input, select):focus-visible {
  outline: 3px solid rgba(244, 93, 0, 0.22);
  outline-offset: 2px;
}

.admin-page :is(.user-row, .audit-row),
body:has(.admin-page) dialog {
  border: 1px solid rgba(29, 29, 31, 0.1);
  background: #fff;
  box-shadow: none;
}

.admin-page .row-actions button {
  min-height: 44px;
  border-radius: 10px;
  color: #343438;
  background: #fff;
  box-shadow: none;
}

body:has(.admin-page) dialog {
  box-shadow:
    0 1px 2px rgba(15, 23, 42, 0.05),
    0 20px 54px rgba(15, 23, 42, 0.16);
}

body:has(.admin-page) dialog::backdrop {
  background: rgba(16, 16, 18, 0.42);
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

@media (max-width: 780px) {
  .admin-page {
    padding: 12px;
  }

  .admin-header,
  .glass-card {
    padding: 20px;
  }

  .admin-actions {
    width: 100%;
    flex-wrap: wrap;
  }

  .admin-page :is(button, a.secondary-button, input, select) {
    min-height: 44px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .page-shell *,
  .page-shell *::before,
  .page-shell *::after,
  .admin-page *,
  .admin-page *::before,
  .admin-page *::after,
  body:has(.admin-page) dialog,
  body:has(.admin-page) dialog * {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
