@font-face {
  font-family: PratiDisplay;
  src: url('/assets/fonts/baloo-2.woff2') format('woff2');
  font-weight: 400 800;
  font-display: swap;
}
@font-face {
  font-family: PratiSans;
  src: url('/assets/fonts/nunito-sans.woff2') format('woff2');
  font-weight: 200 900;
  font-display: swap;
}
@font-face {
  font-family: PratiHand;
  src: url('/assets/fonts/caveat.woff2') format('woff2');
  font-weight: 400 700;
  font-display: swap;
}

:root {
  --canvas-bg: #fffbf5;
  --card-bg: #ffffff;
  --ink-primary: #21150e;
  --ink-muted: #7d7268;
  --orange: #ff6408;
  --orange-ink: #ff7810;
  --orange-pale: #fff1e6;
  --border-subtle: #f0e6dc;
  --shadow-device: 0 20px 60px rgba(112, 70, 30, 0.12), 0 4px 18px rgba(0, 0, 0, 0.04);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

/* ==========================================================================
   SCROLLBAR OFICIAL DO PRATISSIMO (8PX COM MARGEM DE SEGURANÇA)
   ========================================================================== */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--canvas-bg);
  margin: 14px 0;
}
::-webkit-scrollbar-thumb {
  background: #d8c6b2;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--orange);
}

*, *::before, *::after {
  box-sizing: border-box;
  -webkit-user-select: none;
  -moz-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

input {
  -webkit-user-select: text;
  -moz-user-select: text;
  user-select: text;
}

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  min-height: 100dvh;
  background: var(--canvas-bg);
  color: var(--ink-primary);
  font-family: PratiSans, Arial, sans-serif;
  overflow-x: hidden;
}

body.public-auth-body {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  padding: 24px 16px;
}

/* ==========================================================================
   AMBIENTE COM FOLHAS VERDES FLUTUANTES NO FUNDO DESKTOP
   ========================================================================== */
.auth-ambient-canvas {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  overflow: hidden;
}

.ambient-drop {
  position: absolute;
  background: #ffab66;
  border-radius: 50% 50% 50% 10%;
  opacity: 0.55;
  pointer-events: none;
}
.drop-1 {
  width: 24px;
  height: 48px;
  top: 8%;
  left: 6%;
  transform: rotate(-35deg);
}
.drop-2 {
  width: 18px;
  height: 36px;
  bottom: 8%;
  left: 5%;
  transform: rotate(45deg);
}
.drop-3 {
  width: 20px;
  height: 40px;
  top: 25%;
  right: 6%;
  transform: rotate(-60deg);
}

