* { box-sizing: border-box; }

:root {
  --login-bg: #f4f5f7;
  --login-card: #ffffff;
  --login-text: #1f2937;
  --login-muted: #6b7280;
  --login-border: #e2e8f0;
  --login-accent: #c8102e;
  --login-accent-dark: #a60d27;
  --login-glow: rgba(200, 16, 46, 0.16);
}

html, body {
  height: 100%;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Montserrat', 'Space Grotesk', sans-serif;
  background: var(--login-bg);
  color: var(--login-text);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  position: relative;
  overflow: hidden;
}

body::before,
body::after {
  content: '';
  position: absolute;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(200, 16, 46, 0.22), transparent 65%);
  filter: blur(10px);
  z-index: 0;
}

body::before {
  top: -120px;
  right: -140px;
}

body::after {
  bottom: -160px;
  left: -120px;
}

.login-container {
  background: var(--login-card);
  border-radius: 18px;
  box-shadow: 0 30px 80px rgba(15, 23, 42, 0.14);
  padding: 44px 42px 40px;
  width: 100%;
  max-width: 440px;
  margin: 20px;
  position: relative;
  z-index: 1;
  border: 1px solid rgba(148, 163, 184, 0.2);
}

.login-header {
  text-align: center;
  margin-bottom: 32px;
}

.login-logo {
  width: 120px;
  height: auto;
  margin-bottom: 12px;
}

.login-header h1 {
  font-family: 'Montserrat', sans-serif;
  font-size: 26px;
  color: var(--login-text);
  margin: 0 0 6px;
  letter-spacing: 0.4px;
}

.login-header p {
  font-size: 14px;
  color: var(--login-muted);
  margin: 0;
}

.auth-logos {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin: 14px auto 0;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--login-border);
  background: #f8fafc;
  font-size: 12px;
  color: var(--login-muted);
}

.auth-logos-single {
  margin-top: 12px;
}

.auth-logos img {
  width: 26px;
  height: 26px;
  border-radius: 6px;
}

.auth-logo-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: none;
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
  padding: 0;
}

.auth-logo-btn:focus-visible {
  outline: 2px solid var(--login-accent);
  outline-offset: 4px;
  border-radius: 999px;
}

.auth-separator {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

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

.form-group label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--login-text);
  margin-bottom: 6px;
}

.form-group input {
  width: 100%;
  padding: 12px 14px;
  font-size: 16px;
  border: 1px solid var(--login-border);
  border-radius: 10px;
  background: #fbfbfd;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.form-group input:focus {
  outline: none;
  border-color: var(--login-accent);
  box-shadow: 0 0 0 3px var(--login-glow);
}

.email-suggestions {
  margin-top: 4px;
  border: 1px solid var(--login-border);
  border-radius: 10px;
  background: #ffffff;
  max-height: 160px;
  overflow-y: auto;
  display: none;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
}

.email-suggestions.visible {
  display: block;
}

.email-suggestion {
  padding: 10px 14px;
  cursor: pointer;
  font-size: 14px;
  transition: background 0.15s;
}

.email-suggestion:hover {
  background: #f8fafc;
}

.btn-login {
  width: 100%;
  padding: 12px;
  background: linear-gradient(135deg, var(--login-accent), #e11d48);
  color: white;
  border: none;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 16px 30px rgba(200, 16, 46, 0.22);
}

.btn-login:hover {
  transform: translateY(-1px);
  box-shadow: 0 18px 32px rgba(200, 16, 46, 0.28);
}

.btn-login:disabled {
  background: #e2e8f0;
  color: #94a3b8;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

.qr-section {
  text-align: center;
  margin: 24px 0;
  display: none;
}

.qr-section.visible {
  display: block;
}

.qr-section p {
  font-size: 14px;
  color: var(--login-muted);
  margin: 0 0 16px;
}

.qr-section canvas {
  margin: 0 auto;
}

#qrCode {
  display: inline-block;
}

.code-input {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-bottom: 20px;
}

.code-input input {
  width: 48px;
  height: 56px;
  text-align: center;
  font-size: 24px;
  font-weight: 600;
  border: 2px solid var(--login-border);
  border-radius: 10px;
  transition: border-color 0.2s;
}

.code-input input:focus {
  outline: none;
  border-color: var(--login-accent);
  box-shadow: 0 0 0 3px var(--login-glow);
}

.status-message {
  text-align: center;
  padding: 10px;
  border-radius: 6px;
  font-size: 14px;
  margin-top: 16px;
  display: none;
}

.status-message.error {
  background: #fce8e6;
  color: #d93025;
  display: block;
}

.status-message.success {
  background: #e6f4ea;
  color: #1e8e3e;
  display: block;
}

.status-message.info {
  background: #e8f0fe;
  color: #1967d2;
  display: block;
}

.step-indicator {
  text-align: center;
  font-size: 13px;
  color: var(--login-muted);
  margin-bottom: 16px;
}

.step-indicator .current {
  color: var(--login-accent);
  font-weight: 700;
}

@media (max-width: 640px) {
  .login-container {
    padding: 36px 24px;
  }

  .login-logo {
    width: 100px;
  }

  .login-header h1 {
    font-size: 22px;
  }

  .auth-logos {
    gap: 8px;
    padding: 6px 10px;
  }

  .auth-logos img {
    width: 22px;
    height: 22px;
  }
}
