/* ============================================
   EWL Quiz - English With Love
   Pagina de Login
   ============================================ */

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --purple: #8D61AF;
  --purple-dark: #6b4489;
  --purple-light: #b28fd0;
  --purple-bg: #f5effe;
  --orange: #E86D27;
  --orange-dark: #c45a18;
  --orange-light: #f09060;
  --white: #ffffff;
  --gray-100: #f8f8f8;
  --gray-200: #efefef;
  --gray-400: #aaaaaa;
  --gray-700: #444444;
  --error: #e03e3e;
  --success: #2e9e5b;

  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 20px 60px rgba(141, 97, 175, 0.18);
  --transition: 0.25s ease;
}

html, body {
  height: 100%;
}

body {
  font-family: 'Poppins', sans-serif;
  background: linear-gradient(135deg, #f5effe 0%, #fef1e8 100%);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow-x: hidden;
  position: relative;
}

/* ---- Bolhas decorativas de fundo ---- */
.bubbles {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}

.bubble {
  position: absolute;
  border-radius: 50%;
  opacity: 0.12;
  animation: floatUp linear infinite;
}

.bubble:nth-child(1) { width: 80px;  height: 80px;  background: var(--purple); left: 5%;  bottom: -100px; animation-duration: 12s; animation-delay: 0s; }
.bubble:nth-child(2) { width: 50px;  height: 50px;  background: var(--orange); left: 20%; bottom: -100px; animation-duration: 9s;  animation-delay: 2s; }
.bubble:nth-child(3) { width: 110px; height: 110px; background: var(--purple); left: 40%; bottom: -100px; animation-duration: 15s; animation-delay: 4s; }
.bubble:nth-child(4) { width: 60px;  height: 60px;  background: var(--orange); left: 60%; bottom: -100px; animation-duration: 10s; animation-delay: 1s; }
.bubble:nth-child(5) { width: 90px;  height: 90px;  background: var(--purple); left: 75%; bottom: -100px; animation-duration: 13s; animation-delay: 3s; }
.bubble:nth-child(6) { width: 45px;  height: 45px;  background: var(--orange); left: 90%; bottom: -100px; animation-duration: 8s;  animation-delay: 5s; }

@keyframes floatUp {
  0%   { transform: translateY(0)   rotate(0deg);   opacity: 0.12; }
  80%  { opacity: 0.12; }
  100% { transform: translateY(-110vh) rotate(360deg); opacity: 0; }
}

/* ---- Container principal ---- */
.container {
  position: relative;
  z-index: 1;
  display: flex;
  width: min(960px, 95vw);
  min-height: 560px;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

/* ---- Painel de branding (esquerdo) ---- */
.brand-panel {
  flex: 1.1;
  background: linear-gradient(160deg, var(--purple) 0%, var(--purple-dark) 60%, #4a2a65 100%);
  padding: 48px 44px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
  color: white;
}

.brand-content {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 40px;
}

/* Logo */
.logo {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-icon {
  width: 52px;
  height: 52px;
  background: var(--orange);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 15px rgba(232, 109, 39, 0.45);
}

.logo-icon svg {
  width: 52px;
  height: 52px;
}

.logo-text {
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  opacity: 0.9;
  line-height: 1.3;
}

/* Headline */
.brand-headline h1 {
  font-size: 2.4rem;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.01em;
}

.brand-headline h1 em {
  font-style: normal;
  color: var(--orange-light);
}

.brand-headline p {
  margin-top: 12px;
  font-size: 1rem;
  opacity: 0.8;
  line-height: 1.6;
}

/* Badges */
.brand-badges {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.badge {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 40px;
  padding: 9px 18px;
  font-size: 0.88rem;
  font-weight: 500;
  backdrop-filter: blur(4px);
  width: fit-content;
}

.badge-icon {
  font-size: 1.1rem;
}

/* Circulos decorativos */
.deco-circle {
  position: absolute;
  border-radius: 50%;
  opacity: 0.1;
  z-index: 1;
}

.deco-1 {
  width: 260px;
  height: 260px;
  background: white;
  top: -80px;
  right: -80px;
}

.deco-2 {
  width: 180px;
  height: 180px;
  background: var(--orange);
  bottom: -60px;
  left: -40px;
}

/* ---- Painel do formulario (direito) ---- */
.form-panel {
  flex: 1;
  background: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 36px;
}

.form-card {
  width: 100%;
  max-width: 360px;
}

.form-header {
  margin-bottom: 28px;
}

.form-header h2 {
  font-size: 1.7rem;
  font-weight: 800;
  color: var(--purple-dark);
}

.form-header p {
  margin-top: 6px;
  font-size: 0.9rem;
  color: var(--gray-400);
}

/* ---- Seletor de perfil ---- */
.role-selector {
  display: flex;
  gap: 10px;
  margin-bottom: 28px;
  background: var(--gray-100);
  border-radius: var(--radius-sm);
  padding: 5px;
}

.role-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 12px 10px;
  border: 2px solid transparent;
  border-radius: 8px;
  background: transparent;
  cursor: pointer;
  font-family: 'Poppins', sans-serif;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--gray-400);
  transition: all var(--transition);
}

.role-btn:hover:not(.active) {
  color: var(--purple);
  background: rgba(141, 97, 175, 0.06);
}

.role-btn.active {
  background: var(--white);
  color: var(--purple);
  border-color: var(--purple-light);
  box-shadow: 0 2px 8px rgba(141, 97, 175, 0.15);
}

.role-icon {
  font-size: 1.4rem;
}

/* ---- Grupos do formulario ---- */
.form-group {
  margin-bottom: 18px;
}

.form-group label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--gray-700);
  margin-bottom: 7px;
}

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

.input-icon {
  position: absolute;
  left: 13px;
  color: var(--gray-400);
  display: flex;
  align-items: center;
  pointer-events: none;
  transition: color var(--transition);
}

.input-wrapper input {
  width: 100%;
  padding: 12px 14px 12px 42px;
  border: 2px solid var(--gray-200);
  border-radius: var(--radius-sm);
  font-family: 'Poppins', sans-serif;
  font-size: 0.9rem;
  color: var(--gray-700);
  background: var(--gray-100);
  outline: none;
  transition: border-color var(--transition), background var(--transition), box-shadow var(--transition);
}

.input-wrapper input::placeholder {
  color: var(--gray-400);
  font-size: 0.85rem;
}

.input-wrapper input:focus {
  border-color: var(--purple);
  background: var(--white);
  box-shadow: 0 0 0 4px rgba(141, 97, 175, 0.1);
}

.input-wrapper input:focus + .input-icon,
.input-wrapper:focus-within .input-icon {
  color: var(--purple);
}

.input-wrapper input.error {
  border-color: var(--error);
  background: #fff5f5;
}

.toggle-password {
  position: absolute;
  right: 13px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--gray-400);
  display: flex;
  align-items: center;
  padding: 2px;
  transition: color var(--transition);
}

