.auth-page,
.support-page,
.state-page {
  min-height: 100vh;
  padding: clamp(24px, 4vw, 56px);
  color: var(--color-text);
  background:
    linear-gradient(135deg, rgba(255, 253, 248, 0.92), rgba(232, 223, 209, 0.84)),
    var(--color-bg);
}

.auth-shell {
  display: grid;
  grid-template-columns: minmax(220px, 0.8fr) minmax(320px, 460px);
  align-items: center;
  gap: clamp(28px, 5vw, 72px);
  width: min(980px, 100%);
  min-height: calc(100vh - clamp(48px, 8vw, 112px));
  margin: 0 auto;
}

.auth-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 220px;
}

.auth-brand img {
  display: block;
  width: min(100%, 340px);
  height: auto;
  padding: 24px;
  border: 1px solid rgba(173, 130, 85, 0.28);
  border-radius: var(--radius-md);
  background: rgba(255, 253, 248, 0.86);
  box-shadow: var(--shadow-soft);
}

.auth-card,
.state-panel {
  width: 100%;
  padding: clamp(24px, 4vw, 38px);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: rgba(255, 253, 248, 0.96);
  box-shadow: var(--shadow-card);
}

.auth-card h1,
.state-panel h1 {
  margin: 0 0 20px;
  color: var(--color-text);
  font-size: clamp(1.55rem, 2.2vw, 2.1rem);
  line-height: 1.12;
  letter-spacing: 0;
}

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

.auth-form label {
  display: grid;
  gap: 7px;
  color: var(--color-text);
  font-size: 0.92rem;
  font-weight: 700;
}

.auth-form input,
.support-form textarea {
  width: 100%;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: white;
  color: var(--color-text);
  font: inherit;
  outline: none;
  transition: border-color 140ms ease, box-shadow 140ms ease;
}

.auth-form input {
  min-height: 44px;
  padding: 10px 12px;
}

.auth-form input:focus,
.support-form textarea:focus {
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(173, 130, 85, 0.16);
}

.auth-form a,
.support-header a,
.secondary-action {
  color: var(--sa-azul-ardosia);
  font-weight: 800;
}

.auth-message,
.support-feedback {
  margin: 0 0 16px;
  padding: 11px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.92rem;
  line-height: 1.35;
}

.auth-message[hidden],
.support-feedback[hidden] {
  display: none;
}

.auth-message.is-success,
.support-feedback.is-success {
  border: 1px solid rgba(107, 122, 90, 0.28);
  background: rgba(107, 122, 90, 0.12);
  color: #3c4b2f;
}

.auth-message.is-error,
.support-feedback.is-error {
  border: 1px solid rgba(160, 55, 45, 0.28);
  background: rgba(160, 55, 45, 0.1);
  color: #7b2b24;
}

.primary-action,
.secondary-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  font: inherit;
  font-weight: 800;
  text-align: center;
}

.primary-action {
  color: white;
  background: var(--color-accent);
  box-shadow: 0 10px 18px rgba(173, 130, 85, 0.22);
}

.primary-action:hover,
.primary-action:focus-visible {
  background: #9d7346;
}

.primary-action:disabled {
  cursor: wait;
  opacity: 0.68;
}

.secondary-action {
  width: fit-content;
  border: 1px solid var(--color-border);
  background: rgba(255, 253, 248, 0.88);
}

.state-page {
  display: grid;
  place-items: center;
}

.state-panel {
  max-width: 520px;
}

.state-panel p {
  margin: 0 0 20px;
  color: var(--color-text-muted);
}

@media (max-width: 900px) {
  .auth-shell {
    grid-template-columns: 1fr;
    align-content: center;
  }

  .auth-brand {
    min-height: auto;
  }

  .auth-brand img {
    width: min(240px, 86vw);
    padding: 18px;
  }
}

/* Login, recuperação e definição de nova senha */
body.auth-layout .app-shell {
  grid-template-columns: minmax(0, 1fr);
}

body.auth-layout .sidebar,
body.auth-layout .sidebar-toggle {
  display: none;
}

/* Remove também a logo que fica ao lado do formulário */
body.auth-layout .auth-brand {
  display: none;
}

body.auth-layout .auth-page {
  display: grid;
  place-items: center;
  min-height: 100vh;
  min-height: 100dvh;
  padding: clamp(20px, 4vw, 48px);
}

body.auth-layout .auth-shell {
  display: block;
  width: min(460px, 100%);
  min-height: 0;
  margin: 0 auto;
}

body.auth-layout .auth-card {
  width: 100%;
}

/* Visual opt-in para login e recuperação */
body.auth-layout .auth-page.auth-page--split {
  display: block;
  place-items: initial;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 0;
  overflow-x: hidden;
  background: #f5f0e7;
}

body.auth-layout .auth-page.auth-page--split .auth-split {
  display: grid;
  grid-template-columns: minmax(0, 42fr) minmax(0, 58fr);
  min-height: 100vh;
  min-height: 100dvh;
  width: 100%;
  background: #f5f0e7;
}

.auth-page--split .auth-split__panel {
  display: grid;
  align-items: center;
  justify-items: center;
  min-width: 0;
  padding: clamp(28px, 5vw, 72px);
}

.auth-page--split .auth-split__content {
  width: min(100%, 410px);
}

.auth-page--split .auth-split__logo {
  display: block;
  width: min(238px, 72vw);
  height: auto;
  margin: 0 0 clamp(28px, 4vw, 44px);
}

