:root {
  --accent: #9c4c19;
  --accent-600: #8b4317;
  --muted: #d1d5db;
  --bg: #f0f2f5;
}

:where(button, a, input, [role="button"]):focus-visible {
  outline: 3px solid rgba(156, 76, 25, 0.55);
  outline-offset: 2px;
}

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

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Manrope', sans-serif;
}

body {
  width: 100%;
  height: 100vh;
  display: flex;
  overflow: hidden;
  background: var(--bg);
}

.main-container {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  perspective: 1200px;
}


.view-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;

  transition:
    transform 0.8s cubic-bezier(0.2, 0.9, 0.25, 1),
    opacity 0.6s ease;
  backface-visibility: hidden;
}


.login-view {
  transform: translateX(0) scale(1);
  opacity: 1;
  z-index: 2;
}

.signup-view {
  transform: translateX(100%) scale(0.98);
  opacity: 0;
  z-index: 1;
}

.forgot-password-view {
  transform: translateX(-100%) scale(0.98);
  opacity: 0;
  z-index: 1;
}

.verify-email-view {
  transform: translateY(-2px);
  opacity: 0;
  z-index: 1;
}


.main-container.sign-up-mode .login-view {
  transform: translateX(-100%) scale(0.98);
  opacity: 0;
  filter: none;
}

.main-container.sign-up-mode .signup-view {
  transform: translateX(0) scale(1);
  opacity: 1;
  z-index: 3;
  box-shadow: 0 20px 40px rgba(12, 12, 12, 0.08);
}


.main-container.forgot-password-mode .login-view {
  transform: translateX(100%) scale(0.98);
  opacity: 0;
}

.main-container.forgot-password-mode .forgot-password-view {
  transform: translateX(0) scale(1);
  opacity: 1;
  z-index: 3;
}

.main-container.verify-email-mode .login-view,
.main-container.verify-email-mode .signup-view,
.main-container.verify-email-mode .forgot-password-view {
  transform: translateY(-2px);
  opacity: 0;
  z-index: 1;
}

.main-container.verify-email-mode .verify-email-view {
  transform: translateY(-2px);
  opacity: 1;
  z-index: 3;
}

.main-container.sign-up-mode .form-wrapper,
.main-container.forgot-password-mode .form-wrapper,
.main-container .form-wrapper {
  transition:
    transform 0.6s cubic-bezier(0.2, 0.9, 0.25, 1),
    box-shadow 0.4s ease;
}

.main-container.sign-up-mode .form-wrapper {
  transform: translateZ(0) translateY(-4px);
}


.left-banner,
.right-form,
.left-section,
.right-section {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 3rem;
  text-align: center;
}


.light-bg {
  background: #eff4f4;
  color: #1a1a1a;
}

.white-bg {
  background: var(--bg);
  color: #333;
  text-align: left;
  align-items: flex-start;
}

.dark-bg {
  background: #9c4c19;
  color: white;
}


.banner-content,
.form-wrapper {
  max-width: 420px;
  width: 100%;
  margin: 0 auto;
}

.logo-big {
  width: 140px;
  margin: 0 auto 2rem auto;
  display: block;
  transform-origin: center;
  animation: logoPop 700ms ease both;
}

.logo-small {
  width: 90px;
  display: block;
  margin: 0 auto 1.8rem auto;
}

@keyframes logoPop {
  0% {
    transform: translateY(-1px) translateY(-6px);
    opacity: 0;
  }

  60% {
    transform: translateY(-1px) translateY(2px);
    opacity: 1;
  }

  100% {
    transform: translateY(-1px) translateY(0);
    opacity: 1;
  }
}

.banner-title,
.right-title,
.title,
.form-title {
  font-size: 32px;
  font-weight: 700;
  margin-bottom: 1rem;
}

.banner-desc,
.right-desc,
.subtitle,
.form-subtitle {
  font-size: 15px;
  margin-bottom: 2rem;
  opacity: 0.9;
  line-height: 1.5;
}

.illustration {
  width: 100%;
  max-width: 300px;
  margin: 2rem auto 0 auto;
  display: block;
  border-radius: 8px;
  transform-origin: center;
  will-change: transform;
  animation: floatIllustration 6s ease-in-out infinite;
}

@keyframes floatIllustration {
  0% {
    transform: translateY(0) rotate(0deg);
  }

  50% {
    transform: translateY(-10px) rotate(-0.6deg);
  }

  100% {
    transform: translateY(0) rotate(0deg);
  }
}


.input-group {
  margin-bottom: 1.2rem;
}

label {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 0.4rem;
  display: block;
}

.password-hint {
  display: block;
  margin-top: 0.4rem;
  font-size: 11px;
  color: #6b7280;
  line-height: 1.4;
}