.toggle-password:hover {
  color: var(--purple);
}

/* ---- Mensagem de erro ---- */
.error-msg {
  display: none;
  align-items: center;
  gap: 8px;
  background: #fff0f0;
  border: 1px solid #ffc0c0;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 0.83rem;
  color: var(--error);
  margin-bottom: 16px;
}

.error-msg.visible {
  display: flex;
}

/* ---- Botao de login ---- */
.btn-login {
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, var(--orange) 0%, var(--orange-dark) 100%);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  font-family: 'Poppins', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  letter-spacing: 0.02em;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: transform var(--transition), box-shadow var(--transition), background var(--transition);
  box-shadow: 0 4px 18px rgba(232, 109, 39, 0.35);
  position: relative;
  overflow: hidden;
  margin-top: 4px;
}

.btn-login::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--purple) 0%, var(--purple-dark) 100%);
  opacity: 0;
  transition: opacity var(--transition);
}

.btn-login:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(232, 109, 39, 0.4);
}

.btn-login:active {
  transform: translateY(0);
}

.btn-login.loading .btn-text {
  opacity: 0;
}

.btn-login.loading .btn-loader {
  display: block;
}

.btn-text {
  position: relative;
  z-index: 1;
}

.btn-loader {
  display: none;
  width: 20px;
  height: 20px;
  border: 3px solid rgba(255,255,255,0.4);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  position: absolute;
}

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

/* ---- Divisor "ou" ---- */
.google-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0 16px;
}

.google-divider span {
  flex: 1;
  height: 1px;
  background: var(--gray-200);
}

.google-divider p {
  font-size: 0.78rem;
  color: var(--gray-400);
  font-weight: 500;
  white-space: nowrap;
}

/* ---- Container do botao Google ---- */
#googleSignInBtn {
  display: flex;
  justify-content: center;
  margin-bottom: 4px;
}

/* ---- Rodape do formulario ---- */
.form-footer {
  text-align: center;
  margin-top: 20px;
  font-size: 0.78rem;
  color: var(--gray-400);
}

/* ---- Toast de sucesso ---- */
.toast {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: white;
  border-radius: 40px;
  padding: 14px 28px;
  font-size: 0.9rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.14);
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s;
  opacity: 0;
  pointer-events: none;
  z-index: 100;
  white-space: nowrap;
}

.toast.toast-success {
  border-left: 5px solid var(--success);
  color: var(--success);
}

.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

.toast-icon {
  font-size: 1.2rem;
}

/* ============================================
   Responsivo - Tablet
   ============================================ */
@media (max-width: 720px) {
  .container {
    flex-direction: column;
    min-height: unset;
    border-radius: var(--radius);
    margin: 16px;
  }

  .brand-panel {
    padding: 32px 28px;
  }

  .brand-headline h1 {
    font-size: 1.8rem;
  }

  .brand-badges {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 8px;
  }

  .badge {
    font-size: 0.78rem;
    padding: 7px 14px;
  }

  .form-panel {
    padding: 32px 24px;
  }

  .deco-1 { display: none; }
  .deco-2 { display: none; }
}

/* ============================================
   Responsivo - Mobile (celular)
   ============================================ */
@media (max-width: 520px) {
  body {
    align-items: flex-start;
    background: var(--white);
  }

  .bubbles { display: none; }

  .container {
    flex-direction: column;
    width: 100%;
    min-height: 100vh;
    border-radius: 0;
    margin: 0;
    box-shadow: none;
  }

  .brand-panel {
    display: none;
  }

  .form-panel {
    flex: 1;
    align-items: flex-start;
    padding: 48px 28px 32px;
    background: var(--white);
  }

  .form-card {
    max-width: 100%;
  }

  .form-header {
    margin-bottom: 24px;
  }

  .form-header h2 {
    font-size: 1.5rem;
  }
}