/* Folhas Verdes Flutuantes Externas no Desktop */
.desktop-leaf {
  position: absolute;
  background: linear-gradient(135deg, #649438, #4f7929);
  border-radius: 80% 0 80% 0;
  pointer-events: none;
  box-shadow: 0 10px 24px rgba(79, 121, 41, 0.22);
  display: none;
  animation: desktopLeafFloat 6s ease-in-out infinite alternate;
}

.leaf-d-1 {
  width: 44px;
  height: 30px;
  top: 14%;
  left: 12%;
  transform: rotate(-22deg);
}
.leaf-d-2 {
  width: 38px;
  height: 26px;
  bottom: 18%;
  left: 14%;
  transform: rotate(48deg);
  animation-delay: -2.5s;
}
.leaf-d-3 {
  width: 46px;
  height: 32px;
  top: 35%;
  right: 12%;
  transform: rotate(35deg);
  animation-delay: -1.2s;
}
.leaf-d-4 {
  width: 36px;
  height: 24px;
  bottom: 22%;
  right: 15%;
  transform: rotate(-50deg);
  animation-delay: -3.8s;
}

@keyframes desktopLeafFloat {
  0% { transform: translateY(0) rotate(var(--base-rot, 0deg)); }
  100% { transform: translateY(-14px) rotate(calc(var(--base-rot, 0deg) + 6deg)); }
}

@media (min-width: 992px) {
  .desktop-leaf {
    display: block;
  }
}

/* ==========================================================================
   CHASSI DO DISPOSITIVO (CONTAINER CENTRAL COM ARQUITETURA FLUIDA 60 FPS)
   ========================================================================== */
.auth-viewport-wrapper {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 440px;
  margin: 0 auto;
}

.auth-card-device {
  background: var(--card-bg);
  border: 1px solid var(--border-subtle);
  border-radius: 46px;
  box-shadow: var(--shadow-device);
  padding: 38px 30px 34px;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  box-sizing: border-box;
}

/* ==========================================================================
   TOPO: LOGOTIPO OFICIAL PRATISSIMO (LINK PARA HOME) & SLOGAN
   ========================================================================== */
.auth-header-top {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  margin-bottom: 8px;
}

.brand-link {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.brand-link:hover {
  transform: scale(1.03);
}

.brand-text {
  font-family: PratiDisplay, sans-serif;
  font-weight: 800;
  font-size: 38px;
  color: #1a1008;
  letter-spacing: -0.6px;
  position: relative;
  display: inline-flex;
  align-items: center;
  line-height: 1;
}

.brand-splash {
  position: absolute;
  right: -16px;
  top: 2px;
  width: 18px;
  height: 18px;
  pointer-events: none;
}
.brand-splash::before,
.brand-splash::after {
  content: '';
  position: absolute;
  background: var(--orange);
  border-radius: 50% 50% 50% 10%;
  transform: rotate(35deg);
}
.brand-splash::before {
  width: 7px;
  height: 12px;
  top: 0;
  left: 2px;
}
.brand-splash::after {
  width: 5px;
  height: 8px;
  bottom: 0;
  right: 0;
}

.brand-slogan {
  font-family: PratiSans, sans-serif;
  font-size: 13.5px;
  font-weight: 750;
  color: #3b281b;
  margin: 6px 0 0 0;
  letter-spacing: -0.2px;
}

/* ==========================================================================
   PALCO DO MASCOTE COM BLINDAGEM TOTAL CONTRA ARRASTE
   ========================================================================== */
.mascot-stage-box {
  width: 100%;
  height: 250px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  margin: 6px 0 2px;
}

.mascot-ambient-circle {
  position: absolute;
  width: 210px;
  height: 210px;
  border-radius: 50%;
  background: radial-gradient(circle, #fff3e6 0%, rgba(255, 243, 230, 0.4) 65%, transparent 100%);
  z-index: 1;
}

/* Proteção absoluta: A imagem não pode ser arrastada nem destacada */
.mascot-avatar-hero,
.mascot-stage-box img {
  position: relative;
  z-index: 2;
  width: 230px;
  height: 230px;
  object-fit: contain;
  filter: drop-shadow(0 12px 24px rgba(138, 86, 36, 0.16));
  -webkit-user-drag: none !important;
  user-drag: none !important;
  -webkit-user-select: none !important;
  -moz-user-select: none !important;
  user-select: none !important;
  pointer-events: none !important;
}

/* Folhas Orgânicas Flutuantes ao Redor do Pratto */
.pratto-leaf {
  position: absolute;
  width: 24px;
  height: 16px;
  background: #6a963e;
  border-radius: 80% 0 80% 0;
  z-index: 3;
  pointer-events: none;
  box-shadow: 0 4px 10px rgba(106, 150, 62, 0.25);
  animation: leafFloat 3.8s ease-in-out infinite;
}

.leaf-top-left {
  top: 26px;
  left: 38px;
  transform: rotate(-30deg);
}
.leaf-top-right {
  top: 42px;
  right: 32px;
  transform: rotate(45deg);
  animation-delay: -1.2s;
}
.leaf-bottom-left {
  bottom: 30px;
  left: 48px;
  transform: rotate(55deg);
  animation-delay: -2s;
}
.leaf-bottom-right {
  bottom: 24px;
  right: 44px;
  transform: rotate(-40deg);
  animation-delay: -0.6s;
}

.pratto-splash {
  position: absolute;
  background: var(--orange);
  border-radius: 50% 50% 50% 10%;
  z-index: 3;
  pointer-events: none;
  opacity: 0.85;
}
.splash-top {
  width: 10px;
  height: 18px;
  top: 15px;
  right: 90px;
  transform: rotate(25deg);
}
.splash-bottom {
  width: 8px;
  height: 14px;
  bottom: 35px;
  left: 80px;
  transform: rotate(-45deg);
}

@keyframes leafFloat {
  0%, 100% { transform: translateY(0) rotate(var(--rot, 0deg)); }
  50% { transform: translateY(-6px) rotate(calc(var(--rot, 0deg) + 4deg)); }
}

/* ==========================================================================
   CARROSSEL DE FRASES COM ARRASTE (MOUSE & TOUCH) A 60 FPS
   ========================================================================== */
.onboarding-carousel-viewport {
  width: 100%;
  overflow: hidden;
  position: relative;
  cursor: grab;
  touch-action: pan-y;
  user-select: none;
  margin-top: 8px;
}
.onboarding-carousel-viewport:active {
  cursor: grabbing;
}

.onboarding-carousel-track {
  display: flex;
  width: 100%;
  transition: transform 0.38s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: transform;
}
.onboarding-carousel-track.is-dragging {
  transition: none !important;
}

.carousel-slide-item {
  flex: 0 0 100%;
  width: 100%;
  text-align: center;
  padding: 0 8px;
  box-sizing: border-box;
}

.onboarding-title {
  font-family: PratiDisplay, sans-serif;
  font-size: 26px;
  font-weight: 800;
  line-height: 1.15;
  color: var(--ink-primary);
  margin: 0 0 8px 0;
  text-wrap: balance;
}
.onboarding-title .highlight {
  color: var(--orange);
}

.onboarding-desc {
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--ink-muted);
  margin: 0 auto;
  max-width: 320px;
  text-wrap: pretty;
}

/* Pontinhos de Paginação */
.carousel-dots-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 18px 0 22px;
}
.carousel-dots-row .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #ded7cf;
  border: none;
  padding: 0;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
.carousel-dots-row .dot.active {
  width: 20px;
  border-radius: 6px;
  background: var(--orange);
}

/* ==========================================================================
   PALCO DE TRANSIÇÃO FLUIDA ENTRE TELAS (60 FPS)
   ========================================================================== */
.auth-panels-stage-viewport {
  position: relative;
  width: 100%;
  overflow: hidden;
  min-height: 440px;
}

.auth-view-panel {
  width: 100%;
  display: flex;
  flex-direction: column;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease;
  will-change: transform, opacity;
}

.auth-view-panel.is-active {
  display: flex;
  opacity: 1;
  position: relative;
  transform: translate3d(0, 0, 0);
  pointer-events: auto;
}

.auth-view-panel.is-hidden {
  display: none;
  opacity: 0;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  transform: translate3d(36px, 0, 0);
  pointer-events: none;
}

.auth-view-panel.slide-left {
  transform: translate3d(-36px, 0, 0) !important;
}

/* ==========================================================================
   BOTÕES DE AÇÃO E CADASTRO
   ========================================================================== */
.onboarding-actions-group {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
}

.btn-auth-primary {
  width: 100%;
  height: 52px;
  border-radius: 30px;
  background: linear-gradient(105deg, #ff8912, #ff5b06);
  color: #ffffff !important;
  border: none;
  font-family: PratiSans, sans-serif;
  font-size: 15px;
  font-weight: 850;
  line-height: 1 !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
  box-shadow: 0 8px 22px rgba(255, 91, 6, 0.35);
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s;
  text-decoration: none !important;
}
.btn-auth-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(255, 91, 6, 0.45);
}
.btn-auth-primary:active {
  transform: translateY(0);
}
.btn-auth-primary svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
}