.auth-page--split .auth-split__accent {
  display: block;
  width: 54px;
  height: 4px;
  margin: 0 0 18px;
  border-radius: 999px;
  background: #ad8255;
}

.auth-page--split h1 {
  margin: 0 0 12px;
  color: #30281f;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2rem, 3.2vw, 3rem);
  font-weight: 700;
  line-height: 1.04;
  letter-spacing: 0;
}

.auth-page--split .auth-split__subtitle {
  max-width: 34ch;
  margin: 0 0 26px;
  color: rgba(48, 40, 31, 0.72);
  font-size: 1rem;
  line-height: 1.55;
}

.auth-page--split .auth-message {
  margin: 0 0 18px;
  overflow-wrap: anywhere;
}

.auth-page--split .auth-form {
  gap: 10px;
}

.auth-page--split .auth-field-label {
  display: block;
  margin-top: 4px;
  color: #30281f;
  font-size: 0.9rem;
  font-weight: 800;
}

.auth-page--split .auth-field {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 48px;
}

.auth-page--split .auth-field__icon {
  position: absolute;
  left: 14px;
  display: inline-flex;
  width: 20px;
  height: 20px;
  color: rgba(48, 40, 31, 0.46);
  pointer-events: none;
}

.auth-page--split .auth-field__icon svg {
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.auth-page--split .auth-form input:not([type="checkbox"]) {
  min-height: 48px;
  padding: 12px 14px 12px 46px;
  border-color: rgba(48, 40, 31, 0.22);
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.92);
  color: #30281f;
}

.auth-page--split .auth-form input:not([type="checkbox"])::placeholder {
  color: rgba(48, 40, 31, 0.46);
}

.auth-page--split .auth-form input:not([type="checkbox"]):focus {
  border-color: #64734f;
  box-shadow: 0 0 0 3px rgba(100, 115, 79, 0.18);
}

.auth-page--split .auth-field--password input {
  padding-right: 92px;
}

.auth-page--split .auth-password-toggle {
  position: absolute;
  right: 6px;
  min-height: 36px;
  padding: 0 10px;
  border: 0;
  border-radius: 6px;
  color: #64734f;
  background: transparent;
  font: inherit;
  font-size: 0.84rem;
  font-weight: 800;
}

.auth-page--split .auth-password-toggle:hover,
.auth-page--split .auth-password-toggle:focus-visible {
  color: #536140;
  background: rgba(100, 115, 79, 0.12);
}

.auth-page--split .auth-remember {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  width: fit-content;
  margin: 4px 0 6px;
  color: rgba(48, 40, 31, 0.72);
  font-size: 0.92rem;
  font-weight: 700;
}

.auth-page--split .auth-remember input[type="checkbox"] {
  flex: 0 0 auto;
  width: 17px;
  height: 17px;
  min-height: 0;
  margin: 0;
  padding: 0;
  border-radius: 4px;
  accent-color: #64734f;
}

.auth-page--split .primary-action {
  width: 100%;
  min-height: 48px;
  margin-top: 2px;
  border-radius: 8px;
  color: #fff;
  background: #64734f;
  box-shadow: 0 12px 22px rgba(83, 97, 64, 0.22);
}

.auth-page--split .primary-action:hover,
.auth-page--split .primary-action:focus-visible {
  background: #536140;
}

.auth-page--split .primary-action:disabled {
  background: #7f8b70;
  box-shadow: none;
}

.auth-page--split .auth-form a {
  width: fit-content;
  margin-top: 4px;
  color: #64734f;
  font-size: 0.92rem;
}

.auth-page--split .auth-form a:hover,
.auth-page--split .auth-form a:focus-visible {
  color: #536140;
}

.auth-page--split .auth-split__media {
  position: relative;
  min-width: 0;
  min-height: 100vh;
  min-height: 100dvh;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(48, 40, 31, 0.18), rgba(100, 115, 79, 0.18)),
    #d8c6ad;
}

.auth-page--split .auth-split__media img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
}

@media (max-width: 900px) {
  body.auth-layout .auth-page.auth-page--split .auth-split {
    grid-template-columns: 1fr;
  }

  .auth-page--split .auth-split__panel {
    min-height: 100vh;
    min-height: 100dvh;
    padding: clamp(24px, 7vw, 44px);
  }

  .auth-page--split .auth-split__content {
    width: min(100%, 420px);
  }

  .auth-page--split .auth-split__logo {
    width: min(220px, 68vw);
    margin-bottom: 28px;
  }

  .auth-page--split .auth-split__media {
    display: none;
  }
}

@media (max-width: 380px) {
  .auth-page--split .auth-split__panel {
    padding: 22px 18px;
  }

  .auth-page--split h1 {
    font-size: 1.85rem;
  }

  .auth-page--split .auth-field--password input {
    padding-right: 84px;
  }

  .auth-page--split .auth-password-toggle {
    padding: 0 8px;
    font-size: 0.78rem;
  }
}

@media (max-height: 680px) and (min-width: 901px) {
  .auth-page--split .auth-split__panel {
    align-items: start;
    padding-top: 34px;
    padding-bottom: 34px;
  }
}

/* Alterar senha: formulário centralizado sem logo lateral */
.auth-page.auth-page--change-password {
  display: grid;
  place-items: center;
  min-height: 100vh;
  min-height: 100dvh;
  padding: clamp(20px, 4vw, 48px);
}

.auth-page--change-password .auth-brand {
  display: none;
}

.auth-page--change-password .auth-shell {
  display: block;
  width: min(460px, 100%);
  min-height: 0;
  margin: 0 auto;
}

.auth-page--change-password .auth-card {
  width: 100%;
}