@import url("https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700;800&display=swap");

:root {
  --bg-start: #050816;
  --bg-end: #0b1220;
  --panel: rgba(10, 15, 28, 0.8);
  --panel-strong: rgba(12, 18, 34, 0.92);
  --panel-border: rgba(255, 255, 255, 0.08);
  --text: #f4f7fb;
  --muted: #9aa6b2;
  --accent: #8b5cf6;
  --accent-2: #22c55e;
  --danger: #ef4444;
  --shadow: 0 30px 80px rgba(0, 0, 0, 0.35);
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 16px;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Manrope", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(139, 92, 246, 0.26), transparent 32%),
    radial-gradient(circle at 85% 18%, rgba(34, 197, 94, 0.16), transparent 24%),
    linear-gradient(135deg, var(--bg-start), var(--bg-end));
  overflow-x: hidden;
}

a {
  color: inherit;
}

button,
input {
  font: inherit;
}

.auth-background {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.orb {
  position: absolute;
  border-radius: 999px;
  filter: blur(0);
  opacity: 0.9;
}

.orb-1 {
  top: -8rem;
  left: -6rem;
  width: 24rem;
  height: 24rem;
  background: radial-gradient(circle, rgba(139, 92, 246, 0.26), rgba(139, 92, 246, 0.02) 70%);
}

.orb-2 {
  right: -5rem;
  bottom: -7rem;
  width: 22rem;
  height: 22rem;
  background: radial-gradient(circle, rgba(34, 197, 94, 0.18), rgba(34, 197, 94, 0.02) 68%);
}

.grid {
  position: absolute;
  inset: 0;
  background-image: linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(circle at center, black 34%, transparent 78%);
  opacity: 0.45;
}

.auth-shell {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(360px, 0.85fr);
  gap: 28px;
  align-items: center;
  padding: 32px 0;
}

.auth-copy,
.auth-card {
  animation: fadeUp 0.7s ease both;
}

.auth-copy {
  padding: 28px 10px 28px 0;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 72px;
  height: 72px;
  margin-bottom: 24px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.22);
  backdrop-filter: blur(18px);
}

.logo {
  width: 54px;
  height: 54px;
  object-fit: cover;
  border-radius: 14px;
  display: block;
}

.eyebrow {
  display: inline-flex;
  margin-bottom: 18px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--muted);
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.auth-copy h1 {
  margin: 0;
  max-width: 11ch;
  font-size: clamp(2.6rem, 5vw, 5rem);
  line-height: 0.96;
  letter-spacing: -0.06em;
}

.lead {
  max-width: 540px;
  margin: 22px 0 0;
  color: rgba(244, 247, 251, 0.74);
  font-size: 1.05rem;
  line-height: 1.7;
}

.feature-list {
  list-style: none;
  padding: 0;
  margin: 28px 0 0;
  display: grid;
  gap: 14px;
}

.feature-list li {
  display: flex;
  align-items: center;
  gap: 12px;
  color: rgba(244, 247, 251, 0.88);
  font-size: 0.98rem;
}

.feature-list i {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
  color: #c4b5fd;
  flex: 0 0 auto;
}

.auth-card {
  position: relative;
  width: 100%;
  padding: 28px;
  border-radius: var(--radius-xl);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.03)), var(--panel);
  border: 1px solid var(--panel-border);
  box-shadow: var(--shadow);
  backdrop-filter: blur(22px);
  overflow: hidden;
}

.auth-card::before {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.14), transparent 30%, transparent 70%, rgba(139, 92, 246, 0.2));
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask-composite: exclude;
  pointer-events: none;
}

.card-header {
  text-align: center;
  margin-bottom: 24px;
}

.card-header .logo-container {
  display: inline-flex;
  margin-bottom: 16px;
}

.card-header h2 {
  margin: 0;
  font-size: 1.6rem;
  letter-spacing: -0.04em;
}

.card-header p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.alert {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  width: min(calc(100% - 24px), 420px);
  padding: 10px 14px;
  border-radius: 999px;
  margin: 0;
  font-size: 0.84rem;
  line-height: 1.35;
  text-align: center;
  backdrop-filter: blur(16px);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.28);
  z-index: 30;
}

.alert.error {
  color: #fee2e2;
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.22);
}

.alert.success {
  color: #dcfce7;
  background: rgba(34, 197, 94, 0.1);
  border: 1px solid rgba(34, 197, 94, 0.18);
}

.social-login {
  display: grid;
  gap: 10px;
  margin-bottom: 18px;
}

.google-button {
  display: flex;
  justify-content: center;
  min-height: 44px;
}

.google-button.is-hidden {
  display: none;
}

.social-help {
  margin: 0;
  color: var(--muted);
  font-size: 0.83rem;
  text-align: center;
}

.social-help[data-state="warn"] {
  color: #fca5a5;
}

.divider {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 22px 0;
  color: var(--muted);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.divider::before,
.divider::after {
  content: "";
  height: 1px;
  flex: 1;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.14), transparent);
}

.login-form {
  position: relative;
  z-index: 1;
}

.form-group {
  margin-bottom: 16px;
}

.input-group {
  position: relative;
  display: flex;
  align-items: center;
}

.input-group i {
  position: absolute;
  left: 16px;
  color: #8f9bad;
  font-size: 1.08rem;
  z-index: 1;
}

.input-group .toggle-password {
  left: auto;
  right: 16px;
  cursor: pointer;
}

input[type="email"],
input[type="password"],
input[type="text"] {
  width: 100%;
  height: 52px;
  padding: 0 52px 0 46px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease, background 0.2s ease;
}