.btn-auth-secondary {
  width: 100%;
  height: 52px;
  border-radius: 30px;
  background: #faf4eb;
  border: 1px solid #ebdccb;
  color: var(--ink-primary);
  font-family: PratiSans, sans-serif;
  font-size: 15px;
  font-weight: 800;
  line-height: 1 !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}
.btn-auth-secondary:hover {
  background: #f4eae0;
  border-color: #dfcebc;
  transform: translateY(-2px);
}

/* ==========================================================================
   LOGIN EXCLUSIVO COM GOOGLE (BOTÃO OFICIAL MODERNO)
   ========================================================================== */
.social-divider-row {
  display: flex;
  align-items: center;
  text-align: center;
  margin: 20px 0 14px;
  width: 100%;
}
.social-divider-row::before,
.social-divider-row::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid #ede1d2;
}
.social-divider-row span {
  padding: 0 14px;
  font-size: 12px;
  font-weight: 700;
  color: #9c9186;
}

.social-buttons-row {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
}

.btn-social-google-full {
  width: 100%;
  height: 50px;
  border-radius: 30px;
  background: #ffffff;
  border: 1.5px solid #ebdccb;
  box-shadow: 0 4px 14px rgba(112, 70, 30, 0.08);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  cursor: pointer;
  font-family: PratiSans, sans-serif;
  font-size: 14px;
  font-weight: 800;
  color: var(--ink-primary);
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.2s, border-color 0.2s;
}
.btn-social-google-full:hover {
  transform: translateY(-2px);
  border-color: var(--orange);
  box-shadow: 0 8px 20px rgba(255, 100, 8, 0.18);
}
.btn-social-google-full svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

/* ==========================================================================
   FORMULÁRIOS DE LOGIN E CADASTRO
   ========================================================================== */
.panel-header-nav {
  margin-bottom: 14px;
}
.btn-nav-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  color: var(--ink-muted);
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  padding: 4px 0;
  transition: color 0.2s;
}
.btn-nav-back:hover {
  color: var(--orange);
}
.btn-nav-back svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  stroke-width: 2.2;
  fill: none;
}