.input-wrapper {
  background: var(--bg);
  border: 1px solid transparent;
  padding: 12px 20px;
  border-radius: 9999px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: inset 4px 4px 8px rgba(0,0,0,0.06), inset -4px -4px 8px rgba(255,255,255,0.8);
  transition: box-shadow 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.input-wrapper:focus-within {
  border-color: transparent;
  box-shadow: inset 6px 6px 12px rgba(0,0,0,0.08), inset -6px -6px 12px rgba(255,255,255,0.9), 0 0 0 2px rgba(160, 67, 10, 0.1);
}

.icon {
  width: 22px;
  height: 22px;
  stroke: #9ca3af;
  fill: none;
  flex-shrink: 0;
}

.input-wrapper input {
  border: none !important;
  outline: none !important;
  width: 100%;
  font-size: 14px;
  background: transparent !important;
  box-shadow: none !important;
  caret-color: var(--accent);
}


.input-wrapper input[type='text'],
.input-wrapper input[type='email'],
.input-wrapper input[type='password'],
.input-wrapper input[type='number'] {
  border-color: transparent !important;
  box-shadow: none !important;
  outline: none !important;
}

.otp-input {
  font-size: 32px !important;
  letter-spacing: 0.5em !important;
  font-weight: bold !important;
  text-align: center !important;
  padding: 8px 0 !important;
  color: #333 !important;
}

.toggle-password {
  background: transparent;
  border: none;
  cursor: pointer;
  display: flex;
  padding: 2px;
}

.eye-icon {
  width: 20px;
  height: 20px;
  stroke: #9ca3af;
  fill: none;
}

.forgot-pass {
  text-align: right;
  margin-top: 8px;
  margin-bottom: 20px;
  font-size: 13px;
}


a {
  color: inherit;

  text-decoration: none;
}

a:hover {
  text-decoration: none;
}


.forgot-pass a {
  color: #64748b;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s ease;
}

.forgot-pass a:hover {
  color: var(--accent);
  text-decoration: underline;
}


*:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}


input:focus,
textarea:focus,
select:focus {
  outline: none !important;
  border-color: var(--accent) !important;
  box-shadow: 0 0 0 3px rgba(160, 67, 10, 0.1) !important;

  caret-color: var(--accent) !important;
}


[type='text']:focus,
[type='email']:focus,
[type='url']:focus,
[type='password']:focus,
[type='number']:focus,
[type='date']:focus,
[type='datetime-local']:focus,
[type='month']:focus,
[type='search']:focus,
[type='tel']:focus,
[type='time']:focus,
[type='week']:focus,
[multiple]:focus,
textarea:focus,
select:focus {
  border-color: var(--accent) !important;
  box-shadow: 0 0 0 1px var(--accent) !important;
  outline: none !important;
}

.btn-submit {
  width: 100%;
  padding: 16px;
  background: var(--accent);
  border: none;
  color: white;
  font-size: 15px;
  font-weight: 700;
  border-radius: 9999px;
  cursor: pointer;
  box-shadow: 8px 8px 16px rgba(0,0,0,0.1), -8px -8px 16px rgba(255,255,255,0.4);
  transition: transform 0.2s cubic-bezier(0.22, 0.9, 0.35, 1), box-shadow 0.2s cubic-bezier(0.22, 0.9, 0.35, 1), background 0.3s ease;
  will-change: transform, box-shadow;
}

.btn-submit:hover {
  transform: translateY(-2px);
  box-shadow: 10px 10px 20px rgba(0,0,0,0.15), -10px -10px 20px rgba(255,255,255,0.5);
  background: var(--accent-600);
}

.btn-submit:active {
  transform: translateY(2px);
  box-shadow: inset 4px 4px 8px rgba(0,0,0,0.1), inset -4px -4px 8px rgba(255,255,255,0.1);
}

.btn-submit:focus {
  outline: none;
  box-shadow:
    0 32px 64px rgba(12, 12, 12, 0.16),
    0 0 0 6px rgba(156, 76, 25, 0.07);
}


.btn-submit:disabled {
  cursor: default;
  opacity: 0.86;
  transform: translateY(0) !important;
  box-shadow: 0 8px 20px rgba(12, 12, 12, 0.04) !important;
}

.switch-text {
  text-align: center;
  margin-top: 20px;
  font-size: 14px;
  color: #666;
}

.switch-text a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 700;
  transition: color 0.2s;
}

.switch-text a:hover {
  color: var(--accent-600);
  text-decoration: underline;
}