input::placeholder {
  color: #7d8794;
}

input[type="password"]::-ms-reveal,
input[type="password"]::-ms-clear,
input[type="password"]::-webkit-credentials-auto-fill-button {
  display: none;
}

input:focus {
  border-color: rgba(139, 92, 246, 0.5);
  box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.16);
  background: rgba(255, 255, 255, 0.06);
}

.form-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 18px 0 22px;
}

.remember-me {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 0.92rem;
  cursor: pointer;
}

.remember-me input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
}

.forgot-password {
  color: #d8ddf0;
  text-decoration: none;
  font-size: 0.92rem;
  transition: color 0.2s ease;
}

.forgot-password:hover {
  color: #ffffff;
}

.btn {
  width: 100%;
  height: 52px;
  border: none;
  border-radius: var(--radius-md);
  color: #ffffff;
  background: linear-gradient(135deg, #8b5cf6, #6d28d9);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
  box-shadow: 0 18px 30px rgba(109, 40, 217, 0.26);
}

.btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.04);
}

.btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
}

.btn i {
  font-size: 1.2rem;
}

.loader {
  display: none;
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: rgba(5, 8, 22, 0.7);
  backdrop-filter: blur(12px);
  justify-content: center;
  align-items: center;
  z-index: 10;
}

.spinner {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  border: 4px solid rgba(255, 255, 255, 0.12);
  border-top-color: #ffffff;
  animation: spin 0.95s linear infinite;
}

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

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ═══════════════════════════════════════════════════════════════════════════
   MODAL DE RECUPERAÇÃO DE SENHA
   ═══════════════════════════════════════════════════════════════════════════ */

.modal-forgot-password {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeUp 0.3s ease-out;
}

.modal-backdrop-forgot {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(5, 8, 22, 0.7);
  backdrop-filter: blur(4px);
  z-index: -1;
}

.modal-content-forgot {
  background: var(--panel-strong);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-lg);
  max-width: 420px;
  width: 100%;
  box-shadow: var(--shadow);
  z-index: 1001;
  animation: fadeUp 0.3s ease-out;
}

.modal-header-forgot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 28px 28px 20px;
  border-bottom: 1px solid var(--panel-border);
}

.modal-header-forgot h2 {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
}

.modal-close-forgot {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  transition: all 0.2s ease;
}

.modal-close-forgot:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
}

.modal-body-forgot {
  padding: 28px;
}

.modal-instruction {
  margin: 0 0 24px;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.5;
}

.form-group-forgot {
  margin-bottom: 20px;
}

.form-group-forgot label {
  display: block;
  margin-bottom: 8px;
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 500;
}

.input-group-forgot {
  position: relative;
  display: flex;
  align-items: center;
}

.input-group-forgot i {
  position: absolute;
  left: 14px;
  color: var(--muted);
  font-size: 1.1rem;
  z-index: 1;
}

.input-group-forgot input {
  width: 100%;
  padding: 12px 14px 12px 42px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--panel-border);
  border-radius: 10px;
  color: var(--text);
  font-size: 0.95rem;
  transition: all 0.2s ease;
}

.input-group-forgot input:focus {
  outline: none;
  border-color: var(--accent);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}

.input-group-forgot input::placeholder {
  color: var(--muted);
}

.form-message-forgot {
  padding: 12px;
  border-radius: 8px;
  margin-bottom: 20px;
  font-size: 0.9rem;
  line-height: 1.5;
}

.form-message-forgot.success {
  background: rgba(34, 197, 94, 0.15);
  border: 1px solid rgba(34, 197, 94, 0.3);
  color: #22c55e;
}

.form-message-forgot.error {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #ef4444;
}

.btn-forgot {
  width: 100%;
  padding: 12px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border: none;
  border-radius: 10px;
  color: white;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s ease;
  position: relative;
}

.btn-forgot:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(139, 92, 246, 0.3);
}

.btn-forgot:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.loader-forgot {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 12px;
}

.modal-footer-forgot {
  padding: 16px 28px;
  border-top: 1px solid var(--panel-border);
  text-align: center;
  color: var(--muted);
  font-size: 0.9rem;
}

.modal-footer-forgot a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
  transition: color 0.2s ease;
}

.modal-footer-forgot a:hover {
  color: var(--accent-2);
}

@media (max-width: 480px) {
  .modal-content-forgot {
    max-width: 100%;
    border-radius: var(--radius-md);
  }

  .modal-header-forgot,
  .modal-body-forgot,
  .modal-footer-forgot {
    padding: 20px;
  }

  .modal-header-forgot h2 {
    font-size: 1.25rem;
  }
}

@media (max-width: 1024px) {
  .auth-shell {
    grid-template-columns: 1fr;
    gap: 0;
    width: min(480px, calc(100% - 24px));
    padding: 24px 0;
    justify-content: center;
  }

  .auth-copy {
    display: none !important;
  }
}

@media (max-width: 640px) {
  .auth-shell {
    width: min(100% - 18px, 100%);
    padding: 18px 0;
  }

  .auth-card {
    padding: 22px 18px;
    border-radius: 24px;
  }

  .form-options {
    flex-direction: column;
    align-items: flex-start;
  }

  .btn,
  input[type="email"],
  input[type="password"],
  input[type="text"] {
    height: 50px;
  }

  .alert {
    bottom: 16px;
    width: min(calc(100% - 16px), 360px);
    padding: 9px 12px;
    font-size: 0.8rem;
  }
}
