:root {
  color-scheme: light;
  --auth-green: #d85b05;
  --auth-green-dark: #923b06;
  --auth-green-soft: #fff0e6;
  --auth-ink: #16231d;
  --auth-muted: #64736c;
  --auth-border: #dce5e0;
  --auth-danger: #b42318;
  --auth-warning: #9a6700;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html:has(body.auth-page) {
  height: 100%;
  overflow: hidden;
}

body.auth-page {
  height: 100dvh;
  min-height: 0;
  margin: 0;
  overflow: hidden;
  color: var(--auth-ink);
  background:
    radial-gradient(circle at 12% 15%, rgba(238, 108, 25, .18), transparent 34rem),
    linear-gradient(135deg, #fffaf6 0%, #f8eee7 100%);
}

.auth-layout {
  height: 100dvh;
  min-height: 0;
  width: min(1080px, calc(100% - 32px));
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 440px);
  gap: clamp(48px, 8vw, 112px);
  align-items: center;
  padding: clamp(20px, 4vh, 40px) 0;
}

.auth-brand { max-width: 560px; }
.auth-logo {
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  border-radius: 17px;
  color: white;
  background: var(--auth-green);
  font: 800 28px/1 Georgia, serif;
  box-shadow: 0 14px 34px rgba(216, 91, 5, .23);
}
.auth-eyebrow {
  margin: 28px 0 10px;
  color: var(--auth-green);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .11em;
  text-transform: uppercase;
}
.auth-brand h1 { margin: 0; max-width: 620px; font-size: clamp(38px, 5vw, 62px); line-height: 1.03; letter-spacing: -.045em; }
.auth-brand > p:not(.auth-eyebrow) { max-width: 540px; color: var(--auth-muted); font-size: 18px; line-height: 1.6; }
.auth-security-note { display: inline-flex; gap: 10px; align-items: center; margin-top: 16px; padding: 11px 14px; border: 1px solid #f1d1bd; border-radius: 999px; color: var(--auth-green-dark); background: rgba(255,255,255,.66); font-size: 13px; font-weight: 700; }
.auth-security-note span { color: #ef7a23; }

.auth-card {
  padding: 28px;
  border: 1px solid rgba(210, 222, 216, .9);
  border-radius: 24px;
  background: rgba(255, 255, 255, .94);
  box-shadow: 0 28px 80px rgba(91, 44, 15, .14);
  backdrop-filter: blur(12px);
}
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; padding: 5px; border-radius: 13px; background: #edf2ef; }
.auth-tabs button { border: 0; border-radius: 10px; padding: 10px 12px; color: var(--auth-muted); background: transparent; font: inherit; font-size: 14px; font-weight: 750; cursor: pointer; }
.auth-tabs button.active { color: var(--auth-green-dark); background: white; box-shadow: 0 2px 8px rgba(91, 44, 15, .12), inset 0 0 0 1px rgba(216, 91, 5, .16); }
.auth-form { display: grid; gap: 17px; margin-top: 26px; }
.auth-form h2 { margin: 0; font-size: 25px; letter-spacing: -.02em; }
.auth-form[hidden] { display: none !important; }
.auth-form:not([hidden]) { animation: auth-panel-in .18s ease-out; }
.auth-form p { margin: 5px 0 0; color: var(--auth-muted); font-size: 14px; line-height: 1.45; }
.auth-form label { display: grid; gap: 7px; color: #2f4038; font-size: 13px; font-weight: 750; }
.auth-form input, .auth-admin select {
  width: 100%;
  border: 1px solid #cfdad4;
  border-radius: 11px;
  padding: 11px 12px;
  color: var(--auth-ink);
  background: white;
  font: inherit;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.auth-form input:focus, .auth-admin select:focus { border-color: #ef7a23; box-shadow: 0 0 0 4px rgba(239, 122, 35, .14); }
.auth-form small { color: var(--auth-muted); font-weight: 500; line-height: 1.4; }
.auth-primary, .auth-secondary, .auth-danger-button {
  border: 0;
  border-radius: 11px;
  padding: 12px 15px;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}
.auth-primary { color: white; background: var(--auth-green); box-shadow: 0 8px 18px rgba(216, 91, 5, .22); }
.auth-primary:hover { background: var(--auth-green-dark); }
.auth-primary:disabled, .auth-secondary:disabled { cursor: wait; opacity: .62; }
.auth-secondary { color: var(--auth-green-dark); background: var(--auth-green-soft); }
.auth-danger-button { color: var(--auth-danger); background: #fff0ee; }
.auth-notice { margin-top: 18px; padding: 12px 14px; border-radius: 11px; color: var(--auth-green-dark); background: var(--auth-green-soft); font-size: 14px; line-height: 1.45; }
.auth-notice.error { color: var(--auth-danger); background: #fff0ee; }
.auth-notice.warning { color: var(--auth-warning); background: #fff7db; }

.auth-admin { min-height: 100vh; margin: 0; padding: 32px; color: var(--auth-ink); background: #f3f7f5; }
.auth-admin-shell { width: min(1180px, 100%); margin: 0 auto; }
.auth-admin-header { display: flex; justify-content: space-between; gap: 24px; align-items: center; margin-bottom: 24px; }
.auth-admin-header h1 { margin: 0; font-size: 30px; letter-spacing: -.03em; }
.auth-admin-header p { margin: 6px 0 0; color: var(--auth-muted); }
.auth-admin-card { overflow: hidden; border: 1px solid var(--auth-border); border-radius: 17px; background: white; box-shadow: 0 12px 35px rgba(30, 56, 44, .07); }
.auth-admin table { width: 100%; border-collapse: collapse; }
.auth-admin th, .auth-admin td { padding: 15px 16px; border-bottom: 1px solid #edf1ef; text-align: left; vertical-align: middle; }
.auth-admin th { color: var(--auth-muted); background: #fafcfb; font-size: 12px; letter-spacing: .04em; text-transform: uppercase; }
.auth-admin td { font-size: 14px; }
.auth-admin .user-name { font-weight: 800; }
.auth-admin .user-email { margin-top: 3px; color: var(--auth-muted); font-size: 12px; }
.auth-status { display: inline-flex; padding: 5px 9px; border-radius: 999px; font-size: 12px; font-weight: 800; }
.auth-status.ativo { color: #086642; background: #e6f6ee; }
.auth-status.pendente { color: #8a5b00; background: #fff3cd; }
.auth-status.desativado { color: #9b251d; background: #feeceb; }
.auth-actions { display: flex; gap: 8px; align-items: center; }
.auth-actions select { min-width: 142px; padding: 8px 9px; }
.auth-empty { padding: 44px; text-align: center; color: var(--auth-muted); }

@media (max-width: 820px) {

@keyframes auth-panel-in {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (min-width: 821px) and (max-height: 760px) {
  .auth-card { padding: 20px; }
  .auth-form { gap: 11px; margin-top: 16px; }
  .auth-form input { padding-block: 9px; }
  .auth-brand h1 { font-size: clamp(36px, 4.4vw, 52px); }
  .auth-eyebrow { margin-top: 20px; }
  .auth-security-note { margin-top: 8px; }
}
  html:has(body.auth-page) { height: auto; overflow: auto; }
  body.auth-page { height: auto; min-height: 100dvh; overflow: auto; }
  .auth-layout { height: auto; min-height: 100dvh; grid-template-columns: 1fr; gap: 30px; padding: 28px 0; }
  .auth-brand h1 { font-size: 38px; }
  .auth-brand > p:not(.auth-eyebrow), .auth-security-note { display: none; }
  .auth-admin { padding: 18px; }
  .auth-admin-card { overflow-x: auto; }
  .auth-admin table { min-width: 860px; }
}
