* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

:root {
  --purple-1: #7c5cff;
  --purple-2: #a78bfa;
  --purple-dark: #4a2ecc;
  --text: #1f2233;
  --text-soft: #6b6f85;
  --line: #ebedf5;
  --danger: #dc2626;
}

html, body {
  height: 100%;
  font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
  color: var(--text);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

body {
  background:
    radial-gradient(60% 50% at 15% 0%, #a78bfa55 0%, transparent 60%),
    radial-gradient(60% 50% at 100% 20%, #7c5cff44 0%, transparent 60%),
    linear-gradient(180deg, #f4f5fb, #eef0fa);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  padding-top: max(20px, env(safe-area-inset-top));
  padding-bottom: max(20px, env(safe-area-inset-bottom));
}

/* Bolhas decorativas */
.bg-orbs {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}

.bg-orbs span {
  position: absolute;
  border-radius: 50%;
  filter: blur(70px);
  opacity: 0.6;
  animation: floatOrb 18s ease-in-out infinite;
}

.bg-orbs span:nth-child(1) {
  width: 280px; height: 280px;
  background: #a78bfa;
  top: -80px; left: -80px;
}

.bg-orbs span:nth-child(2) {
  width: 260px; height: 260px;
  background: #7c5cff;
  bottom: -100px; right: -80px;
  animation-delay: -6s;
}

.bg-orbs span:nth-child(3) {
  width: 200px; height: 200px;
  background: #c4b5fd;
  top: 45%; right: 5%;
  animation-delay: -12s;
}

@keyframes floatOrb {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(20px, -30px) scale(1.08); }
}

/* Wrapper centralizado — sem card branco */
.login-wrap {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 380px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.login-card {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  animation: cardIn 0.5s cubic-bezier(0.16, 1, 0.3, 1);
  /* SEM fundo branco, SEM borda, SEM sombra */
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 0;
}

@keyframes cardIn {
  from { opacity: 0; transform: translateY(20px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Boas-vindas */
.welcome {
  text-align: center;
  transition: all 0.35s ease;
  max-height: 320px;
  opacity: 1;
  overflow: hidden;
}

.login-card.open .welcome {
  max-height: 100px;
  margin-bottom: 4px;
}

.login-card.open .welcome p {
  opacity: 0;
  max-height: 0;
  margin: 0;
  transition: all 0.25s ease;
}

.brand-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 76px; height: 76px;
  background: linear-gradient(135deg, var(--purple-1), #6d4aff);
  border-radius: 24px;
  font-size: 2.1rem;
  margin-bottom: 16px;
  box-shadow: 0 16px 34px rgba(124, 92, 255, 0.45);
  transition: all 0.35s ease;
}

.login-card.open .brand-icon {
  width: 58px;
  height: 58px;
  font-size: 1.6rem;
  border-radius: 18px;
  margin-bottom: 10px;
}

.welcome h1 {
  font-size: 1.7rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, var(--purple-dark), var(--purple-1), var(--purple-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin-bottom: 6px;
}

.welcome p {
  font-size: 0.88rem;
  color: var(--text-soft);
  transition: all 0.3s ease;
}

/* Formulário animado */
.login-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transform: translateY(20px);
  transition:
    max-height 0.4s cubic-bezier(0.16, 1, 0.3, 1),
    opacity 0.3s ease 0.1s,
    transform 0.4s cubic-bezier(0.16, 1, 0.3, 1),
    margin-top 0.35s ease;
  margin-top: 0;
}

.login-card.open .login-form {
  max-height: 500px;
  opacity: 1;
  transform: translateY(0);
  margin-top: 10px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  opacity: 0;
  transform: translateY(10px);
  animation: fieldIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.login-card.open .field:nth-child(1) { animation-delay: 0.15s; }
.login-card.open .field:nth-child(2) { animation-delay: 0.22s; }

@keyframes fieldIn {
  to { opacity: 1; transform: translateY(0); }
}

.field label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-soft);
  letter-spacing: 0.01em;
  padding-left: 4px;
}

/* Inputs com efeito de vidro, sem card */
.field input {
  width: 100%;
  padding: 15px 18px;
  border: 1.5px solid rgba(255, 255, 255, 0.9);
  border-radius: 16px;
  font-size: 16px;
  font-family: inherit;
  color: var(--text);
  background: rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  transition: all 0.2s ease;
  box-shadow: 0 6px 18px rgba(31, 34, 51, 0.06);
}

.field input::placeholder {
  color: #a8adc0;
}

.field input:focus {
  outline: none;
  border-color: var(--purple-1);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 0 0 4px rgba(124, 92, 255, 0.18), 0 8px 20px rgba(124, 92, 255, 0.15);
}

/* Erro */
.error-msg {
  min-height: 0;
  font-size: 0.82rem;
  color: var(--danger);
  font-weight: 600;
  text-align: center;
  transition: all 0.25s ease;
  overflow: hidden;
}

.error-msg.show {
  min-height: 18px;
  padding: 4px 0;
}

/* Botão principal */
.btn-login {
  width: 100%;
  padding: 16px 20px;
  margin-top: 6px;
  background: linear-gradient(135deg, var(--purple-1), #6d4aff);
  color: white;
  border: none;
  border-radius: 16px;
  font-size: 1rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  box-shadow: 0 14px 30px rgba(124, 92, 255, 0.45);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  min-height: 54px;
  letter-spacing: 0.01em;
}

.btn-login:active {
  transform: scale(0.98);
  box-shadow: 0 8px 20px rgba(124, 92, 255, 0.4);
}

/* Botão voltar */
.btn-back {
  width: 100%;
  padding: 12px 16px;
  background: transparent;
  border: none;
  color: var(--text-soft);
  font-size: 0.85rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  border-radius: 12px;
  transition: all 0.18s ease;
}

.btn-back:active {
  background: rgba(124, 92, 255, 0.08);
  color: var(--purple-dark);
}

/* Botão inicial */
.btn-open {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 17px 24px;
  margin-top: 26px;
  background: linear-gradient(135deg, var(--purple-1), #6d4aff);
  color: white;
  border: none;
  border-radius: 18px;
  font-size: 1.05rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  box-shadow: 0 16px 34px rgba(124, 92, 255, 0.5);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  min-height: 58px;
  overflow: hidden;
  max-height: 90px;
  opacity: 1;
  letter-spacing: 0.01em;
}

.btn-open .arrow {
  transition: transform 0.3s ease;
  font-size: 1.2rem;
}

.btn-open:active {
  transform: scale(0.98);
}

.btn-open:hover .arrow {
  transform: translateX(5px);
}

.login-card.open .btn-open {
  max-height: 0;
  padding-top: 0;
  padding-bottom: 0;
  margin-top: 0;
  opacity: 0;
  pointer-events: none;
}

/* Rodapé */
.footnote {
  margin-top: 22px;
  text-align: center;
  font-size: 0.76rem;
  color: var(--text-soft);
  opacity: 0.7;
  transition: all 0.3s ease;
}

.login-card.open .footnote {
  margin-top: 16px;
  font-size: 0.72rem;
}

/* Ajustes finos mobile */
@media (max-width: 380px) {
  .welcome h1 { font-size: 1.45rem; }
  .brand-icon { width: 68px; height: 68px; font-size: 1.9rem; }
  .btn-open { font-size: 1rem; padding: 16px 20px; }
}