/* ===========================================================
   Auth — minimalismo central, inputs underline com floating
   label, foco em conteúdo. Sem depender de SB Admin 2.
   =========================================================== */

:root {
  --plantaai-green: #4c8f49;
  --plantaai-green-dark: #3a6e38;
  --plantaai-green-light: #6aae67;
  --auth-text: #0f1419;
  --auth-text-muted: #5b6675;
  --auth-border: #d7dce4;
  --auth-border-focus: var(--plantaai-green);
  --auth-error: #c0392b;
  --auth-error-bg: #fdecea;
  --auth-bg: #ffffff;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body.auth-body {
  font-family: 'Inter', system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--auth-bg);
  color: var(--auth-text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Detalhe orgânico discreto */
.auth-organic {
  position: fixed;
  bottom: -160px;
  right: -160px;
  width: 460px;
  height: 460px;
  background: radial-gradient(circle, rgba(76, 143, 73, 0.10), transparent 70%);
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
}
.auth-organic.auth-organic-2 {
  bottom: auto;
  right: auto;
  top: -200px;
  left: -200px;
  width: 380px;
  height: 380px;
  background: radial-gradient(circle, rgba(76, 143, 73, 0.07), transparent 70%);
}

.auth-shell {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.25rem;
  position: relative;
  z-index: 1;
}

.auth-card {
  width: 100%;
  max-width: 380px;
}

.auth-brand {
  display: flex;
  justify-content: center;
  margin-bottom: 2.75rem;
}
.auth-brand img {
  height: 36px;
  display: block;
}

.auth-titulo {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.015em;
  margin: 0 0 0.4rem;
  color: var(--auth-text);
}

.auth-subtitulo {
  font-size: 0.9rem;
  color: var(--auth-text-muted);
  margin: 0 0 2rem;
  line-height: 1.55;
}

/* Erro */
.auth-erro {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  background: var(--auth-error-bg);
  color: var(--auth-error);
  padding: 0.75rem 0.85rem;
  border-radius: 0.55rem;
  margin-bottom: 1.5rem;
  font-size: 0.85rem;
  animation: auth-fade-in 0.25s ease-out;
}
.auth-erro i { line-height: 1.4; flex-shrink: 0; margin-top: 1px; }

@keyframes auth-fade-in {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Floating label */
.auth-field {
  position: relative;
  margin-bottom: 1.5rem;
}

.auth-field input {
  width: 100%;
  border: 0;
  border-bottom: 1.5px solid var(--auth-border);
  background: transparent;
  padding: 1.45rem 2rem 0.5rem 0;
  font-size: 1rem;
  color: var(--auth-text);
  outline: none;
  transition: border-color 0.2s;
  font-family: inherit;
}
.auth-field input:focus {
  border-bottom-color: var(--auth-border-focus);
}

.auth-field label {
  position: absolute;
  left: 0;
  top: 1.15rem;
  font-size: 1rem;
  color: var(--auth-text-muted);
  pointer-events: none;
  transition: top 0.18s ease, font-size 0.18s ease, color 0.18s ease, letter-spacing 0.18s ease;
}

.auth-field input:focus ~ label,
.auth-field input:not(:placeholder-shown) ~ label {
  top: -0.1rem;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--plantaai-green);
}

/* Toggle senha */
.auth-toggle-senha {
  position: absolute;
  right: 0;
  top: 1.05rem;
  background: transparent;
  border: 0;
  color: var(--auth-text-muted);
  cursor: pointer;
  padding: 0.3rem;
  font-size: 0.95rem;
  transition: color 0.15s;
  line-height: 1;
}
.auth-toggle-senha:hover { color: var(--auth-text); }
.auth-toggle-senha:focus-visible {
  outline: 2px solid var(--plantaai-green-light);
  outline-offset: 2px;
  border-radius: 4px;
}

/* Linha lembrar / esqueci */
.auth-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: -0.25rem 0 1.75rem;
  font-size: 0.85rem;
  gap: 1rem;
}

.auth-check {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  cursor: pointer;
  user-select: none;
  color: var(--auth-text-muted);
}

.auth-check input {
  appearance: none;
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border: 1.5px solid var(--auth-border);
  border-radius: 5px;
  cursor: pointer;
  position: relative;
  transition: background 0.15s, border-color 0.15s;
  background: transparent;
}
.auth-check input:checked {
  background: var(--plantaai-green);
  border-color: var(--plantaai-green);
}
.auth-check input:checked::after {
  content: '';
  position: absolute;
  left: 5px;
  top: 1px;
  width: 5px;
  height: 10px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(42deg);
}

.auth-link {
  color: var(--plantaai-green);
  text-decoration: none;
  font-weight: 500;
}
.auth-link:hover { text-decoration: underline; color: var(--plantaai-green-dark); }

/* Botão entrar */
.auth-btn {
  width: 100%;
  background: var(--plantaai-green);
  color: white;
  border: 0;
  padding: 0.9rem 1rem;
  border-radius: 0.55rem;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  transition: background 0.15s, transform 0.05s;
  font-family: inherit;
  letter-spacing: 0.01em;
}
.auth-btn:hover  { background: var(--plantaai-green-dark); }
.auth-btn:active { transform: translateY(1px); }
.auth-btn[disabled] { opacity: 0.75; cursor: not-allowed; }

.auth-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255,255,255,0.4);
  border-top-color: white;
  border-radius: 50%;
  animation: auth-spin 0.7s linear infinite;
  display: none;
}
.auth-btn.is-loading .auth-spinner { display: inline-block; }

@keyframes auth-spin {
  to { transform: rotate(360deg); }
}

/* Footer */
.auth-footer {
  text-align: center;
  padding: 1.5rem 1rem;
  font-size: 0.72rem;
  color: var(--auth-text-muted);
  position: relative;
  z-index: 1;
  letter-spacing: 0.01em;
}
.auth-footer a { color: inherit; text-decoration: none; }
.auth-footer a:hover { color: var(--plantaai-green); }

@media (max-width: 480px) {
  .auth-shell { padding: 1.5rem 1rem; }
  .auth-brand { margin-bottom: 2rem; }
  .auth-titulo { font-size: 1.35rem; }
  .auth-organic { width: 340px; height: 340px; bottom: -120px; right: -120px; }
  .auth-organic.auth-organic-2 { display: none; }
}
