* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Segoe UI", "Inter", system-ui, -apple-system, sans-serif;
  background: #f8fafc;
  color: #0f172a;
}

.auth-shell {
  max-width: 440px;
  margin: 15px auto;
  padding: 0 16px;
}

.auth-header {
  text-align: center;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 16px;
}

.logo {
  width: 54px;
  height: 54px;
  border-radius: 14px;
  background: linear-gradient(135deg, #4f46e5 0%, #3730a3 100%);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

.auth-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 18px 24px;
  box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.08);
}

.auth-tabs {
  display: flex;
  background: #f1f5f9;
  padding: 4px;
  border-radius: 8px;
  margin-bottom: 12px;
}

.tab-btn {
  flex: 1;
  padding: 10px;
  border: none;
  background: transparent;
  font-size: 14px;
  font-weight: 600;
  color: #475569;
  cursor: pointer;
  border-radius: 8px;
  transition: all 0.2s;
}

.tab-btn.active {
  background: #fff;
  color: #4f46e5;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.tab-btn.secondary {
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #e2e8f0;
  font-weight: 600;
  padding: 12px 20px;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.secondary:hover {
  background: #e2e8f0;
  color: #1e293b;
}

#auth-form-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.guest-info {
  background: #eff6ff;
  padding: 12px 16px;
  border-radius: 12px;
  border-left: 4px solid #3b82f6;
}

.guest-info p {
  margin: 0;
  font-size: 13px;
  color: #1e40af;
  line-height: 1.5;
}

.security-section {
  margin-top: 4px;
  padding: 8px;
  background: #f8fafc;
  border: 1px dashed #cbd5e1;
  border-radius: 12px;
  text-align: center;
}

.security-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 4px;
}

.security-header .icon {
  font-size: 18px;
}

.security-header h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  color: #334155;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.security-box label {
  align-items: center;
  gap: 12px;
}

#captcha-question {
  font-size: 15px;
  font-weight: 600;
  color: #1e293b;
}

.captcha-input-wrapper input {
  width: 100px;
  text-align: center;
  font-size: 18px;
  font-weight: 700;
  height: 48px;
}

#primary-auth-btn {
  width: 100%;
  height: 50px;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.02em;
  margin-top: 8px;
  background: linear-gradient(135deg, #4f46e5 0%, #4338ca 100%);
  border: none;
  border-radius: 12px;
  color: #fff;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 6px -1px rgba(79, 70, 229, 0.2), 0 10px 15px -3px rgba(79, 70, 229, 0.1);
}

#primary-auth-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 10px 15px -3px rgba(79, 70, 229, 0.3), 0 4px 6px -2px rgba(79, 70, 229, 0.1);
  filter: brightness(1.1);
}

#primary-auth-btn:active:not(:disabled) {
  transform: translateY(0);
}

#primary-auth-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  filter: grayscale(0.4);
  box-shadow: none;
}

.message {
  text-align: center;
  margin-top: 20px;
}

label {
  display: flex;
  flex-direction: column;
  font-size: 13px;
  color: #475569;
  gap: 6px;
}

input {
  padding: 12px;
  border-radius: 10px;
  border: 1px solid #cbd5e1;
  font-size: 15px;
  transition: border-color 0.2s;
}

input:focus {
  outline: none;
  border-color: #4f46e5;
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

*:focus-visible {
  outline: none !important;
  box-shadow: 0 0 0 2px #fff, 0 0 0 4px #4f46e5 !important;
}

.tab-btn:focus-visible {
  background: #e2e8f0;
}

.page-footer {
  padding: 12px 24px 24px;
  border-top: 1px solid #f1f5f9;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.footer-label {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #526071;
}

.social-links {
  display: flex;
  gap: 20px;
  justify-content: center;
}

.social-links a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #f8fafc;
  color: #475569;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid #e2e8f0;
}

.social-links a svg {
  width: 20px;
  height: 20px;
}

.social-links a:hover {
  background: #4f46e5;
  color: #fff;
  transform: translateY(-3px);
  box-shadow: 0 10px 15px -3px rgba(79, 70, 229, 0.2);
  border-color: #4f46e5;
}

.social-links a:active {
  transform: translateY(-1px);
}

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

.loading {
  position: relative;
  color: transparent !important;
}

.loading::after {
  content: "";
  position: absolute;
  width: 20px;
  height: 20px;
  top: 50%;
  left: 50%;
  margin: -10px 0 0 -10px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: #fff;
  animation: auth-spin 0.6s linear infinite;
}