.panel-intro-block {
  margin-bottom: 18px;
}
.panel-intro-block h2 {
  font-family: PratiDisplay, sans-serif;
  font-size: 26px;
  color: var(--ink-primary);
  margin: 0 0 6px 0;
  line-height: 1.2;
}
.panel-intro-block p {
  font-size: 13.5px;
  color: var(--ink-muted);
  margin: 0;
  line-height: 1.5;
}

.auth-input-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
  width: 100%;
}
.auth-input-group label {
  font-size: 13px;
  font-weight: 750;
  color: var(--ink-primary);
}

.label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.btn-text-link {
  background: none;
  border: none;
  color: var(--orange);
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  padding: 0;
}
.btn-text-link:hover {
  text-decoration: underline;
}

.input-field-wrap {
  display: flex;
  align-items: center;
  background: #faf6f0;
  border: 1.5px solid var(--border-subtle);
  border-radius: 18px;
  padding: 0 14px;
  height: 48px;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}
.input-field-wrap:focus-within {
  border-color: var(--orange);
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(255, 100, 8, 0.15);
}

.field-icon {
  width: 18px;
  height: 18px;
  color: #a89d92;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  margin-right: 10px;
  flex-shrink: 0;
}

.input-field-wrap input {
  width: 100%;
  border: none;
  outline: none;
  background: transparent;
  color: var(--ink-primary);
  font-size: 14px;
  font-family: inherit;
}
.input-field-wrap input::placeholder {
  color: #b8ada2;
}

.btn-toggle-eye {
  background: none;
  border: none;
  padding: 4px;
  color: #a89d92;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: color 0.2s;
}
.btn-toggle-eye:hover {
  color: var(--orange);
}
.btn-toggle-eye svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
}

.btn-submit-form {
  margin-top: 10px;
  position: relative;
}

.btn-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: authSpin 0.6s linear infinite;
  display: none;
}
@keyframes authSpin { to { transform: rotate(360deg); } }

.btn-submit-form.is-loading .btn-spinner { display: block; }
.btn-submit-form.is-loading span { display: none; }

.panel-footer-switch {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 22px;
  font-size: 13px;
  color: var(--ink-muted);
}

.btn-inline-link {
  background: none;
  border: none;
  color: var(--orange);
  font-size: 13px;
  font-weight: 850;
  cursor: pointer;
  padding: 0;
}
.btn-inline-link:hover {
  text-decoration: underline;
}

/* ==========================================================================
   TOASTS DO SISTEMA EM PRIMEIRO PLANO ABSOLUTO
   ========================================================================== */
#pratissimo-toast-stack {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 999999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 360px;
  width: calc(100% - 40px);
  pointer-events: none;
}

.toast-item {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 18px;
  border-radius: 16px;
  background: #ffffff;
  border: 1px solid #ebdccb;
  box-shadow: 0 14px 34px rgba(112, 70, 30, 0.18);
  color: var(--ink-primary);
  font-size: 13.5px;
  font-weight: 750;
  animation: toastSlideIn 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes toastSlideIn {
  from { opacity: 0; transform: translateY(-16px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.toast-item.leaving {
  animation: toastSlideOut 0.25s cubic-bezier(0.4, 0, 1, 1) forwards;
}
@keyframes toastSlideOut {
  to { opacity: 0; transform: translateY(-16px) scale(0.95); }
}

.toast-item.toast-success { border-left: 4px solid #4caf50; }
.toast-item.toast-error { border-left: 4px solid #f44336; }
.toast-item.toast-info { border-left: 4px solid var(--orange); }

.toast-msg { flex: 1; line-height: 1.4; }
.toast-close { background: none; border: none; font-size: 14px; color: #a89d92; cursor: pointer; padding: 2px; }

/* ==========================================================================
   RESPONSIVIDADE (CELULARES E MOBILE EDGE-TO-EDGE)
   ========================================================================== */
@media (max-width: 480px) {
  body.public-auth-body {
    padding: 0;
    align-items: flex-start;
  }

  .auth-viewport-wrapper {
    max-width: 100%;
    min-height: 100vh;
    min-height: 100dvh;
  }

  .auth-card-device {
    border-radius: 0;
    border: none;
    box-shadow: none;
    min-height: 100vh;
    min-height: 100dvh;
    padding: calc(24px + var(--safe-top)) 24px calc(24px + var(--safe-bottom));
  }

  .mascot-stage-box {
    height: 220px;
  }
  .mascot-avatar-hero {
    width: 200px;
    height: 200px;
  }

  .onboarding-title {
    font-size: 24px;
  }
}