@media (max-width: 1024px) {
  body {
    height: 100dvh; /* Altura exata da viewport — respeita barra do browser */
    overflow: hidden; /* Sem scroll no body */
    padding: 0;
  }

  .main-container {
    height: 100%;
    overflow: hidden; /* Container não rola — só a view ativa rola */
  }

  .view-container {
    flex-direction: column;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow-y: auto;    /* Scroll isolado dentro de cada view */
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch; /* Scroll suave no iOS */
  }

  .login-view {
    flex-direction: column-reverse;
  }

  .light-bg,
  .white-bg,
  .dark-bg {
    padding: 32px 18px;
    flex: 0 0 auto; /* Não esticar — deixa o scroll funcionar naturalmente */
  }

  .illustration {
    max-width: 200px;
  }
}


@media (max-width: 640px) {
  .otp-input {
    font-size: 24px !important;
    letter-spacing: 0.3em !important;
    padding: 6px 0 !important;
  }

  .banner-title,
  .right-title,
  .title,
  .form-title {
    font-size: 26px;
  }

  .banner-desc,
  .right-desc,
  .subtitle,
  .form-subtitle {
    font-size: 14px;
  }

  .form-wrapper,
  .banner-content {
    max-width: 360px;
    width: 100%;
  }

  .input-wrapper {
    padding: 12px;
  }

  .btn-submit {
    padding: 14px;
  }


}

@media (max-width: 480px) {
  body {
    padding: 8px;
  }

  .light-bg,
  .white-bg,
  .dark-bg {
    padding: 28px 14px;
  }

  .logo-big {
    width: 120px;
  }

  .illustration {
    max-width: 170px;
  }

  .switch-text {
    font-size: 13px;
  }
}


.message-box {
  padding: 16px 20px;
  border-radius: 2rem;
  margin-bottom: 20px;
  font-size: 14px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
  animation: fadeIn 0.3s ease-out;
}

.message-box.hidden {
  display: none;
}

.message-box.error {
  background-color: #fef2f2;
  border: 1px solid #fee2e2;
  color: #b91c1c;
}

.message-box.success {
  background-color: #f0fdf4;
  border: 1px solid #dcfce7;
  color: #15803d;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-5px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}


.hidden {
  display: none !important;
}

.btn-clean {
  background: none;
  border: none;
  color: #6b7280;

  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  padding: 4px 8px;
  transition: color 0.2s;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.btn-clean:hover {
  color: var(--accent);
}


.tab-btn {
  flex: 1;
  padding: 12px 16px;
  background: transparent;
  border: none;
  border-radius: 9999px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  color: #666;
  box-shadow: inset 4px 4px 8px rgba(0,0,0,0.03), inset -4px -4px 8px rgba(255,255,255,0.5);
  transition: all 0.2s;
}

.tab-btn.active {
  background: var(--accent);
  color: white;
  box-shadow: 0 4px 12px rgba(156, 76, 25, 0.3);
}


.btn-danger {
  background: #dc2626 !important;
  color: white !important;
}

.btn-danger:hover {
  background: #b91c1c !important;
  box-shadow: 0 16px 32px rgba(220, 38, 38, 0.25) !important;
}

.btn-danger:active {
  background: #991b1b !important;
  box-shadow: 0 8px 16px rgba(220, 38, 38, 0.2) !important;
}

.btn-danger:focus {
  outline: none;
  box-shadow: 0 16px 32px rgba(220, 38, 38, 0.25), 0 0 0 6px rgba(220, 38, 38, 0.1) !important;
}


html.dark {
  --bg: #121212;
  --muted: #404040;
}

html.dark button[title="Alternar Tema"] {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

html.dark .white-bg {
  background: #1e1e1e;
  color: #e5e5e5;
}

html.dark .input-wrapper {
  background: var(--bg);
  box-shadow: inset 4px 4px 8px rgba(0,0,0,0.4), inset -4px -4px 8px rgba(255,255,255,0.03);
}

html.dark .input-wrapper input {
  color: #e5e5e5;
}

html.dark .input-wrapper input::placeholder {
  color: #888;
}

html.dark .form-title,
html.dark .title {
  color: #ffffff;
}

html.dark .form-subtitle,
html.dark .subtitle {
  color: #a3a3a3;
}

html.dark label {
  color: #d1d5db;
}

html.dark .forgot-pass a,
html.dark .switch-text,
html.dark .btn-clean {
  color: #a3a3a3;
}

html.dark .otp-input {
  color: #e5e5e5 !important;
}

html.dark .tab-btn {
  color: #a3a3a3;
  box-shadow: inset 4px 4px 8px rgba(0,0,0,0.3), inset -4px -4px 8px rgba(255,255,255,0.02);
}

html.dark .tab-btn.active {
  background: var(--accent);
  color: white;
  box-shadow: 0 4px 12px rgba(156, 76, 25, 0.4);
}

/* Painéis fixos da tela de login — imunes ao dark mode */
html.dark .light-bg {
  background: #eff4f4 !important;
  color: #1a1a1a !important;
}

html.dark .light-bg .banner-title,
html.dark .light-bg .banner-desc,
html.dark .light-bg h1,
html.dark .light-bg p {
  color: #1a1a1a !important;
}

html.dark .dark-bg {
  background: #9c4c19 !important;
  color: white !important;
}


/* Cor dos ícones de tema: sol preto, lua sea mist */
.icon-light {
  color: #1a1a1a !important;
}

.icon-dark {
  color: #DFE8E6 !important;
}

/* Botão de tema: fundo sempre transparente */
button[title="Alternar Tema"] {
  background: transparent;
}

/* Frame do card (borda + sombra) absolutamente fixo durante a wave transition */
::view-transition-old(theme-card-frame),
::view-transition-new(theme-card-frame) {
  animation: none;
  mix-blend-mode: normal;
}


/* Isola logos e ilustrações de cada view do clip-path da wave transition
   sem mexer nas animações CSS (logoPop / floatIllustration) */
.login-view .logo-big {
  view-transition-name: vt-logo-login;
}

.login-view .illustration {
  view-transition-name: vt-illus-login;
}

.signup-view .logo-big {
  view-transition-name: vt-logo-signup;
}

.signup-view .illustration {
  view-transition-name: vt-illus-signup;
}

.verify-email-view .logo-big {
  view-transition-name: vt-logo-verify;
}

.verify-email-view .illustration {
  view-transition-name: vt-illus-verify;
}

/* Spinner de Carregamento Elegante */
.spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid rgba(255,255,255,0.3);
  border-radius: 50%;
  border-top-color: #fff;
  animation: spin 1s ease-in-out infinite;
  margin-right: 8px;
  vertical-align: middle;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

.forgot-password-view .logo-big {
  view-transition-name: vt-logo-forgot;
}

.forgot-password-view .illustration {
  view-transition-name: vt-illus-forgot;
}

::view-transition-old(vt-logo-login),
::view-transition-new(vt-logo-login),
::view-transition-old(vt-illus-login),
::view-transition-new(vt-illus-login),
::view-transition-old(vt-logo-signup),
::view-transition-new(vt-logo-signup),
::view-transition-old(vt-illus-signup),
::view-transition-new(vt-illus-signup),
::view-transition-old(vt-logo-verify),
::view-transition-new(vt-logo-verify),
::view-transition-old(vt-illus-verify),
::view-transition-new(vt-illus-verify),
::view-transition-old(vt-logo-forgot),
::view-transition-new(vt-logo-forgot),
::view-transition-old(vt-illus-forgot),
::view-transition-new(vt-illus-forgot) {
  animation: none;
  mix-blend-mode: normal;
}
html {
    --shadow-neumorph: 8px 8px 16px rgba(0,0,0,0.06), -8px -8px 16px rgba(255,255,255,0.8);
    --shadow-neumorph-inner: inset 4px 4px 8px rgba(0,0,0,0.06), inset -4px -4px 8px rgba(255,255,255,0.8);
}
html.dark {
    --shadow-neumorph: 8px 8px 16px rgba(0,0,0,0.35), -4px -4px 10px rgba(255,255,255,0.02);
    --shadow-neumorph-inner: inset 4px 4px 8px rgba(0,0,0,0.35), inset -4px -4px 10px rgba(255,255,255,0.02);
}

html.dark { color-scheme: dark; }

/* Fix for dark mode dropdown options and date picker icons */
.dark select option {
    background-color: #1e293b !important; /* slate-800 */
    color: #f8fafc !important; /* slate-50 */
}
.dark input[type="date"]::-webkit-calendar-picker-indicator {
    filter: invert(1) opacity(0.7);
    cursor: pointer;
}
.dark {
    color-scheme: dark !important;
}

/* Absolute white calendar icon override */
.dark input[type="date"]::-webkit-calendar-picker-indicator {
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="15" viewBox="0 0 24 24"><path fill="%23ffffff" d="M20 3h-1V1h-2v2H7V1H5v2H4c-1.1 0-2 .9-2 2v16c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm0 18H4V8h16v13z"/></svg>') !important;
    filter: none !important;
    opacity: 0.9 !important;
}

/* Pitch black dropdown options to match dark UI */
.dark select option {
    background-color: #0a0a0a !important; /* Pitch black */
    color: #ffffff !important;
}
.dark select:focus {
    border-color: #c25c1b !important;
}
